from typing import Any
from typing import Set
from typing import Type


def _all_subclasses(cls: Any) -> Set[Type]:
    """
    Obtains the set of recursively all children of a class.
    """
    children: Set[Type] = set()
    to_examine = [cls]
    while len(to_examine) > 0:
        this_class = to_examine.pop()
        for child in this_class.__subclasses__():
            if child not in children:
                to_examine.append(child)
                children.add(child)
    return children