class_docstr: Extension that uses '.c' files in place of '.pyx' files
docstr: Replace sources with .pyx extensions to sources with the target
  language extension. This mechanism allows language authors to supply
  pre-converted sources but to prefer the .pyx sources.
docstr_tok: ["Replace","sources","with",".pyx","extensions","to","sources","with","the","target","language","extension",".","This","mechanism","allows","language","authors","to","supply","pre-converted","sources","but","to","prefer","the",".pyx","sources","."]
code: def _convert_pyx_sources_to_lang(self):
      """
      Replace sources with .pyx extensions to sources with the target
      language extension. This mechanism allows language authors to supply
      pre-converted sources but to prefer the .pyx sources.
      """
      if _have_cython():
          # the build has Cython, so allow it to compile the .pyx files
          return
      lang = self.language or ""
      target_ext = ".cpp" if lang.lower() == "c++" else ".c"
      sub = functools.partial(re.sub, ".pyx$", target_ext)
      self.sources = list(map(sub, self.sources))
  
file_path: catboost/contrib/python/setuptools/py2/setuptools/extension.py
imports: import re
  import functools
  import distutils.core
  import distutils.errors
  import distutils.extension
  from setuptools.extern.six.moves import map
  from .monkey import get_unpatched
label_desc: Use image node_id 2 for calling the Extension obj's underlying member method code with example usage: obj._convert_pyx_sources_to_lang() without return types