(filename)
Determines the formatter for a given filename.

    Args:
        filename: The filename.

    Returns:
        A BaseFormatter subclass.

    Raises:
        UnrecognizedFileType
Determines the formatter for a given filename.
Determines the formatter for a given filename .
def formatter_for_filename(filename):
    """Determines the formatter for a given filename.

    Args:
        filename: The filename.

    Returns:
        A BaseFormatter subclass.

    Raises:
        UnrecognizedFileType
    """
    for fmt in FORMATTERS:
        if filename.endswith(fmt.extension):
            return fmt.cls
    raise UnrecognizedFileType(filename)
def formatter_for_filename ( filename ) : for fmt in FORMATTERS : if filename . endswith ( fmt . extension ) : return fmt . cls raise UnrecognizedFileType ( filename )