> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/curator/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/curator/_mcp/server.

# nemo_curator.utils.operation_utils

## Module Contents

### Functions

| Name                                                                                                           | Description                                                                    |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ |
| [`get_tmp_dir`](#nemo_curator-utils-operation_utils-get_tmp_dir)                                               | Retrieve the appropriate temporary directory based on the runtime environment. |
| [`make_named_temporary_file`](#nemo_curator-utils-operation_utils-make_named_temporary_file)                   | Context manager to create a named temporary file.                              |
| [`make_pipeline_named_temporary_file`](#nemo_curator-utils-operation_utils-make_pipeline_named_temporary_file) | Context manager to create a named temporary file for pipelines.                |
| [`make_pipeline_temporary_dir`](#nemo_curator-utils-operation_utils-make_pipeline_temporary_dir)               | Context manager to create a temporary directory for pipelines.                 |
| [`make_temporary_dir`](#nemo_curator-utils-operation_utils-make_temporary_dir)                                 | Context manager to create a temporary directory.                               |

### API

```python
nemo_curator.utils.operation_utils.get_tmp_dir() -> pathlib.Path
```

Retrieve the appropriate temporary directory based on the runtime environment.

**Returns:** `pathlib.Path`

pathlib.Path: Path to the temporary directory.

```python
nemo_curator.utils.operation_utils.make_named_temporary_file(
    prefix: str | None = None,
    suffix: str | None = None,
    delete: bool = True,
    target_dir: pathlib.Path | None = None
) -> collections.abc.Generator[pathlib.Path, None, None]
```

Context manager to create a named temporary file.

**Parameters:**

**`prefix`** `Optional[str]` — default: None

Prefix for the file name. Defaults to None.

---

**`suffix`** `Optional[str]` — default: None

suffix for the file name. Defaults to None.

---

**`delete`** `bool` — default: True

If True, the file will be deleted upon exit. Defaults to True.

---

**`target_dir`** `Optional[pathlib.Path]` — default: None

Directory where the file should be created. Defaults to None.

---

```python
nemo_curator.utils.operation_utils.make_pipeline_named_temporary_file(
    sub_dir: str | None = None,
    suffix: str | None = None
) -> collections.abc.Generator[pathlib.Path, None, None]
```

Context manager to create a named temporary file for pipelines.

```python
nemo_curator.utils.operation_utils.make_pipeline_temporary_dir(
    sub_dir: str | None = None
) -> collections.abc.Generator[pathlib.Path, None, None]
```

Context manager to create a temporary directory for pipelines.

```python
nemo_curator.utils.operation_utils.make_temporary_dir(
    prefix: str | None = None,
    target_dir: pathlib.Path | None = None,
    delete: bool = True
) -> collections.abc.Generator[pathlib.Path, None, None]
```

Context manager to create a temporary directory.

**Parameters:**

**`prefix`** `Optional[str]` — default: None

Prefix for the directory name. Defaults to None.

---

**`target_dir`** `Optional[pathlib.Path]` — default: None

Parent directory for the temporary directory. Defaults to None.

---

**`delete`** `bool` — default: True

If True, the directory will be deleted upon exit. Defaults to True.

---