def METHOD_NAME(data_format, data_class):
    """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``
    """
    # this is a copy of astropy.io.regsitry.get_reader
    fetchers = [(fmt, cls) for fmt, cls in _FETCHERS if fmt == data_format]
    for fetch_fmt, fetch_cls in fetchers:
        if _is_best_match(data_class, fetch_cls, fetchers):
            return _FETCHERS[(fetch_fmt, fetch_cls)][0]
    else:
        formats = [fmt for fmt, cls in _FETCHERS if
                   _is_best_match(fmt, cls, fetchers)]
        formatstr = '\n'.join(sorted(formats))
        raise io_registry.IORegistryError(
            "No fetcher definer for format '{0}' and class '{1}'.\n"
            "The available formats are:\n{2}".format(
                data_format, data_class.__name__, formatstr),
        )