> This page is for version 0.3.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

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

Backward-compatibility helpers for symbols relocated during the CLI refactor.

It provides a lazy import mechanism for symbols that were moved to the `nemo_gym.cli`
package and emits a `DeprecationWarning` pointing at the correct import path.

Note that an eager re-export `from nemo_gym.cli.x import foo` at the top of a
core module would create a circular import.

## Module Contents

### Functions

| Name                                                            | Description                                                                                |
| --------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
| [`moved_attr_getter`](#nemo_gym-utils-compat-moved_attr_getter) | Build a module `__getattr__` that re-exports relocated symbols with a deprecation warning. |

### API

```python
nemo_gym.utils.compat.moved_attr_getter(
    module_name: str,
    moved: typing.Mapping[str, str]
) -> typing.Callable[[str], typing.Any]
```

Build a module `__getattr__` that re-exports relocated symbols with a deprecation warning.

**Parameters:**

**`module_name`** `str`

The `__name__` of the module installing the shim (the old location).

---

**`moved`** `Mapping[str, str]`

Maps each old attribute name to its new location. The value is either
`"package.module"` (same attribute name) or `"package.module:new_name"`
when the symbol was also renamed.

---

**Returns:** `Callable[[str], Any]`

A function suitable for assigning to a module's `__getattr__`.