> 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.providers.utils

Helpers shared by the built-in sandbox providers.

These were previously duplicated verbatim across the enroot, apptainer, and
opensandbox providers. They live here so there is a single implementation.

## Module Contents

### Functions

| Name                                                                     | Description                                                                      |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------- |
| [`coerce_config`](#nemo_gym-sandbox-providers-utils-coerce_config)       | Accept either a config dataclass instance or a plain mapping (Hydra YAML).       |
| [`path_under_mount`](#nemo_gym-sandbox-providers-utils-path_under_mount) | If `path` is inside the mount, return its path relative to the mount; else None. |

### API

```python
nemo_gym.sandbox.providers.utils.coerce_config(
    value: typing.Any,
    config_cls: type[typing.Any]
) -> typing.Any
```

Accept either a config dataclass instance or a plain mapping (Hydra YAML).

```python
nemo_gym.sandbox.providers.utils.path_under_mount(
    mount_point: str,
    path: str
) -> str | None
```

If `path` is inside the mount, return its path relative to the mount; else None.