def get_obj_type_for_param_name(rule_class, param_name):
    """Gets the obj type for a given param name."""
    param_list = get_param_list(rule_class.description)
    for item in param_list:
        if item[0] == param_name:
            return item[1]
    raise Exception(
        'Rule %s has no param called %s' % (rule_class.__name__, param_name))
dataset/ETHPy150Open oppia/oppia/core/domain/rule_domain.py/get_obj_type_for_param_name/original