def get_all_subclasses(cls):
    """Return all subclasses of a given class.
    Can return duplicates due to multiple inheritance."""
    for subclass in cls.__subclasses__():
        yield from get_all_subclasses(subclass)
        yield subclass
Return all subclasses of a given class.
    Can return duplicates due to multiple inheritance.
src/datachain/utils.py