code: def patch(self, **kw):
      
      old_environ = self._environ
      self._environ = self._environ.copy()
      self._environ.update(kw)
      yield
      self._environ = old_environ
docs: Update the environment for the duration of a context.