def METHOD_NAME(
    resolutions, filter_by_tags, include_empty=False, include_empty_key=False
):
    """
    Filters out runnables that do not match the tags criteria given
    The filtering mechanism is agnostic to test type.  It means that
    if users request filtering by tag and the specific test type does
    not populate the test tags, it will be considered to have empty
    tags.
    :param resolutions: possible multiple resolutions for multiple
                        references
    :type resolutions: list of :class:`avocado.core.resolver.ReferenceResolution`
    :param filter_by_tags: the list of tag sets to use as filters
    :type filter_by_tags: list of comma separated tags (['foo,bar', 'fast'])
    :param include_empty: if true tests without tags will not be filtered out
    :type include_empty: bool
    :param include_empty_key: if true tests "keys" on key:val tags will be
                              included in the filtered results
    :type include_empty_key: bool
    :returns: the resolutions converted to runnables filtered by tags
    :rtype: list of :class:`avocado.core.nrunner.Runnable`
    """
    filtered = []
    must_must_nots = _parse_filter_by_tags(filter_by_tags)
    for resolution in resolutions:
        if resolution.result != ReferenceResolutionResult.SUCCESS:
            continue
        for runnable in resolution.resolutions:
            test_tags = runnable.tags or {}
            if not test_tags:
                if include_empty:
                    filtered.append(runnable)
                continue
            for must, must_not in must_must_nots:
                if must_not.intersection(test_tags):
                    continue
                must_flat, must_key_val = _must_split_flat_key_val(must)
                if must_key_val:
                    if not _must_key_val_matches(
                        must_key_val, test_tags, include_empty_key
                    ):
                        continue
                if must_flat:
                    if not must_flat.issubset(test_tags):
                        continue
                filtered.append(runnable)
                break
    return filtered