def _lang(codelet):
    """
    Private function to identify the language of a codelet.

    :param codelet: The codelet object to identified.

    :type code: Codelet

    .. todo::
        Modify function to incorporate tags from stackoverflow.
    """

    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, __HOLE__):
        raise UnsupportedFileError(codelet.filename)
dataset/ETHPy150Open earwig/bitshift/bitshift/parser/__init__.py/_lang