def get_rules_for_obj_type(obj_type):
    """Gets all rules for a given object type.

    Args:
        obj_type: str. The name of the object type.
    """
    rule_dir = os.path.join(os.getcwd(), feconf.RULES_DIR)
    rule_class_name = '%sRule' % obj_type
    results = []

    for loader, name, _ in pkgutil.iter_modules(path=[rule_dir]):
        if name.endswith('_test'):
            continue
        module = loader.find_module(name).load_module(name)
        for name, clazz in inspect.getmembers(module, inspect.isclass):
            ancestors = clazz.__bases__
            ancestor_class_names = [c.__name__ for c in ancestors]
            if rule_class_name in ancestor_class_names:
                results.append(clazz)

    return results
dataset/ETHPy150Open oppia/oppia/core/domain/rule_domain.py/get_rules_for_obj_type/original