code: def PCExtension(*args, **kwargs):
      
      vals = {}
  
      intercept = {
          'build_callbacks': (),  # tuple of (callback, args, kwargs)
          'link_ext': True,
          'build_files': (),
          'dist_files': (),  # work around stackoverflow.com/questions/2994396/
          'template_regexps': [],
          'pass_extra_compile_args': False,  # use distutils extra_compile_args?
          'pycompilation_compile_kwargs': {},
          'pycompilation_link_kwargs': {},
      }
      for k, v in intercept.items():
          vals[k] = kwargs.pop(k, v)
  
      intercept2 = {
          'logger': None,
          'only_update': True,
      }
      for k, v in intercept2.items():
          vck = kwargs.pop(k, v)
          vck = vals['pycompilation_compile_kwargs'].pop(k, vck)
          vck = vck or vals['pycompilation_link_kwargs'].pop(k, vck)
          vals[k] = vck
  
      instance = Extension(*args, **kwargs)
  
      if vals['logger'] is True:
          # interpret as we should instantiate a logger
          import logging
          logging.basicConfig(level=logging.DEBUG)
          vals['logger'] = logging.getLogger('PCExtension')
  
      for k, v in vals.items():
          setattr(instance, k, v)
  
      return instance
docs: Parameters
      ==========
      template_regexps: list of 3-tuples
          e.g. [(pattern1, target1, subsd1), ...], used to generate
          templated code
      pass_extra_compile_args: bool
          should ext.extra_compile_args be passed along? default: False