code: def hermetic_environment_as(**kwargs):
    
    old_environment = os.environ.copy() if PY3 else _copy_and_decode_env(os.environ)
    _purge_env()
    try:
      with environment_as(**kwargs):
        yield
    finally:
      _purge_env()
      _restore_env(old_environment)
docs: Set the environment to the supplied values from an empty state.