def evaluate_rule(rule_spec, answer_type, context_params, answer, fs):
    """Evaluates a rule spec. Returns a float between 0.0 and 1.0."""
    all_rule_classes = get_rules_for_obj_type(answer_type)
    rule = next(r for r in all_rule_classes
                if r.__name__ == rule_spec.rule_type)

    param_list = []
    param_defns = get_param_list(rule.description)
    for (param_name, obj_cls) in param_defns:
        parsed_param = rule_spec.inputs[param_name]
        if isinstance(parsed_param, basestring) and parsed_param in '{{':
            parsed_param = jinja_utils.parse_string(
                parsed_param, context_params, autoescape=False)
        normalized_param = obj_cls.normalize(parsed_param)
        param_list.append(normalized_param)

    constructed_rule = rule(*param_list)
    constructed_rule.set_fs(fs)
    return constructed_rule.eval(answer)
dataset/ETHPy150Open oppia/oppia/core/domain/rule_domain.py/evaluate_rule/swapped operands of `in`