code: def compiler_fixup(compiler_so, cc_args):
      """
      This function will strip '-isysroot PATH' and '-arch ARCH' from the
      compile flags if the user has specified one them in extra_compile_flags.
  
      This is needed because '-arch ARCH' adds another architecture to the
      build, without a way to remove an architecture. Furthermore GCC will
      barf if multiple '-isysroot' arguments are present.
      """
      stripArch = stripSysroot = False
  
      compiler_so = list(compiler_so)
  
      if not _supports_universal_builds():
          # OSX before 10.4.0, these don't support -arch and -isysroot at
          # all.
          stripArch = stripSysroot = True
      else:
          stripArch = "-arch" in cc_args
          stripSysroot = "-isysroot" in cc_args
  
      if stripArch or "ARCHFLAGS" in os.environ:
          while True:
              try:
                  index = compiler_so.index("-arch")
                  # Strip this argument and the next one:
                  del compiler_so[index : index + 2]
              except ValueError:
                  break
  
      if "ARCHFLAGS" in os.environ and not stripArch:
          # User specified different -arch flags in the environ,
          # see also distutils.sysconfig
          compiler_so = compiler_so + os.environ["ARCHFLAGS"].split()
  
      if stripSysroot:
          while True:
              try:
                  index = compiler_so.index("-isysroot")
                  # Strip this argument and the next one:
                  del compiler_so[index : index + 2]
              except ValueError:
                  break
  
      # Check if the SDK that is used during compilation actually exists,
      # the universal build requires the usage of a universal SDK and not all
      # users have that installed by default.
      sysroot = None
      if "-isysroot" in cc_args:
          idx = cc_args.index("-isysroot")
          sysroot = cc_args[idx + 1]
      elif "-isysroot" in compiler_so:
          idx = compiler_so.index("-isysroot")
          sysroot = compiler_so[idx + 1]
  
      if sysroot and not os.path.isdir(sysroot):
          from distutils import log
  
          log.warn(
              "Compiling with an SDK that doesn't seem to exist: %s",
              sysroot,
          )
          log.warn("Please check your Xcode installation")
  
      return compiler_so
  
file_path: catboost/contrib/tools/python/src/Lib/_osx_support.py
imports: import os
  import re
  import sys
label_desc: Use image node_id 13 for calling a global function with example usage: compiler_fixup(compiler_so, cc_args) and returns: compiler_so