Module Expr Str Import alias Import alias Import alias ImportFrom alias Import alias Import alias Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr For NameStore NameLoad body If CompareEq SubscriptLoad NameLoad Index Num NameLoad body Return SubscriptLoad NameLoad Index Num Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args defaults body Expr Str Return Dict Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str Str ListLoad Num Num Dict Str Str Str Str Str ListLoad NameLoad NameLoad NameLoad ListLoad Str Num ListLoad ListLoad Str ListLoad Num Str Num ListLoad ListLoad ListLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpMod Str NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr keyword ListLoad NameLoad body If Call AttributeLoad NameLoad attr Str body Continue Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr Assign NameStore ListComp AttributeLoad NameLoad attr comprehension NameStore NameLoad If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Return DictComp AttributeLoad NameLoad attr AttributeLoad NameLoad attr comprehension NameStore NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad While CompareNotEq Call AttributeLoad NameLoad attr Str Num body Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore SubscriptLoad NameLoad Slice NameLoad Assign NameStore SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Call NameLoad NameLoad NameLoad Return NameLoad decorator_list Assign NameStore Num Assign NameStore Num ClassDef bases NameLoad body Expr Str Assign NameStore NameLoad Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam defaults vararg body If CompareNotEq Call NameLoad NameLoad Call NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body Expr Call NameLoad NameLoad SubscriptLoad NameLoad Index Num Call AttributeLoad SubscriptLoad NameLoad Index Num attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return IfExp Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpSub NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad GeneratorExp NameLoad comprehension NameStore NameLoad CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListLoad Assign NameStore Call NameLoad AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If BoolOpAnd Call NameLoad NameLoad NameLoad CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list
N/A N/A Classes relating to rules. N/A inspect N/A os N/A pkgutil extensions.objects.models objects N/A feconf N/A jinja_utils N/A FUZZY_RULE_TYPE FuzzyMatches get_obj_type_for_param_name N/A N/A rule_class param_name N/A N/A N/A Gets the obj type for a given param name. N/A param_list N/A get_param_list N/A rule_class description N/A item param_list N/A N/A N/A N/A item N/A 0 param_name N/A N/A N/A item N/A 1 N/A N/A Exception N/A Rule %s has no param called %s N/A N/A rule_class __name__ param_name N/A get_default_object_values N/A N/A N/A N/A N/A Returns a dict mapping object types to their default values, taking into
    account only object types which represent rule input parameters.

    Note: we return an explicit dict here in order to avoid unnecessary
    computation, since this dict never changes between a release and is served
    each time the editor page loads. We have backend tests that compare the
    value returned here to an explicitly-computed value -- see

          rule_domain_test.test_get_default_object_values().
     N/A N/A CodeString CoordTwoDim Graph GraphProperty Int ListOfCoordTwoDim ListOfGraph LogicErrorCategory MusicPhrase NonnegativeInt NormalizedString Real SetOfHtmlString SetOfNormalizedString SetOfUnicodeString UnicodeString N/A 0.0 0.0 N/A edges isDirected isLabeled isWeighted vertices N/A False False False N/A strongly_connected 0 N/A N/A mistake N/A 0 0.0 N/A N/A N/A N/A get_rules_for_obj_type N/A N/A obj_type N/A N/A N/A Gets all rules for a given object type.

    Args:
        obj_type: str. The name of the object type.
     N/A rule_dir N/A N/A N/A os path join N/A N/A os getcwd N/A feconf RULES_DIR N/A rule_class_name N/A %sRule obj_type N/A results N/A N/A N/A loader name _ N/A N/A pkgutil iter_modules path N/A rule_dir N/A N/A N/A N/A name endswith _test N/A N/A N/A module N/A N/A N/A N/A loader find_module name load_module name N/A N/A name clazz N/A N/A inspect getmembers module N/A inspect isclass N/A N/A ancestors N/A clazz __bases__ N/A ancestor_class_names N/A N/A c __name__ N/A c ancestors N/A N/A rule_class_name ancestor_class_names N/A N/A N/A N/A results append clazz N/A results N/A get_description_strings_for_obj_type N/A N/A obj_type N/A N/A N/A Returns a dict whose keys are rule names and whose values are the
    corresponding description strings.
     N/A rules N/A get_rules_for_obj_type obj_type N/A N/A N/A rule __name__ N/A rule description N/A rule rules N/A get_param_list N/A N/A description N/A N/A N/A Get a parameter list from the rule description. N/A param_list N/A N/A N/A N/A N/A description find {{ -1 N/A N/A opening_index N/A N/A description find {{ N/A description N/A description N/A N/A opening_index 2 N/A bar_index N/A N/A description find | N/A param_name N/A description N/A bar_index N/A description N/A description N/A N/A bar_index 1 N/A closing_index N/A N/A description find }} N/A normalizer_string N/A description N/A closing_index N/A description N/A description N/A N/A closing_index 2 N/A N/A N/A param_list append N/A param_name N/A getattr objects normalizer_string N/A param_list N/A N/A CERTAIN_TRUE_VALUE 1.0 N/A CERTAIN_FALSE_VALUE 0.0 Rule N/A object N/A N/A Abstract base class for a value object that represents a rule.

    All rules assume that the subject and rule initialization parameters
    are JSONifiable objects (such as primitives, lists, dicts, and
    compositions of these, but NOT sets, tuples, etc.). This is enforced
    by normalizing the subject and rule initialization parameters to
    JSONifiable objects before any evaluations are performed.
     N/A subject_type None N/A description N/A _params None N/A _fs None params N/A N/A self N/A N/A N/A N/A N/A self _params None N/A N/A N/A self _params N/A get_param_list N/A self description N/A N/A self _params N/A property __init__ N/A N/A self N/A args N/A N/A N/A N/A len args N/A len N/A self params N/A N/A N/A ValueError N/A Expected parameters %s, received %s N/A N/A self params args N/A N/A ind param_tuple N/A enumerate N/A self params N/A N/A N/A setattr self N/A param_tuple N/A 0 N/A N/A N/A param_tuple N/A 1 normalize N/A args N/A ind N/A N/A N/A self _validate_params N/A _validate_params N/A N/A self N/A N/A N/A Validates the rule object immediately after initialization. N/A N/A _evaluate N/A N/A self subject N/A N/A N/A Returns a normalized value between 0 and 1 indicating the truth value
        of the evaluation, where 1.0 is certainly true and 0.0 is certainly
        false. This is to be implemented in overridden classes, or implemented
        in the frontend.
         N/A NotImplementedError N/A _fuzzify_truth_value N/A N/A self bool_value N/A N/A N/A Returns a fuzzy truth value for a crisp true or false value. A crisp
        value of true is represented by the fuzzy value of 1.0 and a crisp
        value of false is represented by 0.0.
         N/A N/A N/A bool bool_value CERTAIN_TRUE_VALUE CERTAIN_FALSE_VALUE N/A _invert_fuzzy_truth_value N/A N/A self fuzzy_value N/A N/A N/A Performs a NOT operation on a fuzzy value. N/A N/A CERTAIN_TRUE_VALUE fuzzy_value N/A set_fs N/A N/A self fs N/A N/A N/A Set an abstract file system to use with this rule. N/A N/A self _fs fs N/A self N/A fs N/A N/A self N/A N/A N/A N/A self _fs N/A property eval N/A N/A self subject N/A N/A N/A Public evaluation method.

        Args:
            subject: the thing to be evaluated.

        Returns:
            float: the result of the evaluation (between 0.0 and 1.0).
         N/A N/A N/A self _evaluate N/A N/A N/A self subject_type normalize subject N/A N/A evaluate_rule N/A N/A rule_spec answer_type context_params answer fs N/A N/A N/A Evaluates a rule spec. Returns a float between 0.0 and 1.0. N/A all_rule_classes N/A get_rules_for_obj_type answer_type N/A rule N/A next N/A r N/A r all_rule_classes N/A N/A r __name__ N/A rule_spec rule_type N/A param_list N/A N/A param_defns N/A get_param_list N/A rule description N/A N/A param_name obj_cls param_defns N/A N/A parsed_param N/A N/A rule_spec inputs N/A param_name N/A N/A N/A isinstance parsed_param basestring N/A {{ parsed_param N/A N/A parsed_param N/A N/A jinja_utils parse_string parsed_param context_params autoescape False N/A normalized_param N/A N/A obj_cls normalize parsed_param N/A N/A N/A param_list append normalized_param N/A constructed_rule N/A rule param_list N/A N/A N/A constructed_rule set_fs fs N/A N/A N/A constructed_rule eval answer N/A