code: def finalize_options(self):
      self.set_undefined_options(
          "build",
          ("build_base", "build_base"),
          ("build_lib", "build_lib"),
          ("force", "force"),
      )
      if self.package is None:
          self.package = self.distribution.ext_package
      self.extensions = self.distribution.ext_modules
      self.libraries = self.distribution.libraries or []
      self.py_modules = self.distribution.py_modules or []
      self.data_files = self.distribution.data_files or []
  
      if self.build_src is None:
          plat_specifier = ".{}-{}.{}".format(
              get_platform(), *sys.version_info[:2]
          )
          self.build_src = os.path.join(
              self.build_base, "src" + plat_specifier
          )
  
      # py_modules_dict is used in build_py.find_package_modules
      self.py_modules_dict = {}
  
      if self.f2pyflags:
          if self.f2py_opts:
              log.warn(
                  "ignoring --f2pyflags as --f2py-opts already used"
              )
          else:
              self.f2py_opts = self.f2pyflags
          self.f2pyflags = None
      if self.f2py_opts is None:
          self.f2py_opts = []
      else:
          self.f2py_opts = shlex.split(self.f2py_opts)
  
      if self.swigflags:
          if self.swig_opts:
              log.warn(
                  "ignoring --swigflags as --swig-opts already used"
              )
          else:
              self.swig_opts = self.swigflags
          self.swigflags = None
  
      if self.swig_opts is None:
          self.swig_opts = []
      else:
          self.swig_opts = shlex.split(self.swig_opts)
  
      # use options from build_ext command
      build_ext = self.get_finalized_command("build_ext")
      if self.inplace is None:
          self.inplace = build_ext.inplace
      if self.swig_cpp is None:
          self.swig_cpp = build_ext.swig_cpp
      for c in ["swig", "swig_opt"]:
          o = "--" + c.replace("_", "-")
          v = getattr(build_ext, c, None)
          if v:
              if getattr(self, c):
                  log.warn(
                      "both build_src and build_ext define %s option"
                      % (o)
                  )
              else:
                  log.info(
                      'using "%s=%s" option from build_ext command'
                      % (o, v)
                  )
                  setattr(self, c, v)
  
imports: import os
  import re
  import sys
  import shlex
  import copy
  from distutils.command import build_ext
  from distutils.dep_util import newer_group, newer
  from distutils.util import get_platform
  from distutils.errors import DistutilsError, DistutilsSetupError
  from numpy.distutils import log
  from numpy.distutils.misc_util import fortran_ext_match, appendpath, is_string, is_sequence, get_cmd
  from numpy.distutils.from_template import process_file
  from numpy.distutils.conv_template import process_file
label_desc: Use image node_id 2 for calling the build_src obj's underlying member method code with example usage: obj.finalize_options() without return types