def get_subclasses(modulepath, parent_class):
if isinstance(modulepath, ModuleType):<EOL><INDENT>modules = get_modules(modulepath.__name__)<EOL><DEDENT>else:<EOL><INDENT>modules = get_modules(modulepath)<EOL><DEDENT>ret = set()<EOL>for m in modules:<EOL><INDENT>cs = inspect.getmembers(m, lambda v: inspect.isclass(v) and issubclass(v, parent_class))<EOL>for class_name, klass in cs:<EOL><INDENT>ret.add(klass)<EOL><DEDENT><DEDENT>return ret<EOL>
given a module return all the parent_class subclasses that are found in
    that module and any submodules.

    :param modulepath: string, a path like foo.bar.che
    :param parent_class: object, the class whose children you are looking for
    :returns: set, all the found child classes in modulepath of parent_class