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

# nemo_gym.sandbox.utils

Sandbox utility helpers.

## Module Contents

### Functions

| Name                                                     | Description                                                             |
| -------------------------------------------------------- | ----------------------------------------------------------------------- |
| [`cpu_cap_env`](#nemo_gym-sandbox-utils-cpu_cap_env)     | CPU\_CAP\_ENV\_VARS derived from a sandbox CPU limit; empty when unset. |
| [`rewrite_image`](#nemo_gym-sandbox-utils-rewrite_image) | Apply ordered image-prefix rewrites used by sandbox configs.            |

### Data

[`CPU_CAP_ENV_VARS`](#nemo_gym-sandbox-utils-CPU_CAP_ENV_VARS)

### API

```python
nemo_gym.sandbox.utils.cpu_cap_env(
    cpu: float | int | None
) -> dict[str, str]
```

CPU\_CAP\_ENV\_VARS derived from a sandbox CPU limit; empty when unset.

```python
nemo_gym.sandbox.rewrite_image(
    image: str | None,
    rewrites: list[dict[str, str]]
) -> str | None
```

Apply ordered image-prefix rewrites used by sandbox configs.

```python
nemo_gym.sandbox.utils.CPU_CAP_ENV_VARS: tuple[str, ...] = ('OMP_NUM_THREADS', 'OMP_THREAD_LIMIT', 'OPENBLAS_NUM_THREADS', 'MKL_NUM_THREADS...
```