(tag_set, selection)
return selection.with_server_descriptions(
        [s for s in selection.server_descriptions if tags_match(s.tags)])
All servers matching one tag set.

    A tag set is a dict. A server matches if its tags are a superset:
    A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.

    The empty tag set {} matches any server.
All servers matching one tag set.
All servers matching one tag set .
def apply_single_tag_set(tag_set, selection):
    """All servers matching one tag set.

    A tag set is a dict. A server matches if its tags are a superset:
    A server tagged {'a': '1', 'b': '2'} matches the tag set {'a': '1'}.

    The empty tag set {} matches any server.
    """
    def tags_match(server_tags):
        for key, value in tag_set.items():
            if key not in server_tags or server_tags[key] != value:
                return False

        return True

    return selection.with_server_descriptions(
        [s for s in selection.server_descriptions if tags_match(s.tags)])
def apply_single_tag_set ( tag_set , selection ) : def tags_match ( server_tags ) : for key , value in tag_set . items ( ) : if key not in server_tags or server_tags [ key ] != value : return False return True return selection . with_server_descriptions ( [ s for s in selection . server_descriptions if tags_match ( s . tags ) ] )