human
Complete the below
def get_lexer_for_filename(_fn, code=None, **options):

    ''''Get a lexer for a filename.  If multiple lexers match the filename
    pattern, use ``analyze_text()`` to figure out which one is more
    appropriate.'
    '''
 Can you provide a the Python program you requested?
assistant
#Here is the Python program you requested.
    matches = []
    fn = basename(_fn)
    for (modname, name, _, filenames, _) in LEXERS.itervalues():
        for filename in filenames:
            if fnmatch.fnmatch(fn, filename):
                if (name not in _lexer_cache):
                    _load_lexers(modname)
                matches.append(_lexer_cache[name])
    for cls in find_plugin_lexers():
        for filename in cls.filenames:
            if fnmatch.fnmatch(fn, filename):
                matches.append(cls)
    if ((sys.version_info > (3,)) and isinstance(code, bytes)):
        code = code.decode('latin1')
    def get_rating(cls):
        d = cls.analyse_text(code)
        return d
    if code:
        matches.sort(key=get_rating)
    if matches:
        return matches[(-1)](**options)
    raise ClassNotFound(('no    lexer    for    filename    %r    found' % _fn))