code: def monkeypatch():
      """The returned ``monkeypatch`` fixture provides these
      helper methods to modify objects, dictionaries or os.environ::
  
          monkeypatch.setattr(obj, name, value, raising=True)
          monkeypatch.delattr(obj, name, raising=True)
          monkeypatch.setitem(mapping, name, value)
          monkeypatch.delitem(obj, name, raising=True)
          monkeypatch.setenv(name, value, prepend=False)
          monkeypatch.delenv(name, raising=True)
          monkeypatch.syspath_prepend(path)
          monkeypatch.chdir(path)
  
      All modifications will be undone after the requesting
      test function or fixture has finished. The ``raising``
      parameter determines if a KeyError or AttributeError
      will be raised if the set/deletion operation has no target.
      """
      mpatch = MonkeyPatch()
      yield mpatch
      mpatch.undo()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import sys
  import warnings
  from contextlib import contextmanager
  import six
  import pytest
  from _pytest.fixtures import fixture
  from _pytest.pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: monkeypatch() without return types