code: def compile_link_import_py_ext(
          srcs, extname=None, build_dir=None, compile_kwargs=None,
          link_kwargs=None, **kwargs):
      
  
      build_dir = build_dir or '.'
      if extname is None:
          extname = os.path.splitext(os.path.basename(srcs[-1]))[0]
  
      compile_kwargs = compile_kwargs or {}
      compile_kwargs.update(kwargs)
  
      link_kwargs = link_kwargs or {}
      link_kwargs.update(kwargs)
  
      try:
          mod = import_module_from_file(os.path.join(build_dir, extname), srcs)
      except ImportError:
          objs = compile_sources(list(map(get_abspath, srcs)), destdir=build_dir,
                                 cwd=build_dir, **compile_kwargs)
          so = link_py_so(
              objs, cwd=build_dir, fort=any_fort(srcs), cplus=any_cplus(srcs),
              **link_kwargs)
          mod = import_module_from_file(so)
      return mod
docs: Compiles sources in `srcs` to a shared object (python extension)
      which is imported. If shared object is newer than the sources, they
      are not recompiled but instead it is imported.
  
      Parameters
      ----------
      srcs: string
          list of paths to sources
      extname: string
          name of extension (default: None)
          (taken from the last file in `srcs` - without extension)
      build_dir: string
          path to directory in which objects files etc. are generated
      compile_kwargs: dict
          keyword arguments passed to compile_sources
      link_kwargs: dict
          keyword arguments passed to link_py_so
      **kwargs:
          additional keyword arguments overwrites to both compile_kwargs
          and link_kwargs useful for convenience e.g. when passing logger
  
      Returns
      -------
      the imported module
  
      Examples
      --------
      >>> mod = compile_link_import_py_ext(['fft.f90', 'convolution.cpp',\
          'fft_wrapper.pyx'], only_update=True)  # doctest: +SKIP
      >>> Aprim = mod.fft(A)  # doctest: +SKIP