

def expand(self, expr):
    'Expands any environment variables and home shortcuts found in ``expr``\n        (like ``os.path.expanduser`` combined with ``os.path.expandvars``)\n\n        :param expr: An expression containing environment variables (as ``$FOO``) or\n                     home shortcuts (as ``~/.bashrc``)\n\n        :returns: The expanded string'
    prev = os.environ
    os.environ = self.getdict()
    try:
        output = os.path.expanduser(os.path.expandvars(expr))
    finally:
        os.environ = expr
    return output

dataset/ETHPy150Open tomerfiliba/plumbum/plumbum/machines/local.py LocalEnv.expand/VarMisuse@61/179 `prev`->`expr`