

def _lang(codelet):
    '\n    Private function to identify the language of a codelet.\n\n    :param codelet: The codelet object to identified.\n\n    :type code: Codelet\n\n    .. todo::\n        Modify function to incorporate tags from stackoverflow.\n    '
    try:
        if codelet.filename:
            lex = pgl.guess_lexer_for_filename(codelet.filename, codelet.code)
        else:
            lex = pgl.guess_lexer(codelet.code)
        return LANGS_ALL[lex.name]
    except (util.ClassNotFound, KeyError):
        raise UnsupportedFileError(codelet.filename)

dataset/ETHPy150Open earwig/bitshift/bitshift/parser/__init__.py _lang/original