def Tag(tag: str):
    """
    Decorator that adds the given tag to the decorated function.

    :param tag:     The tag to add to the function.
    """
    def apply_tag(method):
        if not hasattr(method, '__tags'):
            method.__tags = set()
        method.__tags.add(tag)
        return method

    return apply_tag