def detect_language (self, sources):
        """Detect the language of a given file, or list of files. Uses
        language_map, and language_order to do the job.
        """
        if type(sources) is not ListType:
            sources = [sources]
        lang = None
        index = len(self.language_order)
        for source in sources:
            base, ext = os.path.splitext(source)
            extlang = self.language_map.get(ext)
            try:
                extindex = self.language_order.index(extlang)
                if extindex < index:
                    lang = extlang
                    index = extindex
            except __HOLE__:
                pass
        return lang

    # detect_language ()

    # -- Worker methods ------------------------------------------------
    # (must be implemented by subclasses)
dataset/ETHPy150Open babble/babble/include/jython/Lib/distutils/ccompiler.py/CCompiler.detect_language