docstr: Replace
  distutils.dist.Distribution with this class
  for the duration of this context.
docstr_tok: ["Replace","distutils.dist.Distribution","with","this","class","for","the","duration","of","this","context","."]
code: def patch(cls):
      """
      Replace
      distutils.dist.Distribution with this class
      for the duration of this context.
      """
      orig = distutils.core.Distribution
      distutils.core.Distribution = cls
      try:
          yield
      finally:
          distutils.core.Distribution = orig
  
imports: import io
  import os
  import sys
  import tokenize
  import shutil
  import contextlib
  import setuptools
  import distutils
  from setuptools.py31compat import TemporaryDirectory
  from pkg_resources import parse_requirements
  from pkg_resources.py31compat import makedirs
label_desc: Use image node_id 2 for calling the Distribution obj's underlying member method code with example usage: obj.patch(cls) without return types