from typing import get_origin
from typing import Set


def is_set(typ) -> bool:
    """
    Test if the type is `typing.Set`.

    >>> from typing import Set
    >>> is_set(Set[int])
    True
    >>> is_set(Set)
    True
    """
    try:
        return issubclass(get_origin(typ), set)
    except TypeError:
        return typ in (Set, set)