def get_fetcher(data_format, data_class):
<EOL>fetchers = [(fmt, cls) for fmt, cls in _FETCHERS if fmt == data_format]<EOL>for fetch_fmt, fetch_cls in fetchers:<EOL><INDENT>if io_registry._is_best_match(data_class, fetch_cls, fetchers):<EOL><INDENT>return _FETCHERS[(fetch_fmt, fetch_cls)][<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>formats = [fmt for fmt, cls in _FETCHERS if<EOL>io_registry._is_best_match(fmt, cls, fetchers)]<EOL>formatstr = '<STR_LIT:\n>'.join(sorted(formats))<EOL>raise IORegistryError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>".format(<EOL>data_format, data_class.__name__, formatstr))<EOL><DEDENT>
Return the :meth:`~EventTable.fetch` function for the given format

    Parameters
    ----------
    data_format : `str`
        name of the format

    data_class : `type`
        the class that the fetcher returns

    Raises
    ------
    astropy.io.registry.IORegistryError
        if not registration is found matching ``data_format``