code: def change_env(name, val):
      
      oldval = os.environ.get(name, None)
      os.environ[name] = val
      yield
      if oldval is None:
          del os.environ[name]
      else:
          os.environ[name] = oldval
docs: Args:
          name(str), val(str):
  
      Returns:
          a context where the environment variable ``name`` being set to
          ``val``. It will be set back after the context exits.