HF RL Explorer

Write a Python function called expandpath that accepts a single argument path (a string or path-like object)…

Write a Python function called expandpath that accepts a single argument path (a string or path-like object)…: a task in repo2rlenv-r2e (Harbor dataset). The function must: 1. Accept a str or os.PathLike as input. 2. Expand a leading ~ (or ~/... ) to the current user's home directory. 3. Expand…

The task

The function must: 1. Accept a `str` or `os.PathLike` as input. 2. Expand a leading `~` (or `~/...`) to the current user's home directory. 3. Expand environment variable references in `$VAR` and `${VAR}` form using the current process environment. 4. Apply tilde expansion before environment-variable expansion so that…

Part of FineEnvs/repo2rlenv-r2e.