def METHOD_NAME(**kwargs):
    """
    Query |reclass| for the top data (states of the minions).
    """
    # If reclass is installed, __virtual__ put it onto the search path, so we
    # don't need to protect against ImportError:
    # pylint: disable=3rd-party-module-not-gated,no-name-in-module
    from reclass.adapters.salt import METHOD_NAME as reclass_top
    from reclass.errors import ReclassException
    # pylint: enable=3rd-party-module-not-gated,no-name-in-module
    try:
        # Salt's top interface is inconsistent with ext_pillar (see #5786) and
        # one is expected to extract the arguments to the master_tops plugin
        # by parsing the configuration file data. I therefore use this adapter
        # to hide this internality.
        reclass_opts = __opts__["master_tops"]["reclass"]
        # the source path we used above isn't something reclass needs to care
        # about, so filter it:
        filter_out_source_path_option(reclass_opts)
        # if no inventory_base_uri was specified, initialise it to the first
        # file_roots of class 'base' (if that exists):
        set_inventory_base_uri_default(__opts__, kwargs)
        # Salt expects the top data to be filtered by minion_id, so we better
        # let it know which minion it is dealing with. Unfortunately, we must
        # extract these data (see #6930):
        minion_id = kwargs["opts"]["id"]
        # I purposely do not pass any of __opts__ or __salt__ or __grains__
        # to reclass, as I consider those to be Salt-internal and reclass
        # should not make any assumptions about it. Reclass only needs to know
        # how it's configured, so:
        return reclass_top(minion_id, **reclass_opts)
    except ImportError as e:
        if "reclass" in str(e):
            raise SaltInvocationError(
                "master_tops.reclass: cannot find reclass module in {}".format(sys.path)
            )
        else:
            raise
    except TypeError as e:
        if "unexpected keyword argument" in str(e):
            arg = str(e).split()[-1]
            raise SaltInvocationError(
                "master_tops.reclass: unexpected option: {}".format(arg)
            )
        else:
            raise
    except KeyError as e:
        if "reclass" in str(e):
            raise SaltInvocationError(
                "master_tops.reclass: no configuration found in master config"
            )
        else:
            raise
    except ReclassException as e:
        raise SaltInvocationError("master_tops.reclass: {}".format(str(e)))