Module ImportFrom alias alias alias Import alias Import alias Import alias ImportFrom alias Import alias Import alias identifier ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias alias ClassDef bases NameLoad body Assign NameStore Set Str Str Assign NameStore Dict Str Str Str Str Num NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Expr Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Pass decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str NameLoad Assign NameStore Dict Str NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assert BoolOpOr CompareEq NameLoad Str CompareEq NameLoad Str Assign AttributeStore NameLoad attr IfExp CompareEq NameLoad Str AttributeLoad NameLoad attr UnaryOpUSub AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body TryExcept body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad NameLoad Index Num If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore CompareLt NameLoad AttributeLoad NameLoad attr orelse Assign NameStore CompareGt NameLoad AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr IfExp CompareEq AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return IfExp CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameStore body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If Call NameLoad NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad keyword Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign NameStore SubscriptStore NameLoad Index Str Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptStore NameLoad Index NameLoad Call NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign NameStore SubscriptStore NameLoad Index Str Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore SubscriptStore NameLoad Index NameLoad Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad Assign NameStore SubscriptStore NameLoad Index Str Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptStore NameLoad Index NameLoad Call NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign NameStore SubscriptStore NameLoad Index Str Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore SubscriptStore NameLoad Index NameLoad Call NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str Call AttributeLoad NameLoad attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareIn AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index NameLoad Call NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad NameLoad attr If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpPow NameLoad Num keyword Num attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpPow NameLoad Num keyword Num attr Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index Str Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpPow NameLoad Num keyword Num attr Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareNotIn AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Return Call NameLoad NameLoad AttributeLoad NameLoad attr keyword TupleLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareNotIn AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Return Call NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str Num FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Num Str NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body TryExcept body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Return Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore IfExp CompareEq AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareGt Call NameLoad NameLoad BinOpAdd NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareGtE NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If CompareNotIn NameLoad ListLoad Str Str body Raise Call NameLoad Call AttributeLoad Str attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr Assign NameStore NameLoad If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str CompareGtE Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad orelse If BoolOpAnd CompareEq AttributeLoad NameLoad attr Str CompareLtE Call NameLoad NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults TupleLoad NameLoad NameLoad NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr IfExp Call NameLoad NameLoad NameLoad ListLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad Raise Call NameLoad If AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str If CompareIn Str NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str orelse Assign NameStore SubscriptLoad NameLoad Index Str If UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Str Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad keyword NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If AttributeLoad NameLoad attr body Raise Call NameLoad Str decorator_list decorator_list If UnaryOpNot AttributeLoad NameLoad attr body Assign NameStore AttributeLoad NameLoad attr orelse Import alias identifier Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr ListLoad NameLoad orelse If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad orelse Raise Call NameLoad Call AttributeLoad Str attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr ListLoad Str Str Str Str Str Str Str Expr Call AttributeLoad NameLoad attr Str TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise Call NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr keyword Str keyword AttributeLoad NameLoad attr keyword Num keyword TupleLoad Num Num keyword TupleLoad Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore Num For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad ListLoad keyword NameLoad keyword Num keyword SubscriptLoad AttributeLoad NameLoad attr Index BinOpMod NameLoad Call NameLoad AttributeLoad NameLoad attr keyword NameLoad AugAssignAdd NameStore Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword AttributeLoad NameLoad attr keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body If CompareEq NameLoad Num body Return For NameStore AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad keyword NameLoad Assign NameStore AttributeLoad SubscriptLoad NameLoad Index Num attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call NameLoad NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call NameLoad Call NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr keyword BinOpAdd AttributeLoad NameLoad attr Str decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad Str Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Assert CompareIn Str NameLoad Assign AttributeStore NameLoad attr AttributeLoad SubscriptLoad NameLoad Index Str attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assert BoolOpOr CompareEq NameLoad Num CompareEq Call AttributeLoad NameLoad attr BinOpDiv NameLoad AttributeLoad NameLoad attr NameLoad If CompareEq BinOpMod NameLoad AttributeLoad NameLoad attr Num body Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Expr Call NameLoad Call NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareEq BinOpMod NameLoad AttributeLoad NameLoad attr Num body If AttributeLoad NameLoad attr body Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr orelse Expr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr BinOpMod NameLoad AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad Str Num body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad Assign SubscriptStore NameLoad Index Str NameLoad If CompareNotIn Str NameLoad body Assign SubscriptStore NameLoad Index Str AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults Str Str Num NameLoad NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assert Call NameLoad NameLoad AttributeLoad NameLoad attr Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list decorator_list
N/A __future__ division print_function unicode_literals N/A math N/A signal N/A sys collections OrderedDict N/A h5py N/A numpy np six string_types brainstorm.describable Describable brainstorm optional brainstorm.structure.network Network brainstorm.tools evaluate brainstorm.utils get_by_path progress_bar get_brainstorm_info Hook N/A Describable N/A N/A __undescribed__ N/A __name__ run_verbosity N/A __default_values__ N/A timescale interval verbose epoch 1 None __init__ N/A N/A self name timescale interval verbose N/A None epoch 1 None N/A N/A N/A self timescale timescale N/A N/A self interval interval N/A N/A self __name__ N/A name N/A N/A self __class__ __name__ N/A N/A self priority 0 N/A N/A self verbose verbose N/A N/A self run_verbosity None N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A self verbose None N/A N/A N/A self run_verbosity verbose N/A N/A N/A self run_verbosity N/A self verbose N/A message N/A N/A self msg N/A N/A N/A Print an output message if :attr:`run_verbosity` is True. N/A N/A self run_verbosity N/A N/A N/A print N/A N/A {} >> {} format N/A self __name__ msg N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A N/A SaveBestNetwork N/A Hook N/A N/A 
    Check to see if the specified log entry is at it's best value and if so,
    save the network to a specified file.

    Can save the network when the log entry is at its minimum (such as an
    error) or maximum (such as accuracy) according to the ``criterion``
    argument.

    The ``timescale`` and ``interval`` should be the same as those for the
    monitoring hook which logs the quantity of interest.

    Args:
        log_name:
            Name of the log entry to be checked for improvement.
            It should be in the form <monitorname>.<log_name> where log_name
            itself may be a nested dictionary key in dotted notation.
        filename:
            Name of the HDF5 file to which the network should be saved.
        criterion:
            Indicates whether training should be stopped when the log entry is
            at its minimum or maximum value. Must be either 'min' or 'max'.
            Defaults to 'min'.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'SaveBestNetwork'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
    Examples:
        Add a hook to monitor a quantity of interest:

        >>> scorer = bs.scorers.Accuracy()
        >>> trainer.add_hook(bs.hooks.MonitorScores('valid_getter', [scorer],
        ...                                         name='validation'))

        Check every epoch and save the network if validation accuracy rises:

        >>> trainer.add_hook(bs.hooks.SaveBestNetwork('validation.Accuracy',
        ...                                           filename='best_acc.h5',
        ...                                           criterion='max'))

        Check every epoch and save the network if validation loss drops:

        >>> trainer.add_hook(bs.hooks.SaveBestNetwork('validation.total_loss',
            ...                                       filename='best_loss.h5',
        ...                                           criterion='min'))
     N/A __undescribed__ N/A parameters None N/A __default_values__ N/A filename None __init__ N/A N/A self log_name filename criterion name timescale interval verbose N/A None max None epoch 1 None N/A N/A N/A N/A N/A super SaveBestNetwork self __init__ name timescale interval verbose N/A N/A self log_name log_name N/A N/A self filename filename N/A N/A self parameters None N/A N/A N/A criterion min N/A criterion max N/A N/A self best_so_far N/A N/A criterion min N/A np inf N/A N/A np inf N/A N/A self best_t None N/A N/A self criterion criterion N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A epoch_nr 0 N/A N/A N/A N/A e N/A get_by_path logs N/A self log_name N/A N/A N/A KeyError N/A N/A N/A e N/A get_by_path logs N/A self log_name N/A last N/A e N/A -1 N/A N/A N/A self criterion min N/A N/A imp N/A last N/A self best_so_far N/A N/A imp N/A last N/A self best_so_far N/A imp N/A N/A N/A self best_so_far last N/A N/A self best_t N/A N/A N/A self timescale epoch epoch_nr update_nr N/A params N/A N/A net get parameters N/A N/A N/A self filename None N/A N/A N/A N/A self message N/A N/A {} improved (criterion: {}). Saving network to {} format N/A self log_name N/A self criterion N/A self filename N/A N/A N/A net save_as_hdf5 N/A self filename N/A N/A N/A N/A self message N/A N/A {} improved (criterion: {}). Caching parameters format N/A self log_name N/A self criterion N/A N/A self parameters params N/A N/A N/A N/A self message N/A N/A Last saved parameters at {} {} when {} was {} format N/A self timescale N/A self best_t N/A self log_name N/A self best_so_far N/A load_parameters N/A N/A self N/A N/A N/A N/A N/A N/A self filename None N/A N/A np load N/A self filename N/A self parameters N/A N/A SaveLogs N/A Hook N/A N/A 
    Periodically Save the trainer logs dictionary to an HDF5 file.
    Default behavior is to save every epoch.
     __init__ N/A N/A self filename name timescale interval N/A None epoch 1 N/A N/A N/A N/A N/A super SaveLogs self __init__ name timescale interval N/A N/A self filename filename N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A N/A h5py File N/A self filename w f N/A N/A N/A N/A N/A f attrs create info N/A get_brainstorm_info N/A N/A N/A N/A f attrs create format Logs file v1.0 N/A N/A N/A SaveLogs _save_recursively f logs N/A _save_recursively N/A N/A group logs N/A N/A N/A N/A name log N/A N/A logs items N/A N/A N/A isinstance log dict N/A N/A subgroup N/A N/A group create_group name N/A N/A N/A SaveLogs _save_recursively subgroup log N/A N/A N/A N/A group create_dataset name data N/A N/A np array log N/A staticmethod N/A SaveNetwork N/A Hook N/A N/A 
    Periodically save the weights of the network to the given file.
    Default behavior is to save the network after every training epoch.
     __init__ N/A N/A self filename name timescale interval N/A None epoch 1 N/A N/A N/A N/A N/A super SaveNetwork self __init__ name timescale interval N/A N/A self filename filename N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A N/A net save_as_hdf5 N/A self filename N/A load_network N/A N/A self N/A N/A N/A N/A N/A Network from_hdf5 N/A self filename N/A N/A MonitorLayerDeltas N/A Hook N/A N/A 
    Monitor some statistics about all the deltas of a layer.
     __init__ N/A N/A self layer_name name timescale interval verbose N/A None epoch 1 None N/A N/A N/A name None N/A N/A name N/A N/A MonitorDeltas_{} format layer_name N/A N/A N/A N/A super MonitorLayerDeltas self __init__ name timescale interval verbose N/A N/A self layer_name layer_name N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A self layer_name N/A N/A N/A net layers keys N/A N/A {} >> No layer named {} present in network. Available layers are {}. format N/A self __name__ N/A self layer_name N/A N/A N/A net layers keys N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A log N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name internals items N/A N/A v N/A N/A N/A net handler get_numpy_copy v N/A N/A log N/A key N/A OrderedDict N/A N/A N/A log N/A key N/A min N/A N/A v min N/A N/A N/A log N/A key N/A avg N/A N/A v mean N/A N/A N/A log N/A key N/A max N/A N/A v max N/A out_deltas_log N/A log N/A output_deltas N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name output_deltas items N/A N/A v N/A N/A N/A net handler get_numpy_copy v N/A key_log N/A out_deltas_log N/A key N/A OrderedDict N/A N/A key_log N/A min N/A N/A v min N/A N/A key_log N/A avg N/A N/A v mean N/A N/A key_log N/A max N/A N/A v max N/A in_deltas_log N/A log N/A input_deltas N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name input_deltas items N/A N/A key_log N/A in_deltas_log N/A key N/A OrderedDict N/A v N/A N/A N/A net handler get_numpy_copy v N/A N/A N/A key_log N/A key N/A min N/A N/A v min N/A N/A N/A key_log N/A key N/A avg N/A N/A v mean N/A N/A N/A key_log N/A key N/A max N/A N/A v max N/A log N/A N/A MonitorLayerGradients N/A Hook N/A N/A 
    Monitor some statistics about all the gradients of a layer.
     __init__ N/A N/A self layer_name name timescale interval verbose N/A None epoch 1 None N/A N/A N/A name None N/A N/A name N/A N/A MonitorGradients_{} format layer_name N/A N/A N/A N/A super MonitorLayerGradients self __init__ name timescale interval verbose N/A N/A self layer_name layer_name N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A self layer_name N/A N/A N/A net layers keys N/A N/A {} >> No layer named {} present in network. Available layers are {}. format N/A self __name__ N/A self layer_name N/A N/A N/A net layers keys N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A log N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name gradients items N/A N/A v N/A N/A N/A net handler get_numpy_copy v N/A N/A log N/A key N/A OrderedDict N/A N/A N/A log N/A key N/A min N/A N/A v min N/A N/A N/A log N/A key N/A avg N/A N/A v mean N/A N/A N/A log N/A key N/A max N/A N/A v max N/A log N/A N/A MonitorLayerInOuts N/A Hook N/A N/A 
    Monitor some statistics about all the inputs and outputs of a layer.
     __init__ N/A N/A self layer_name name timescale interval verbose N/A None epoch 1 None N/A N/A N/A name None N/A N/A name N/A N/A MonitorInOuts_{} format layer_name N/A N/A N/A N/A super MonitorLayerInOuts self __init__ name timescale interval verbose N/A N/A self layer_name layer_name N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A self layer_name N/A N/A N/A net layers keys N/A N/A {} >> No layer named {} present in network. Available layers are {}. format N/A self __name__ N/A self layer_name N/A N/A N/A net layers keys N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A log N/A OrderedDict N/A input_log N/A log N/A inputs N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name inputs items N/A N/A v N/A N/A N/A net handler get_numpy_copy v N/A key_log N/A input_log N/A key N/A OrderedDict N/A N/A key_log N/A min N/A N/A v min N/A N/A key_log N/A avg N/A N/A v mean N/A N/A key_log N/A max N/A N/A v max N/A output_log N/A log N/A outputs N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name outputs items N/A N/A key_log N/A output_log N/A key N/A OrderedDict N/A v N/A N/A N/A net handler get_numpy_copy v N/A N/A key_log N/A min N/A N/A v min N/A N/A key_log N/A avg N/A N/A v mean N/A N/A key_log N/A max N/A N/A v max N/A log N/A N/A MonitorLayerParameters N/A Hook N/A N/A 
    Monitor some statistics about all the parameters of a layer.
     __init__ N/A N/A self layer_name name timescale interval verbose N/A None epoch 1 None N/A N/A N/A name None N/A N/A name N/A N/A MonitorParameters_{} format layer_name N/A N/A N/A N/A super MonitorLayerParameters self __init__ name timescale interval verbose N/A N/A self layer_name layer_name N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A self layer_name N/A N/A N/A net layers keys N/A N/A {} >> No layer named {} present in network. Available layers are {}. format N/A self __name__ N/A self layer_name N/A N/A N/A net layers keys N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A log N/A OrderedDict N/A N/A key v N/A N/A N/A N/A N/A net buffer N/A N/A self layer_name parameters items N/A N/A v N/A N/A N/A net handler get_numpy_copy v N/A N/A log N/A key N/A OrderedDict N/A N/A N/A log N/A key N/A min N/A N/A v min N/A N/A N/A log N/A key N/A avg N/A N/A v mean N/A N/A N/A log N/A key N/A max N/A N/A v max N/A N/A N/A len N/A v shape 1 N/A N/A N/A N/A log N/A key N/A min_L2_norm N/A N/A N/A N/A np sqrt N/A N/A np sum N/A v 2 axis 1 min N/A N/A N/A log N/A key N/A avg_L2_norm N/A N/A N/A N/A np sqrt N/A N/A np sum N/A v 2 axis 1 mean N/A N/A N/A log N/A key N/A max_L2_norm N/A N/A N/A N/A np sqrt N/A N/A np sum N/A v 2 axis 1 max N/A log N/A N/A MonitorLoss N/A Hook N/A N/A 
    Monitor the losses computed by the network on a dataset using a given data
    iterator.
     __init__ N/A N/A self iter_name name timescale interval verbose N/A None epoch 1 None N/A N/A N/A N/A N/A super MonitorLoss self __init__ name timescale interval verbose N/A N/A self iter_name iter_name N/A N/A self iter None N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A N/A super MonitorLoss self start net stepper verbose named_data_iters N/A N/A N/A self iter_name named_data_iters N/A N/A N/A KeyError N/A N/A {} >> {} is not present in named_data_iters. Remember to pass it  as a kwarg to Trainer.train() format N/A self __name__ N/A self iter_name N/A N/A self iter N/A named_data_iters N/A N/A self iter_name N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A evaluate net N/A self iter scorers N/A N/A N/A MonitorScores N/A Hook N/A N/A 
    Monitor the losses and optionally several scores using a given data
    iterator.

    Args:
        iter_name (str):
            name of the data iterator to use (as specified in the train() call)
        scorers (List[brainstorm.scorers.Scorer]):
            List of Scorers to evaluate.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'MonitorScores'
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.

    See Also:
        MonitorLoss: monitor the overall loss of the network.

     __init__ N/A N/A self iter_name scorers name timescale interval verbose N/A None epoch 1 None N/A N/A N/A N/A N/A super MonitorScores self __init__ name timescale interval verbose N/A N/A self iter_name iter_name N/A N/A self iter None N/A N/A self scorers scorers N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A N/A super MonitorScores self start net stepper verbose named_data_iters N/A N/A N/A self iter_name named_data_iters N/A N/A N/A KeyError N/A N/A {} >> {} is not present in named_data_iters. Remember to pass it  as a kwarg to Trainer.train() format N/A self __name__ N/A self iter_name N/A N/A self iter N/A named_data_iters N/A N/A self iter_name N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A evaluate net N/A self iter N/A self scorers N/A N/A EarlyStopper N/A Hook N/A N/A 
    Stop the training if a log entry does not improve for some time.

    Can stop training when the log entry is at its minimum (such as an error)
    or maximum (such as accuracy) according to the ``criterion`` argument.

    The ``timescale`` and ``interval`` should be the same as those for the
    monitoring hook which logs the quantity of interest.

    Args:
        log_name:
            Name of the log entry to be checked for improvement.
            It should be in the form <monitorname>.<log_name> where log_name
            itself may be a nested dictionary key in dotted notation.
        patience:
            Number of log updates to wait before stopping training.
            Default is 1.
        criterion:
            Indicates whether training should be stopped when the log entry is
            at its minimum or maximum value. Must be either 'min' or 'max'.
            Defaults to 'min'.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'EarlyStopper'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
    Examples:
        Add a hook to monitor a quantity of interest:

        >>> scorer = bs.scorers.Accuracy()
        >>> trainer.add_hook(bs.hooks.MonitorScores('valid_getter', [scorer],
        ...                                         name='validation'))

        Stop training if validation set accuracy does not rise for 10 epochs:

        >>> trainer.add_hook(bs.hooks.EarlyStopper('validation.Accuracy',
        ...                                        patience=10,
        ...                                        criterion='max'))

        Stop training if loss on validation set does not drop for 5 epochs:

        >>> trainer.add_hook(bs.hooks.EarlyStopper('validation.total_loss',
        ...                                        patience=5,
        ...                                        criterion='min'))

     N/A __default_values__ N/A patience 1 __init__ N/A N/A self log_name patience criterion name timescale interval verbose N/A 1 min None epoch 1 None N/A N/A N/A N/A N/A super EarlyStopper self __init__ name timescale interval verbose N/A N/A self log_name log_name N/A N/A self patience patience N/A N/A criterion N/A min max N/A N/A N/A ValueError N/A N/A Unknown criterion: '{}'(Should be 'min' or 'max') format criterion N/A N/A self criterion criterion N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A epoch_nr 0 N/A N/A N/A N/A e N/A get_by_path logs N/A self log_name N/A N/A N/A KeyError N/A N/A N/A e N/A get_by_path logs N/A self log_name N/A best_idx N/A N/A N/A self criterion min N/A N/A np argmin e N/A N/A np argmax e N/A N/A N/A len e N/A best_idx N/A self patience N/A N/A N/A N/A self message N/A N/A Stopping because {} did not improve for {} checks (criterion used : {}). format N/A self log_name N/A self patience N/A self criterion N/A N/A StopIteration N/A N/A StopAfterEpoch N/A Hook N/A N/A 
    Stop the training after a specified number of epochs.

    Args:
        max_epochs (int):
            The number of epochs to train.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'StopAfterEpoch'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
     __init__ N/A N/A self max_epochs name timescale interval verbose N/A None epoch 1 None N/A N/A N/A N/A N/A super StopAfterEpoch self __init__ name timescale interval verbose N/A N/A self max_epochs max_epochs N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A epoch_nr N/A self max_epochs N/A N/A N/A N/A self message N/A N/A Stopping because the maximum number of epochs ({}) was reached. format N/A self max_epochs N/A N/A StopIteration N/A N/A StopAfterThresholdReached N/A Hook N/A N/A 
    Stop the training if a log entry reaches the given threshold

    Can stop training when the log entry becomes sufficiently small (such as an
    error) or sufficiently large (such as accuracy) according to the threshold.

    Args:
        log_name:
            Name of the log entry to be checked for improvement.
            It should be in the form <monitorname>.<log_name> where log_name
            itself may be a nested dictionary key in dotted notation.
        threshold:
            The threshold value to reach
        criterion:
            Indicates whether training should be stopped when the log entry is
            at its minimum or maximum value. Must be either 'min' or 'max'.
            Defaults to 'min'.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'StopAfterThresholdReached'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
    Examples:
        Stop training if validation set accuracy is at least 97 %:

        >>> trainer.add_hook(StopAfterThresholdReached('validation.Accuracy',
        ...                                            threshold=0.97,
        ...                                            criterion='max'))

        Stop training if loss on validation set goes below 0.2:

        >>> trainer.add_hook(StopAfterThresholdReached('validation.total_loss',
        ...                                            threshold=0.2,
        ...                                            criterion='min'))

     __init__ N/A N/A self log_name threshold criterion name timescale interval verbose N/A min None epoch 1 None N/A N/A N/A N/A N/A super StopAfterThresholdReached self __init__ name timescale interval verbose N/A N/A self log_name log_name N/A N/A self threshold threshold N/A N/A criterion N/A min max N/A N/A N/A ValueError N/A N/A Unknown criterion: '{}'(Must be 'min' or 'max') format criterion N/A N/A self criterion criterion N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A e N/A get_by_path logs N/A self log_name N/A is_threshold_reached False N/A N/A N/A N/A self criterion max N/A N/A max e N/A self threshold N/A N/A is_threshold_reached True N/A N/A N/A N/A N/A self criterion min N/A N/A min e N/A self threshold N/A N/A is_threshold_reached True N/A is_threshold_reached N/A N/A N/A N/A self message N/A N/A Stopping because {} has reached the threshold {} (criterion used : {}) format N/A self log_name N/A self threshold N/A self criterion N/A N/A StopIteration N/A N/A StopOnNan N/A Hook N/A N/A 
    Stop the training if infinite or NaN values are found in parameters.

    This hook can also check a list of logs for invalid values.

    Args:
        logs_to_check (Optional[list, tuple]):
            A list of trainer logs to check in dotted notation. Defaults to ().
        check_parameters (Optional[bool]):
            Indicates whether the parameters should be checked for NaN.
            Defaults to True.
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'StopOnNan'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
     __init__ N/A N/A self logs_to_check check_parameters check_training_loss name timescale interval verbose N/A N/A True True None epoch 1 None N/A N/A N/A N/A N/A super StopOnNan self __init__ name timescale interval verbose N/A N/A self logs_to_check N/A N/A isinstance logs_to_check string_types N/A logs_to_check logs_to_check N/A N/A self check_parameters check_parameters N/A N/A self check_training_loss check_training_loss N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A log_name N/A self logs_to_check N/A N/A log N/A get_by_path logs log_name N/A N/A N/A N/A np all N/A N/A np isfinite log N/A N/A N/A N/A self message N/A N/A NaN or inf detected in {}! format log_name N/A N/A StopIteration N/A N/A self check_parameters N/A N/A N/A N/A N/A N/A net handler is_fully_finite N/A N/A net buffer parameters N/A N/A N/A N/A self message NaN or inf detected in parameters! N/A N/A StopIteration N/A N/A N/A self check_training_loss N/A rolling_training logs N/A N/A rtrain N/A logs N/A rolling_training N/A N/A total_loss rtrain N/A N/A loss N/A rtrain N/A total_loss N/A N/A loss N/A rtrain N/A Loss N/A N/A N/A N/A np all N/A N/A np isfinite loss N/A N/A N/A N/A self message NaN or inf detected in rolling training loss! N/A N/A StopIteration N/A N/A StopOnSigQuit N/A Hook N/A N/A 
    Stop training after the next call if it received a SIGQUIT (Ctrl + \).

    This hook makes it possible to exit the training loop and continue with
    the rest of the program execution.

    Args:
        name (Optional[str]):
            Name of this monitor. This name is used as a key in the trainer
            logs. Default is 'StopOnSigQuit'.
        timescale (Optional[str]):
            Specifies whether the Monitor should be called after each epoch or
            after each update. Default is 'epoch'.
        interval (Optional[int]):
            This monitor should be called every ``interval`` epochs/updates.
            Default is 1.
        verbose: bool, optional
            Specifies whether the logs of this monitor should be printed, and
            acts as a fallback verbosity for the used data iterator.
            If not set it defaults to the verbosity setting of the trainer.
     N/A __undescribed__ N/A quit False __init__ N/A N/A self name timescale interval verbose N/A None epoch 1 None N/A N/A N/A N/A N/A super StopOnSigQuit self __init__ name timescale interval verbose verbose N/A N/A self quit False N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A N/A N/A super StopOnSigQuit self start net stepper verbose named_data_iters N/A N/A self quit False N/A N/A N/A signal signal N/A signal SIGQUIT N/A self receive_signal N/A receive_signal N/A N/A self signum stack N/A N/A N/A N/A N/A self message Interrupting N/A N/A self quit True N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A self quit N/A N/A N/A StopIteration Received SIGQUIT signal. N/A N/A N/A N/A N/A optional has_bokeh N/A N/A BokehVisualizer N/A optional bokeh_mock N/A N/A bokeh.plotting bk N/A warnings BokehVisualizer N/A Hook N/A N/A 
        Visualizes log values in your browser during training time using the
        Bokeh plotting library.

        Before running the trainer the user is required to have the Bokeh
        Server running.

        By default the visualization is discarded upon closing the webbrowser.
        However if an output file is specified then the .html file will be
        saved after each iteration at the specified location.

        Args:
            log_names (list, array):
                Contains the name of the logs that are being recorded to be
                visualized. log_names should be of the form
                <monitorname>.<log_name> where log_name itself may be a nested
                dictionary key in dotted notation.
            filename (Optional, str):
                The location to which the .html file containing the accuracy
                plot should be saved.
            timescale (Optional[str]):
                Specifies whether the Monitor should be called after each
                epoch or after each update. Default is 'epoch'
            interval (Optional[int]):
                This monitor should be called every ``interval``
                number of epochs/updates. Default is 1.
            name (Optional[str]):
                Name of this monitor. This name is used as a key in the trainer
                logs. Default is 'MonitorScores'
            verbose: bool, optional
                Specifies whether the logs of this monitor should be printed,
                and acts as a fallback verbosity for the used data iterator.
                If not set it defaults to the verbosity setting of the trainer.
         __init__ N/A N/A self log_names filename timescale interval name verbose N/A None epoch 1 None None N/A N/A N/A N/A N/A super BokehVisualizer self __init__ name timescale interval verbose N/A N/A isinstance log_names string_types N/A N/A N/A self log_names N/A log_names N/A N/A N/A isinstance log_names N/A tuple list N/A N/A N/A self log_names log_names N/A N/A N/A ValueError N/A N/A log_names must be either str or list but was {} format N/A type log_names N/A N/A self filename filename N/A N/A self bk bk N/A N/A self TOOLS resize,crosshair,pan,wheel_zoom,box_zoom,reset,save N/A N/A self colors N/A blue green red olive cyan aqua gray N/A N/A N/A warnings filterwarnings error N/A N/A N/A N/A N/A N/A self bk output_server N/A self __name__ N/A N/A N/A warnings resetwarnings N/A N/A N/A Warning N/A N/A N/A StopIteration Bokeh server is not running N/A N/A self fig N/A N/A N/A self bk figure title N/A self __name__ x_axis_label N/A self timescale y_axis_label value tools N/A self TOOLS plot_width 1000 x_range N/A 0 25 y_range N/A 0 1 N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A count 0 N/A log_name N/A self log_names N/A N/A N/A N/A N/A self fig line N/A N/A legend log_name line_width 2 color N/A N/A self colors N/A N/A count N/A len N/A self colors name log_name N/A count 1 N/A N/A N/A N/A self bk show N/A self fig N/A N/A N/A N/A self bk output_file bokeh_visualisation.html title N/A self __name__ mode cdn N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A epoch_nr 0 N/A N/A N/A log_name N/A self log_names N/A N/A renderer N/A N/A N/A self fig select N/A dict name log_name N/A datasource N/A N/A renderer N/A 0 data_source N/A N/A N/A datasource data N/A y N/A get_by_path logs log_name N/A N/A N/A datasource data N/A x N/A range N/A len N/A N/A datasource data N/A y N/A N/A N/A N/A N/A N/A self bk cursession store_objects datasource N/A N/A N/A self filename None N/A N/A N/A N/A N/A self bk save N/A self fig filename N/A N/A self filename .html N/A N/A ProgressBar N/A Hook N/A N/A  Adds a progress bar to show the training progress.  __init__ N/A N/A self N/A N/A N/A N/A N/A N/A super ProgressBar self __init__ None update 1 N/A N/A self length None N/A N/A self bar None N/A start N/A N/A self net stepper verbose named_data_iters N/A N/A N/A N/A training_data_iter named_data_iters N/A N/A self length N/A N/A named_data_iters N/A training_data_iter length N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A N/A epoch_nr 0 N/A N/A N/A math ceil N/A update_nr N/A self length epoch_nr N/A N/A N/A update_nr N/A self length 1 N/A N/A N/A self bar N/A progress_bar N/A self length N/A N/A print N/A next N/A self bar end N/A N/A N/A N/A sys stdout flush N/A N/A N/A N/A update_nr N/A self length 0 N/A N/A N/A self bar N/A N/A N/A print N/A N/A N/A self bar send N/A self length N/A N/A N/A print N/A N/A N/A self bar send N/A update_nr N/A self length end N/A N/A N/A N/A sys stdout flush N/A N/A InfoUpdater N/A Hook N/A N/A  Save the information from logs to the Sacred custom info dict __init__ N/A N/A self run name timescale interval N/A None epoch 1 N/A N/A N/A N/A N/A super InfoUpdater self __init__ name timescale interval N/A N/A self run run N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A info N/A N/A self run info N/A N/A info N/A epoch_nr epoch_nr N/A N/A info N/A update_nr update_nr N/A N/A info N/A logs logs N/A N/A nr_parameters info N/A N/A N/A info N/A nr_parameters N/A N/A N/A net buffer parameters size N/A N/A ModifyStepperAttribute N/A Hook N/A N/A Modify an attribute of the training stepper. __init__ N/A N/A self schedule attr_name timescale interval name verbose N/A learning_rate epoch 1 None None N/A N/A N/A N/A N/A super ModifyStepperAttribute self __init__ name timescale interval verbose N/A N/A self schedule schedule N/A N/A self attr_name attr_name N/A start N/A N/A self net stepper verbose monitor_kwargs N/A N/A N/A N/A N/A N/A super ModifyStepperAttribute self start net stepper verbose monitor_kwargs N/A N/A hasattr stepper N/A self attr_name N/A N/A The stepper {} does not have the attribute {} format N/A N/A stepper __class__ __name__ N/A self attr_name N/A __call__ N/A N/A self epoch_nr update_nr net stepper logs N/A N/A N/A N/A setattr stepper N/A self attr_name N/A N/A self schedule epoch_nr update_nr N/A self timescale N/A self interval net stepper logs N/A N/A