code: def setup(**attr):
      cmdclass = numpy_cmdclass.copy()
  
      new_attr = attr.copy()
      if "cmdclass" in new_attr:
          cmdclass.update(new_attr["cmdclass"])
      new_attr["cmdclass"] = cmdclass
  
      if "configuration" in new_attr:
          # To avoid calling configuration if there are any errors
          # or help request in command in the line.
          configuration = new_attr.pop("configuration")
  
          old_dist = distutils.core._setup_distribution
          old_stop = distutils.core._setup_stop_after
          distutils.core._setup_distribution = None
          distutils.core._setup_stop_after = "commandline"
          try:
              dist = setup(**new_attr)
          finally:
              distutils.core._setup_distribution = old_dist
              distutils.core._setup_stop_after = old_stop
          if dist.help or not _command_line_ok():
              # probably displayed help, skip running any commands
              return dist
  
          # create setup dictionary and append to new_attr
          config = configuration()
          if hasattr(config, "todict"):
              config = config.todict()
          _dict_append(new_attr, **config)
  
      # Move extension source libraries to libraries
      libraries = []
      for ext in new_attr.get("ext_modules", []):
          new_libraries = []
          for item in ext.libraries:
              if is_sequence(item):
                  lib_name, build_info = item
                  _check_append_ext_library(
                      libraries, lib_name, build_info
                  )
                  new_libraries.append(lib_name)
              elif is_string(item):
                  new_libraries.append(item)
              else:
                  raise TypeError(
                      "invalid description of extension module "
                      "library %r" % (item,)
                  )
          ext.libraries = new_libraries
      if libraries:
          if "libraries" not in new_attr:
              new_attr["libraries"] = []
          for item in libraries:
              _check_append_library(new_attr["libraries"], item)
  
      # sources in ext_modules or libraries may contain header files
      if (
          "ext_modules" in new_attr or "libraries" in new_attr
      ) and "headers" not in new_attr:
          new_attr["headers"] = []
  
      # Use our custom NumpyDistribution class instead of distutils' one
      new_attr["distclass"] = NumpyDistribution
  
      return old_setup(**new_attr)
  
file_path: catboost/contrib/python/numpy/py2/numpy/distutils/core.py
imports: from __future__ import division, absolute_import, print_function
  import sys
  from distutils.core import *
  import warnings
  import distutils.core
  import distutils.dist
  from numpy.distutils.extension import Extension
  from numpy.distutils.numpy_distribution import NumpyDistribution
  from numpy.distutils.command import config, config_compiler, build, build_py, build_ext, build_clib, build_src, build_scripts, sdist, install_data, install_headers, install, bdist_rpm, install_clib
  from numpy.distutils.misc_util import get_data_files, is_sequence, is_string
label_desc: Use image node_id 4 for calling a global function with example usage: setup() and returns: old_setup, dist