euporie.core.lexers.guess_lexer

euporie.core.lexers.guess_lexer(_text, **options)

Return a Lexer subclass instance that’s guessed from the text in text. For that, the analyse_text() method of every known lexer class is called with the text as argument, and the lexer which returned the highest value will be instantiated and returned.

pygments.util.ClassNotFound is raised if no lexer thinks it can handle the content.