'Recursively get all subclasses to a class.
Args:
cls (classoject): A class to get subclasses from.'

def _get_subclasses(self, cls):

    all_subclasses = cls.__subclasses__()
    for subclass in all_subclasses:
        all_subclasses.extend(self._get_subclasses(subclass))
    return all_subclasses
