code: def get_formatter_for_filename(fn, **options):
      """
      Return a :class:`.Formatter` subclass instance that has a filename pattern
      matching `fn`. The formatter is given the `options` at its instantiation.
  
      Will raise :exc:`pygments.util.ClassNotFound` if no formatter for that filename
      is found.
      """
      fn = basename(fn)
      for modname, name, _, filenames, _ in FORMATTERS.values():
          for filename in filenames:
              if _fn_matches(fn, filename):
                  if name not in _formatter_cache:
                      _load_formatters(modname)
                  return _formatter_cache[name](**options)
      for _name, cls in find_plugin_formatters():
          for filename in cls.filenames:
              if _fn_matches(fn, filename):
                  return cls(**options)
      raise ClassNotFound("no formatter found for file name %r" % fn)
  
file_path: catboost/contrib/python/Pygments/py3/pygments/formatters/__init__.py
imports: import re
  import sys
  import types
  import fnmatch
  from os.path import basename
  from pygments.formatters._mapping import FORMATTERS
  from pygments.plugin import find_plugin_formatters
  from pygments.util import ClassNotFound
label_desc: Use image node_id 7 for calling a global function with example usage: get_formatter_for_filename(fn) and returns: _formatter_cache, cls