Download release/manipulationarena/paths.py from AI45Research/ManipulationArena: direct link, hf CLI and curl.
- Browser
- Download file 973 Bytes
-
https://huggingface.co/datasets/AI45Research/ManipulationArena/resolve/main/release/manipulationarena/paths.py
- Command line
-
hf download hf://datasets/AI45Research/ManipulationArena/release/manipulationarena/paths.py
-
curl -L -o paths.py https://huggingface.co/datasets/AI45Research/ManipulationArena/resolve/main/release/manipulationarena/paths.py
973 Bytes
| """Resolve a release directory for source-tree and installed-package entrypoints.""" | |
| from __future__ import annotations | |
| import os | |
| from pathlib import Path | |
| def dataset_root(root: Path | str | None = None) -> Path: | |
| """Prefer an explicit root, then its environment setting, then local data.""" | |
| configured = root if root is not None else os.environ.get('MANIPULATIONARENA_ROOT') | |
| candidates = ([Path(configured)] if configured is not None else | |
| [Path(__file__).resolve().parents[1], Path.cwd()]) | |
| markers = ('index/units.jsonl', 'engine/profiles.json', 'environment/manifest.json') | |
| for candidate in candidates: | |
| resolved = candidate.expanduser().resolve() | |
| if all((resolved / marker).is_file() for marker in markers): | |
| return resolved | |
| raise ValueError('Dataset root was not found. Pass --root /path/to/ManipulationArena ' | |
| 'or set MANIPULATIONARENA_ROOT to the complete release directory.') | |