Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias alias ImportFrom alias alias alias alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias Import alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad ListLoad Str Str Str Str Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad TryExcept body If UnaryOpNot Call NameLoad NameLoad Str body Raise Call NameLoad Num BinOpMod Str NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Return NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr Str NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Num BinOpMod Str TupleLoad AttributeLoad NameLoad attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr If CompareNotEq NameLoad NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call NameLoad Num Str If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Expr Call AttributeLoad NameLoad attr Str ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad orelse Expr Call AttributeLoad NameLoad attr Str NameLoad Return NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str NameLoad handlers ExceptHandler type NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str NameLoad Raise decorator_list FunctionDef arguments args NameParam NameParam defaults body FunctionDef arguments args NameParam defaults body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Str If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Str If BoolOpAnd Call AttributeLoad NameLoad attr CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Str If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Str If CompareGt Call NameLoad AttributeLoad NameLoad attr Num body Expr Call NameLoad Str If CompareGt Call NameLoad Call NameLoad Call AttributeLoad NameLoad attr Num body Expr Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad NameLoad orelse Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword AttributeLoad NameLoad attr keyword NameLoad Assign NameStore IfExp NameLoad AttributeLoad NameLoad attr NameLoad If CompareNotIn NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad NameLoad If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If NameLoad body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad For NameStore Call AttributeLoad NameLoad attr body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body TryExcept body If CompareNotEq AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr NameLoad body Continue handlers ExceptHandler body Expr Call AttributeLoad NameLoad attr Str AttributeLoad NameLoad attr Continue If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If BoolOpOr UnaryOpNot NameLoad CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr Str Return CompareIs Call AttributeLoad AttributeLoad NameLoad attr attr Str NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str If BoolOpAnd CompareEq Call NameLoad AttributeLoad NameLoad attr Num CompareEq AttributeLoad NameLoad attr NameLoad body Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd NameLoad CompareEq SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num AttributeLoad NameLoad attr body If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr body Return NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr If CompareNotEq NameLoad NameLoad body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call NameLoad Num Str Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore TupleLoad AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Num Expr Call AttributeLoad NameLoad attr Str Dict Str Str Str Str Str Str Str Str NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr If BoolOpAnd CompareEq AttributeLoad NameLoad attr NameLoad CompareIn Str AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad NameLoad body Raise Call NameLoad Num Str Return NameLoad If CompareNotEq AttributeLoad NameLoad attr NameLoad body If BoolOpAnd NameLoad CompareEq AttributeLoad NameLoad attr NameLoad CompareEq NameLoad AttributeLoad NameLoad attr body Return NameLoad If UnaryOpNot NameLoad body Raise Call NameLoad Num BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq AttributeLoad NameLoad attr NameLoad body If NameLoad body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad orelse If NameLoad body Raise Call NameLoad Num BinOpMod Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Num If CompareLt NameLoad NameLoad body Raise Call NameLoad Num BinOpMod Str NameLoad orelse If CompareEq AttributeLoad NameLoad attr NameLoad body If CompareNotEq AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Num Str orelse If NameLoad body Raise Call NameLoad Num Str orelse If CompareEq NameLoad AttributeLoad NameLoad attr body Pass orelse If CompareEq NameLoad AttributeLoad NameLoad attr body If BoolOpAnd UnaryOpNot NameLoad UnaryOpNot NameLoad body Raise Call NameLoad Num Str orelse Raise Call NameLoad Num Str orelse If CompareEq AttributeLoad NameLoad attr NameLoad body If BoolOpAnd NameLoad CompareLt NameLoad NameLoad body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad orelse If CompareNotEq NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Num If BoolOpOr CompareLt NameLoad NameLoad CompareLtE NameLoad NameLoad body Raise Call NameLoad Num BinOpMod Str NameLoad orelse If CompareEq AttributeLoad NameLoad attr NameLoad body If BoolOpOr CompareLt NameLoad NameLoad CompareLtE NameLoad NameLoad body Raise Call NameLoad Num Str orelse Raise Call NameLoad Num BinOpMod Str NameLoad Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str If CompareNotIn Str AttributeLoad NameLoad attr body Return NameLoad If CompareNotIn Str SubscriptLoad AttributeLoad NameLoad attr Index Str body Return NameLoad Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Str For NameStore Set Str Str body If CompareNotIn NameLoad NameLoad body Return NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad NameLoad attr TupleLoad AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str AttributeLoad NameLoad attr body Return NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Return NameLoad For NameStore Call AttributeLoad NameLoad attr NameLoad body Assign NameStore SubscriptLoad NameLoad Index Str TryExcept body For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body If UnaryOpNot Call AttributeLoad NameLoad attr Str body Continue Assign NameStore Call NameLoad NameLoad Call NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad Return NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad body Continue Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore ListLoad If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Dict Str SubscriptLoad AttributeLoad NameLoad attr Index Str If CompareIn Str AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Str SubscriptLoad AttributeLoad NameLoad attr Index Str Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str ListLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Dict attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num If CompareIs NameLoad NameLoad body Return Num orelse Return Call NameLoad NameLoad orelse Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str NameLoad body Return Num orelse Return Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad If CompareIsNot NameLoad NameLoad body Return Call NameLoad NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str TryExcept body Assign NameStore Yield Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Str NameLoad Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str keyword ListLoad Str Index Num If BoolOpAnd NameLoad NameLoad NameLoad body Expr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad If BoolOpAnd NameLoad UnaryOpNot NameLoad body Raise Call NameLoad Num Str keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad SubscriptLoad NameLoad Index Str Index Num If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareNotIn Str NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Str Index Num If CompareEq AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad Num Str If UnaryOpNot Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Raise Call NameLoad Num Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad Assign NameStore Str Assign NameStore NameLoad Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Slice Call NameLoad NameLoad orelse If CompareEq AttributeLoad NameLoad attr Str body Assign NameStore NameLoad If CompareIs NameLoad NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr If NameLoad body Assign NameStore Dict Str Str Str NameLoad NameLoad NameLoad orelse Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad If CompareNotEq SubscriptLoad NameLoad Index Str NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad SubscriptLoad NameLoad Index Str Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr BinOpAdd Str NameLoad Expr Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr Str If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Str If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return NameLoad Assign NameStore Call NameLoad SubscriptLoad NameLoad Slice Call NameLoad NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Return CompareLt NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str If CompareLt NameLoad Num body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str BinOpAdd NameLoad Num If CompareLt NameLoad Num body Return NameLoad Return CompareIn SubscriptLoad NameLoad Slice BinOpAdd NameLoad Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr Assign NameStore Dict Str Str Str Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body TryExcept body Assign NameStore SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Num Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad Raise Call NameLoad AttributeLoad NameLoad attr Str keyword AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Raise Call NameLoad AttributeLoad NameLoad attr Str decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return ListLoad Assign NameStore ListLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore IfExp NameLoad CompareEq NameLoad AttributeLoad NameLoad attr NameLoad orelse Assign NameStore NameLoad If CompareEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index Str If CompareIn NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body If BoolOpAnd NameLoad UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore TupleLoad AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Str Index Str Index Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse If NameLoad body If CompareEq SubscriptLoad AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign NameStore TupleLoad AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore NameLoad If NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Dict attr NameLoad If CompareIs NameLoad NameLoad body If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Num If NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad If CompareLt NameLoad NameLoad body Raise Call NameLoad Num BinOpAdd Str BinOpMod Str TupleLoad NameLoad NameLoad If Call NameLoad NameLoad Str body If Call AttributeLoad AttributeLoad NameLoad attr attr Str body If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Num Str orelse Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr If CompareNotEq NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad Num Str Return NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Num If CompareGtE NameLoad NameLoad body Return NameLoad Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr If CompareEq NameLoad NameLoad body Return NameLoad Raise Call NameLoad Num Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler body Raise Call NameLoad Num BinOpMod Str TupleLoad NameLoad Assign NameStore TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Return Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore ListLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad TupleLoad Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore Call NameLoad BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str For NameStore Call NameLoad BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr For TupleStore NameStore NameStore NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad Dict If CompareIn NameLoad NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore NameLoad If CompareIn NameLoad NameLoad body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index NameLoad orelse Assign NameStore NameLoad If BoolOpAnd CompareIsNot NameLoad NameLoad CompareIsNot NameLoad NameLoad body If CompareEq NameLoad NameLoad body Continue If BoolOpAnd CompareEq NameLoad Str CompareNotEq NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Raise Call NameLoad Num Str If BoolOpOr CompareGt NameLoad NameLoad CompareGt NameLoad NameLoad body Raise Call NameLoad Num Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Yield Call AttributeLoad NameLoad attr NameLoad If NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Yield Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Yield Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad NameLoad attr Str Assign NameStore Dict If NameLoad body Assign SubscriptStore NameLoad Index TupleLoad AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareLt NameLoad NameLoad body Raise Call NameLoad Num Str decorator_list AttributeLoad NameLoad attr decorator_list
N/A N/A This module contains classes for authenticating the user. canonicaljson encode_canonical_json signedjson.key decode_verify_key_bytes signedjson.sign verify_signed_json SignatureVerifyException twisted.internet defer synapse.api.constants EventTypes Membership JoinRules synapse.api.errors AuthError Codes SynapseError EventSizeError synapse.types Requester RoomID UserID EventID synapse.util.logutils log_function synapse.util.logcontext preserve_context_over_fn unpaddedbase64 decode_base64 N/A logging N/A pymacaroons N/A logger N/A N/A logging getLogger __name__ N/A AuthEventTypes N/A N/A EventTypes Create N/A EventTypes Member N/A EventTypes PowerLevels N/A EventTypes JoinRules N/A EventTypes RoomHistoryVisibility N/A EventTypes ThirdPartyInvite Auth N/A object N/A __init__ N/A N/A self hs N/A N/A N/A N/A self hs hs N/A N/A self store N/A N/A hs get_datastore N/A N/A self state N/A N/A hs get_state_handler N/A N/A self TOKEN_NOT_FOUND_HTTP_STATUS 401 N/A N/A self _KNOWN_CAVEAT_PREFIXES N/A set N/A gen =  guest =  type =  time <  user_id =  N/A check N/A N/A self event auth_events N/A N/A N/A  Checks if this event is correctly authed.

        Args:
            event: the event being checked.
            auth_events (dict: event-key -> event): the existing room state.


        Returns:
            True if the auth checks pass.
         N/A N/A N/A self check_size_limits event N/A N/A N/A N/A N/A hasattr event room_id N/A N/A N/A AuthError 500 N/A Event has no room_id: %s event N/A N/A auth_events None N/A N/A N/A N/A logger warn Trusting event: %s N/A event event_id N/A True N/A N/A N/A event type N/A EventTypes Create N/A N/A True N/A creation_event N/A N/A auth_events get N/A N/A EventTypes Create None N/A N/A creation_event N/A N/A N/A SynapseError 403 N/A Room %r does not exist N/A N/A event room_id N/A creating_domain N/A N/A N/A RoomID from_string N/A event room_id domain N/A originating_domain N/A N/A N/A UserID from_string N/A event sender domain N/A N/A creating_domain originating_domain N/A N/A N/A N/A N/A self can_federate event auth_events N/A N/A N/A AuthError 403 This room has been marked as unfederatable. N/A N/A N/A event type N/A EventTypes Aliases N/A N/A True N/A N/A N/A logger debug Auth events: %s N/A N/A a event_id N/A a N/A N/A auth_events values N/A N/A N/A event type N/A EventTypes Member N/A N/A allowed N/A N/A self is_membership_change_allowed event auth_events N/A allowed N/A N/A N/A N/A logger debug Allowing! %s event N/A N/A N/A N/A logger debug Denying! %s event N/A allowed N/A N/A N/A self check_event_sender_in_room event auth_events N/A N/A N/A self _can_send_event event auth_events N/A N/A N/A event type N/A EventTypes PowerLevels N/A N/A N/A N/A self _check_power_levels event auth_events N/A N/A N/A event type N/A EventTypes Redaction N/A N/A N/A N/A self check_redaction event auth_events N/A N/A N/A logger debug Allowing! %s event N/A N/A N/A AuthError N/A e N/A N/A N/A N/A logger info Event auth check failed on event %s with msg: %s event N/A e msg N/A N/A N/A logger info Denying! %s event N/A N/A check_size_limits N/A N/A self event N/A N/A too_big N/A N/A field N/A N/A N/A N/A EventSizeError N/A %s too large N/A field N/A N/A N/A N/A len N/A event user_id 255 N/A N/A N/A too_big user_id N/A N/A N/A len N/A event room_id 255 N/A N/A N/A too_big room_id N/A N/A N/A N/A event is_state N/A N/A len N/A event state_key 255 N/A N/A N/A too_big state_key N/A N/A N/A len N/A event type 255 N/A N/A N/A too_big type N/A N/A N/A len N/A event event_id 255 N/A N/A N/A too_big event_id N/A N/A N/A len N/A encode_canonical_json N/A N/A event get_pdu_json 65536 N/A N/A N/A too_big event N/A check_joined_room N/A N/A self room_id user_id current_state N/A None N/A N/A Check if the user is currently joined in the room
        Args:
            room_id(str): The room to check.
            user_id(str): The user to check.
            current_state(dict): Optional map of the current state of the room.
                If provided then that map is used to check whether they are a
                member of the room. Otherwise the current membership is
                loaded from the database.
        Raises:
            AuthError if the user is not in the room.
        Returns:
            A deferred membership event for the user if the user is in
            the room.
         N/A current_state N/A N/A member N/A N/A current_state get N/A N/A EventTypes Member user_id None N/A N/A member N/A N/A N/A N/A self state get_current_state room_id room_id event_type N/A EventTypes Member state_key user_id N/A N/A N/A self _check_joined_room member user_id room_id N/A N/A N/A defer returnValue member N/A N/A defer inlineCallbacks check_user_was_in_room N/A N/A self room_id user_id N/A N/A N/A Check if the user was in the room at some point.
        Args:
            room_id(str): The room to check.
            user_id(str): The user to check.
        Raises:
            AuthError if the user was never in the room.
        Returns:
            A deferred membership event for the user if the user was in the
            room. This will be the join event if they are currently joined to
            the room. This will be the leave event if they have left the room.
         N/A member N/A N/A N/A N/A self state get_current_state room_id room_id event_type N/A EventTypes Member state_key user_id N/A membership N/A member N/A member membership None N/A N/A membership N/A N/A Membership JOIN N/A Membership LEAVE N/A N/A N/A AuthError 403 N/A User %s not in room %s N/A user_id room_id N/A N/A membership N/A Membership LEAVE N/A N/A forgot N/A N/A N/A N/A self store did_forget user_id room_id N/A forgot N/A N/A N/A AuthError 403 N/A User %s not in room %s N/A user_id room_id N/A N/A N/A defer returnValue member N/A N/A defer inlineCallbacks check_host_in_room N/A N/A self room_id host N/A N/A N/A curr_state N/A N/A N/A N/A self state get_current_state room_id N/A event N/A N/A curr_state values N/A N/A N/A N/A event type N/A EventTypes Member N/A N/A N/A N/A N/A N/A N/A N/A UserID from_string N/A event state_key domain host N/A N/A N/A N/A N/A N/A N/A N/A logger warn state_key not user_id: %s N/A event state_key N/A N/A N/A N/A N/A event content N/A membership N/A Membership JOIN N/A N/A N/A N/A defer returnValue True N/A N/A N/A defer returnValue False N/A N/A defer inlineCallbacks check_event_sender_in_room N/A N/A self event auth_events N/A N/A N/A key N/A N/A EventTypes Member N/A event user_id N/A member_event N/A N/A auth_events get key N/A N/A N/A self _check_joined_room member_event N/A event user_id N/A event room_id N/A _check_joined_room N/A N/A self member user_id room_id N/A N/A N/A N/A N/A member N/A N/A member membership N/A Membership JOIN N/A N/A N/A AuthError 403 N/A User %s not in room %s (%s) N/A user_id room_id N/A repr member N/A can_federate N/A N/A self event auth_events N/A N/A N/A creation_event N/A N/A auth_events get N/A N/A EventTypes Create N/A N/A N/A N/A N/A creation_event content get m.federate True True N/A is_membership_change_allowed N/A N/A self event auth_events N/A N/A N/A membership N/A N/A event content N/A membership N/A N/A N/A N/A len N/A event prev_events 1 N/A N/A Membership JOIN membership N/A N/A key N/A N/A EventTypes Create N/A create N/A N/A auth_events get key N/A N/A create N/A N/A N/A N/A event prev_events N/A 0 N/A 0 N/A create event_id N/A N/A N/A N/A N/A create content N/A creator N/A event state_key N/A N/A True N/A target_user_id N/A event state_key N/A creating_domain N/A N/A N/A RoomID from_string N/A event room_id domain N/A target_domain N/A N/A N/A UserID from_string target_user_id domain N/A N/A creating_domain target_domain N/A N/A N/A N/A N/A self can_federate event auth_events N/A N/A N/A AuthError 403 This room has been marked as unfederatable. N/A key N/A N/A EventTypes Member N/A event user_id N/A caller N/A N/A auth_events get key N/A caller_in_room N/A caller N/A N/A caller membership N/A Membership JOIN N/A caller_invited N/A caller N/A N/A caller membership N/A Membership INVITE N/A key N/A N/A EventTypes Member target_user_id N/A target N/A N/A auth_events get key N/A target_in_room N/A target N/A N/A target membership N/A Membership JOIN N/A target_banned N/A target N/A N/A target membership N/A Membership BAN N/A key N/A N/A EventTypes JoinRules N/A join_rule_event N/A N/A auth_events get key N/A join_rule_event N/A N/A join_rule N/A N/A N/A join_rule_event content get join_rule N/A JoinRules INVITE N/A N/A join_rule N/A JoinRules INVITE N/A user_level N/A N/A self _get_user_power_level N/A event user_id auth_events N/A target_level N/A N/A self _get_user_power_level target_user_id auth_events N/A ban_level N/A N/A self _get_named_level auth_events ban 50 N/A N/A N/A logger debug is_membership_change_allowed: %s N/A caller_in_room caller_invited target_banned target_in_room membership join_rule target_user_id event.user_id caller_in_room caller_invited target_banned target_in_room membership join_rule target_user_id N/A event user_id N/A N/A N/A N/A Membership INVITE membership N/A third_party_invite N/A event content N/A N/A N/A N/A N/A self _verify_third_party_invite event auth_events N/A N/A N/A AuthError 403 You are not invited to this room. N/A True N/A N/A N/A Membership JOIN membership N/A N/A N/A caller_invited N/A N/A Membership LEAVE membership N/A target_user_id N/A event user_id N/A N/A True N/A N/A caller_in_room N/A N/A N/A AuthError 403 N/A %s not in room %s. N/A N/A event user_id N/A event room_id N/A N/A N/A Membership INVITE membership N/A N/A target_banned N/A N/A N/A AuthError 403 N/A %s is banned from the room N/A target_user_id N/A N/A target_in_room N/A N/A N/A AuthError 403 N/A %s is already in the room. target_user_id N/A N/A invite_level N/A N/A self _get_named_level auth_events invite 0 N/A N/A user_level invite_level N/A N/A N/A AuthError 403 N/A You cannot invite user %s. target_user_id N/A N/A N/A N/A Membership JOIN membership N/A N/A N/A N/A event user_id target_user_id N/A N/A N/A AuthError 403 Cannot force another user to join. N/A N/A target_banned N/A N/A N/A AuthError 403 You are banned from this room N/A N/A N/A join_rule N/A JoinRules PUBLIC N/A N/A N/A N/A N/A join_rule N/A JoinRules INVITE N/A N/A N/A N/A caller_in_room N/A caller_invited N/A N/A N/A AuthError 403 You are not invited to this room. N/A N/A N/A AuthError 403 You are not allowed to join this room N/A N/A N/A N/A Membership LEAVE membership N/A N/A N/A target_banned N/A user_level ban_level N/A N/A N/A AuthError 403 N/A You cannot unban user &s. N/A target_user_id N/A N/A N/A target_user_id N/A event user_id N/A N/A kick_level N/A N/A self _get_named_level auth_events kick 50 N/A N/A N/A user_level kick_level N/A user_level target_level N/A N/A N/A AuthError 403 N/A You cannot kick user %s. target_user_id N/A N/A N/A N/A Membership BAN membership N/A N/A N/A N/A user_level ban_level N/A user_level target_level N/A N/A N/A AuthError 403 You don't have permission to ban N/A N/A N/A AuthError 500 N/A Unknown membership %s membership N/A True N/A log_function _verify_third_party_invite N/A N/A self event auth_events N/A N/A N/A 
        Validates that the invite event is authorized by a previous third-party invite.

        Checks that the public key, and keyserver, match those in the third party invite,
        and that the invite event has a signature issued using that public key.

        Args:
            event: The m.room.member join event being validated.
            auth_events: All relevant previous context events which may be used
                for authorization decisions.

        Return:
            True if the event fulfills the expectations of a previous third party
            invite event.
         N/A N/A third_party_invite N/A event content N/A N/A False N/A N/A signed N/A N/A event content N/A third_party_invite N/A N/A False N/A signed N/A N/A N/A event content N/A third_party_invite N/A signed N/A key N/A mxid token N/A N/A N/A key signed N/A N/A False N/A token N/A signed N/A token N/A invite_event N/A N/A auth_events get N/A N/A EventTypes ThirdPartyInvite token N/A N/A invite_event N/A N/A False N/A N/A N/A event user_id N/A invite_event user_id N/A N/A False N/A N/A N/A signed N/A mxid N/A event state_key N/A N/A False N/A N/A N/A signed N/A token token N/A N/A False N/A public_key_object N/A N/A self get_public_keys invite_event N/A N/A public_key N/A public_key_object N/A public_key N/A N/A N/A N/A server signature_block N/A N/A N/A signed N/A signatures items N/A N/A N/A key_name encoded_signature N/A N/A signature_block items N/A N/A N/A N/A N/A key_name startswith ed25519: N/A N/A N/A verify_key N/A decode_verify_key_bytes key_name N/A decode_base64 public_key N/A N/A verify_signed_json signed server verify_key N/A True N/A N/A N/A N/A KeyError SignatureVerifyException N/A N/A N/A False N/A get_public_keys N/A N/A self invite_event N/A N/A N/A public_keys N/A N/A N/A public_key N/A invite_event content N/A N/A o N/A public_key N/A N/A invite_event content N/A public_key N/A N/A key_validity_url N/A invite_event content N/A N/A N/A o N/A key_validity_url N/A N/A invite_event content N/A key_validity_url N/A N/A N/A public_keys append o N/A N/A N/A public_keys extend N/A N/A N/A invite_event content get public_keys N/A N/A public_keys N/A _get_power_level_event N/A N/A self auth_events N/A N/A N/A key N/A N/A EventTypes PowerLevels N/A N/A N/A auth_events get key N/A _get_user_power_level N/A N/A self user_id auth_events N/A N/A N/A power_level_event N/A N/A self _get_power_level_event auth_events N/A power_level_event N/A N/A level N/A N/A N/A N/A N/A power_level_event content get users N/A get user_id N/A N/A level N/A N/A level N/A N/A N/A power_level_event content get users_default 0 N/A N/A level None N/A N/A 0 N/A N/A N/A int level N/A N/A key N/A N/A EventTypes Create N/A create_event N/A N/A auth_events get key N/A N/A N/A create_event None N/A N/A N/A create_event content N/A creator user_id N/A N/A 100 N/A N/A 0 N/A _get_named_level N/A N/A self auth_events name default N/A N/A N/A power_level_event N/A N/A self _get_power_level_event auth_events N/A N/A power_level_event N/A N/A default N/A level N/A N/A N/A power_level_event content get name None N/A N/A level None N/A N/A N/A int level N/A N/A default N/A get_user_by_req N/A N/A self request allow_guest N/A False N/A N/A  Get a registered user's ID.

        Args:
            request - An HTTP request with an access_token query parameter.
        Returns:
            tuple of:
                UserID (str)
                Access token ID (str)
        Raises:
            AuthError if no user by that token exists or the token is invalid.
         N/A N/A N/A user_id N/A N/A N/A self _get_appservice_user_id N/A request args N/A user_id N/A N/A N/A request authenticated_entity user_id N/A N/A N/A defer returnValue N/A Requester N/A N/A UserID from_string user_id False N/A access_token N/A N/A N/A request args N/A access_token N/A 0 N/A user_info N/A N/A N/A self get_user_by_access_token access_token N/A user N/A user_info N/A user N/A token_id N/A user_info N/A token_id N/A is_guest N/A user_info N/A is_guest N/A ip_addr N/A N/A N/A self hs get_ip_from_request request N/A user_agent N/A N/A N/A N/A request requestHeaders getRawHeaders User-Agent default N/A N/A 0 N/A N/A user access_token ip_addr N/A N/A N/A preserve_context_over_fn N/A N/A self store insert_client_ip user user access_token access_token ip ip_addr user_agent user_agent N/A N/A is_guest N/A allow_guest N/A N/A N/A AuthError 403 Guest access not allowed errcode N/A Codes GUEST_ACCESS_FORBIDDEN N/A N/A request authenticated_entity N/A N/A user to_string N/A N/A N/A defer returnValue N/A Requester user token_id is_guest N/A N/A N/A KeyError N/A N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS Missing access token. errcode N/A Codes MISSING_TOKEN N/A N/A defer inlineCallbacks _get_appservice_user_id N/A N/A self request_args N/A N/A N/A app_service N/A N/A N/A N/A self store get_app_service_by_token N/A N/A request_args N/A access_token N/A 0 N/A N/A app_service None N/A N/A N/A N/A defer returnValue None N/A N/A user_id request_args N/A N/A N/A N/A defer returnValue N/A app_service sender N/A user_id N/A N/A request_args N/A user_id N/A 0 N/A N/A N/A app_service sender user_id N/A N/A N/A N/A defer returnValue N/A app_service sender N/A N/A N/A N/A app_service is_interested_in_user user_id N/A N/A N/A AuthError 403 Application service cannot masquerade as this user. N/A N/A N/A N/A N/A N/A self store get_user_by_id user_id N/A N/A N/A AuthError 403 Application service has not registered this user N/A N/A N/A defer returnValue user_id N/A N/A defer inlineCallbacks get_user_by_access_token N/A N/A self token N/A N/A N/A  Get a registered user's ID.

        Args:
            token (str): The access token to get the user by.
        Returns:
            dict : dict that includes the user and the ID of their access token.
        Raises:
            AuthError if no user by that token exists or the token is invalid.
         N/A N/A N/A ret N/A N/A N/A self get_user_from_macaroon token N/A N/A N/A AuthError N/A N/A ret N/A N/A N/A self _look_up_user_by_access_token token N/A N/A N/A defer returnValue ret N/A N/A defer inlineCallbacks get_user_from_macaroon N/A N/A self macaroon_str N/A N/A N/A N/A N/A macaroon N/A N/A N/A pymacaroons Macaroon deserialize macaroon_str N/A N/A N/A self validate_macaroon macaroon access False N/A user_prefix user_id =  N/A user None N/A guest False N/A caveat N/A macaroon caveats N/A N/A N/A N/A N/A caveat caveat_id startswith user_prefix N/A N/A user N/A N/A UserID from_string N/A N/A caveat caveat_id N/A N/A len user_prefix N/A N/A N/A N/A caveat caveat_id guest = true N/A N/A guest True N/A N/A user None N/A N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS No user caveat in macaroon errcode N/A Codes UNKNOWN_TOKEN N/A guest N/A N/A ret N/A user is_guest token_id user True None N/A N/A ret N/A N/A N/A self _look_up_user_by_access_token macaroon_str N/A N/A N/A ret N/A user user N/A N/A N/A N/A logger error Macaroon user (%s) != DB user (%s) user N/A ret N/A user N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS User mismatch in macaroon errcode N/A Codes UNKNOWN_TOKEN N/A N/A N/A defer returnValue ret N/A N/A N/A N/A N/A N/A pymacaroons exceptions MacaroonException TypeError ValueError N/A N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS Invalid macaroon passed. errcode N/A Codes UNKNOWN_TOKEN N/A N/A defer inlineCallbacks validate_macaroon N/A N/A self macaroon type_string verify_expiry N/A N/A N/A 
        validate that a Macaroon is understood by and was signed by this server.

        Args:
            macaroon(pymacaroons.Macaroon): The macaroon to validate
            type_string(str): The kind of token this is (e.g. "access", "refresh")
            verify_expiry(bool): Whether to verify whether the macaroon has expired.
                This should really always be True, but no clients currently implement
                token refresh, so we can't enforce expiry yet.
         N/A v N/A N/A pymacaroons Verifier N/A N/A N/A v satisfy_exact gen = 1 N/A N/A N/A v satisfy_exact N/A type =  type_string N/A N/A N/A v satisfy_general N/A N/A N/A c N/A N/A N/A c startswith user_id =  N/A N/A N/A v satisfy_exact guest = true N/A verify_expiry N/A N/A N/A N/A v satisfy_general N/A self _verify_expiry N/A N/A N/A N/A v satisfy_general N/A N/A N/A c N/A N/A N/A c startswith time <  N/A N/A N/A v verify macaroon N/A N/A N/A self hs config macaroon_secret_key N/A v N/A N/A pymacaroons Verifier N/A N/A N/A v satisfy_general N/A self _verify_recognizes_caveats N/A N/A N/A v verify macaroon N/A N/A N/A self hs config macaroon_secret_key N/A _verify_expiry N/A N/A self caveat N/A N/A N/A prefix time <  N/A N/A N/A N/A caveat startswith prefix N/A N/A False N/A expiry N/A int N/A caveat N/A N/A len prefix N/A now N/A N/A N/A N/A N/A self hs get_clock time_msec N/A N/A now expiry N/A _verify_recognizes_caveats N/A N/A self caveat N/A N/A N/A first_space N/A N/A caveat find N/A N/A first_space 0 N/A N/A False N/A second_space N/A N/A caveat find N/A first_space 1 N/A N/A second_space 0 N/A N/A False N/A N/A N/A caveat N/A N/A second_space 1 N/A self _KNOWN_CAVEAT_PREFIXES N/A _look_up_user_by_access_token N/A N/A self token N/A N/A N/A ret N/A N/A N/A N/A self store get_user_by_access_token token N/A N/A ret N/A N/A N/A N/A logger warn N/A Unrecognised access token - not in store: %s N/A token N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS Unrecognised access token. errcode N/A Codes UNKNOWN_TOKEN N/A user_info N/A user token_id is_guest N/A N/A UserID from_string N/A N/A ret get name N/A N/A ret get token_id None False N/A N/A N/A defer returnValue user_info N/A N/A defer inlineCallbacks get_appservice_by_req N/A N/A self request N/A N/A N/A N/A N/A token N/A N/A N/A request args N/A access_token N/A 0 N/A service N/A N/A N/A N/A self store get_app_service_by_token token N/A N/A service N/A N/A N/A N/A logger warn N/A Unrecognised appservice access token: %s N/A token N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS Unrecognised access token. errcode N/A Codes UNKNOWN_TOKEN N/A N/A request authenticated_entity N/A service sender N/A N/A N/A defer returnValue service N/A N/A N/A KeyError N/A N/A N/A AuthError N/A self TOKEN_NOT_FOUND_HTTP_STATUS Missing access token. N/A N/A defer inlineCallbacks is_server_admin N/A N/A self user N/A N/A N/A N/A N/A N/A self store is_server_admin user N/A add_auth_events N/A N/A self builder context N/A N/A N/A auth_ids N/A N/A self compute_auth_events builder N/A context current_state N/A auth_events_entries N/A N/A N/A N/A self store add_event_hashes auth_ids N/A N/A builder auth_events auth_events_entries N/A N/A defer inlineCallbacks compute_auth_events N/A N/A self event current_state N/A N/A N/A N/A N/A event type N/A EventTypes Create N/A N/A N/A N/A auth_ids N/A N/A key N/A N/A EventTypes PowerLevels N/A power_level_event N/A N/A current_state get key N/A power_level_event N/A N/A N/A N/A auth_ids append N/A power_level_event event_id N/A key N/A N/A EventTypes JoinRules N/A join_rule_event N/A N/A current_state get key N/A key N/A N/A EventTypes Member N/A event user_id N/A member_event N/A N/A current_state get key N/A key N/A N/A EventTypes Create N/A create_event N/A N/A current_state get key N/A create_event N/A N/A N/A N/A auth_ids append N/A create_event event_id N/A join_rule_event N/A N/A join_rule N/A N/A N/A join_rule_event content get join_rule N/A is_public N/A join_rule N/A join_rule N/A JoinRules PUBLIC False N/A N/A is_public False N/A N/A N/A event type N/A EventTypes Member N/A N/A e_type N/A N/A event content N/A membership N/A N/A e_type N/A N/A Membership JOIN N/A Membership INVITE N/A N/A join_rule_event N/A N/A N/A N/A auth_ids append N/A join_rule_event event_id N/A N/A e_type N/A Membership JOIN N/A N/A N/A member_event N/A is_public N/A N/A N/A N/A auth_ids append N/A member_event event_id N/A N/A member_event N/A N/A N/A N/A auth_ids append N/A member_event event_id N/A N/A e_type N/A Membership INVITE N/A N/A N/A third_party_invite N/A event content N/A N/A key N/A N/A EventTypes ThirdPartyInvite N/A N/A N/A N/A event content N/A third_party_invite N/A signed N/A token N/A third_party_invite N/A N/A current_state get key N/A third_party_invite N/A N/A N/A N/A auth_ids append N/A third_party_invite event_id N/A N/A member_event N/A N/A N/A N/A N/A member_event content N/A membership N/A Membership JOIN N/A N/A N/A N/A auth_ids append N/A member_event event_id N/A auth_ids N/A _get_send_level N/A N/A self etype state_key auth_events N/A N/A N/A key N/A N/A EventTypes PowerLevels N/A send_level_event N/A N/A auth_events get key N/A send_level None N/A send_level_event N/A N/A send_level N/A N/A N/A N/A N/A send_level_event content get events N/A get etype N/A N/A send_level None N/A N/A N/A state_key None N/A N/A send_level N/A N/A N/A send_level_event content get state_default 50 N/A N/A send_level N/A N/A N/A send_level_event content get events_default 0 N/A send_level N/A N/A send_level N/A int send_level N/A N/A send_level 0 N/A send_level N/A _can_send_event N/A N/A self event auth_events N/A N/A N/A send_level N/A N/A self _get_send_level N/A event type N/A N/A event get state_key None auth_events N/A user_level N/A N/A self _get_user_power_level N/A event user_id auth_events N/A N/A user_level send_level N/A N/A N/A AuthError 403 N/A You don't have permission to post that to the room.  N/A user_level (%d) < send_level (%d) N/A user_level send_level N/A N/A hasattr event state_key N/A N/A N/A N/A N/A event state_key startswith @ N/A N/A N/A N/A event state_key N/A event user_id N/A N/A N/A AuthError 403 You are not allowed to set others state N/A N/A sender_domain N/A N/A N/A UserID from_string N/A event user_id domain N/A N/A sender_domain N/A event state_key N/A N/A N/A AuthError 403 You are not allowed to set others state N/A True N/A log_function check_redaction N/A N/A self event auth_events N/A N/A N/A Check whether the event sender is allowed to redact the target event.

        Returns:
            True if the the sender is allowed to redact the target event if the
            target event was created by them.
            False if the sender is allowed to redact the target event with no
            further checks.

        Raises:
            AuthError if the event sender is definitely not allowed to redact
            the target event.
         N/A user_level N/A N/A self _get_user_power_level N/A event user_id auth_events N/A redact_level N/A N/A self _get_named_level auth_events redact 50 N/A N/A user_level redact_level N/A N/A False N/A redacter_domain N/A N/A N/A EventID from_string N/A event event_id domain N/A redactee_domain N/A N/A N/A EventID from_string N/A event redacts domain N/A N/A redacter_domain redactee_domain N/A N/A True N/A N/A AuthError 403 You don't have permission to redact events N/A _check_power_levels N/A N/A self event auth_events N/A N/A N/A user_list N/A N/A N/A event content get users N/A N/A N/A k v N/A N/A user_list items N/A N/A N/A N/A N/A N/A UserID from_string k N/A N/A N/A N/A N/A SynapseError 400 N/A Not a valid user_id: %s N/A k N/A N/A N/A N/A int v N/A N/A N/A N/A N/A SynapseError 400 N/A Not a valid power level: %s N/A v N/A key N/A N/A event type N/A event state_key N/A current_state N/A N/A auth_events get key N/A N/A current_state N/A N/A N/A user_level N/A N/A self _get_user_power_level N/A event user_id auth_events N/A levels_to_check N/A N/A users_default None N/A events_default None N/A state_default None N/A ban None N/A redact None N/A kick None N/A invite None N/A old_list N/A N/A N/A current_state content get users N/A user N/A set N/A N/A N/A old_list keys N/A N/A user_list keys N/A N/A N/A N/A levels_to_check append N/A user users N/A old_list N/A N/A N/A current_state content get events N/A new_list N/A N/A N/A event content get events N/A ev_id N/A set N/A N/A N/A old_list keys N/A N/A new_list keys N/A N/A N/A N/A levels_to_check append N/A ev_id events N/A old_state N/A current_state content N/A new_state N/A event content N/A N/A level_to_check dir levels_to_check N/A N/A old_loc old_state N/A new_loc new_state N/A dir N/A N/A old_loc N/A N/A old_loc get dir N/A N/A new_loc N/A N/A new_loc get dir N/A N/A N/A level_to_check old_loc N/A N/A old_level N/A int N/A old_loc N/A level_to_check N/A N/A old_level None N/A N/A level_to_check new_loc N/A N/A new_level N/A int N/A new_loc N/A level_to_check N/A N/A new_level None N/A N/A N/A new_level None N/A old_level None N/A N/A N/A new_level old_level N/A N/A N/A N/A N/A dir users N/A level_to_check N/A event user_id N/A N/A N/A old_level user_level N/A N/A N/A AuthError 403 You don't have permission to remove ops level equal to your own N/A N/A N/A old_level user_level N/A new_level user_level N/A N/A N/A AuthError 403 You don't have permission to add ops level greater than your own N/A check_can_change_room_list N/A N/A self room_id user N/A N/A N/A Check if the user is allowed to edit the room's entry in the
        published room list.

        Args:
            room_id (str)
            user (UserID)
         N/A is_admin N/A N/A N/A self is_server_admin user N/A is_admin N/A N/A N/A N/A defer returnValue True N/A user_id N/A N/A user to_string N/A N/A N/A N/A self check_joined_room room_id user_id N/A power_level_event N/A N/A N/A N/A self state get_current_state room_id N/A EventTypes PowerLevels N/A auth_events N/A N/A power_level_event N/A N/A N/A auth_events N/A N/A N/A EventTypes PowerLevels power_level_event N/A send_level N/A N/A self _get_send_level N/A EventTypes Aliases auth_events N/A user_level N/A N/A self _get_user_power_level user_id auth_events N/A N/A user_level send_level N/A N/A N/A AuthError 403 This server requires you to be a moderator in the room to edit its room list entry N/A N/A defer inlineCallbacks N/A