def METHOD_NAME(self, attributes, attribute_filters, context, target_provider):
    for attribute_name, attribute_filters in attribute_filters.items():
        if type(attribute_filters) == str:
            # convert simple notation to filter list
            attribute_filters = {'regexp': attribute_filters}
        for filter_type, filter_value in attribute_filters.items():
            if filter_type == "regexp":
                filter_func = re.compile(filter_value).search
            elif filter_type == "shibmdscope_match_scope":
                mdstore = context.get_decoration(Context.KEY_METADATA_STORE)
                md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor")) if mdstore else []
                filter_func = lambda v: self._shibmdscope_match_scope(v, md_scopes)
            elif filter_type == "shibmdscope_match_value":
                mdstore = context.get_decoration(Context.KEY_METADATA_STORE)
                md_scopes = list(mdstore.shibmd_scopes(target_provider,"idpsso_descriptor")) if mdstore else []
                filter_func = lambda v: self._shibmdscope_match_value(v, md_scopes)
            else:
                raise SATOSAError("Unknown filter type")
            if attribute_name == "":  # default filter for all attributes
                for attribute, values in attributes.items():
                    attributes[attribute] = list(filter(filter_func, attributes[attribute]))
            elif attribute_name in attributes:
                attributes[attribute_name] = list(filter(filter_func, attributes[attribute_name]))