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 shlex
  import sys
  import tokenize
  import shutil
  import contextlib
  import tempfile
  import warnings
  from pathlib import Path
  from typing import Dict, Iterator, List, Optional, Union
  import setuptools
  import distutils
  from .None import errors
  from ._path import same_path
  from ._reqs import parse_strings
  from .warnings import SetuptoolsDeprecationWarning
  from distutils.util import strtobool
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