code: def get_compiler(compiler, **compiler_attrs):
      
      if compiler is None or isinstance(compiler, str):
          cc = ccompiler.new_compiler(compiler=compiler, verbose=0)
          customize_compiler(cc)
          if cc.compiler_type == 'mingw32':
              customize_mingw(cc)
      else:
          cc = compiler
          customize_gcc(cc)
  
      for name, val in compiler_attrs.items():
          setattr(cc, name, val)
  
      return cc
docs: get and customize a compiler