Module Import alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Return CompareEq AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad vararg kwarg body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore AttributeLoad NameLoad attr Return BinOpBitAnd Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg body Expr Str Assign NameStore AttributeLoad NameLoad attr Return BinOpBitAnd Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Lambda arguments args NameParam defaults Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad If CompareIs NameLoad NameLoad body For NameStore NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot NameLoad NameLoad body Break If CompareIs NameLoad NameLoad body Expr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Return Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Assign NameStore Str Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If BoolOpAnd CompareIsNot NameLoad NameLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr CompareEq AttributeLoad NameLoad attr NameLoad attr Num attr body Raise Call NameLoad Call NameLoad Str If CompareIs NameLoad NameLoad body Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num orelse If BoolOpAnd CompareIs Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad CompareIn NameLoad ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr Num NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num orelse Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad orelse Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Return BoolOpOr SubscriptLoad SubscriptLoad Call AttributeLoad Call AttributeLoad NameLoad attr Call AttributeLoad BinOpAdd Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Num attr Str attr Index Num Index Num Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Dict AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad NameLoad attr NameLoad attr CompareGt AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad TupleLoad CompareGt AttributeLoad NameLoad attr NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr ListLoad TupleLoad CompareGt AttributeLoad NameLoad attr NameLoad BinOpAdd AttributeLoad NameLoad attr NameLoad keyword AttributeLoad NameLoad attr attr BinOpBitAnd CompareEq AttributeLoad NameLoad attr NameLoad BinOpBitOr CompareGt AttributeLoad NameLoad attr NameLoad CompareGt AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr UnaryOpUSub NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If BoolOpOr CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore NameLoad Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore NameLoad orelse If BoolOpOr CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If NameLoad body Assign NameStore Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr CompareEq AttributeLoad NameLoad attr NameLoad attr orelse Raise Call NameLoad BinOpMod Call NameLoad Str NameLoad Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore Num If NameLoad body Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Return TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Str decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpMod Str Dict Str Str Str Str Str Str Str Str Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr BoolOpOr BoolOpAnd CompareIs NameLoad NameLoad Str Str Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore BinOpSub NameLoad Num Assign NameStore ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Num NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str If CompareEq NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If Call AttributeLoad NameLoad attr body If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore BinOpSub NameLoad Num Assign NameStore NameLoad orelse If CompareEq NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Assign NameStore BinOpAdd NameLoad Num orelse Raise Call NameLoad BinOpMod Call NameLoad Str NameLoad Expr Call AttributeLoad NameLoad attr Num NameLoad NameLoad If CompareGt NameLoad NameLoad body Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareGt NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad NameLoad body Return Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore Num orelse Assign NameStore NameLoad Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore Num orelse If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareGt NameLoad NameLoad body Assign NameStore NameLoad Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore Num orelse Assign NameStore Call AttributeLoad NameLoad attr If CompareEq NameLoad NameLoad body Return Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore TupleLoad NameLoad NameLoad Assign NameStore Num orelse Raise Call NameLoad BinOpMod Call NameLoad Str NameLoad Assign NameStore BinOpMod Str Dict Str Str Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr If BoolOpOr CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str orelse If CompareLtLt NameLoad NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareGt NameLoad NameLoad body Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore NameLoad Assign NameStore BinOpSub BinOpAdd NameLoad NameLoad Num orelse If CompareGt NameLoad NameLoad body Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore NameLoad orelse Assign NameStore BinOpAdd NameLoad Num Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore BinOpSub BinOpSub NameLoad NameLoad Num Assign NameStore NameLoad orelse If BoolOpOr CompareEq NameLoad AttributeLoad NameLoad attr CompareEq NameLoad AttributeLoad NameLoad attr body If CompareEq NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str orelse If CompareLtLt NameLoad NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str If CompareEq NameLoad AttributeLoad NameLoad attr body If CompareGt NameLoad NameLoad body Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore BinOpSub NameLoad Num orelse Assign NameStore NameLoad Assign NameStore BinOpSub BinOpAdd NameLoad NameLoad Num orelse If CompareGt NameLoad NameLoad body Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num Assign NameStore NameLoad orelse Assign NameStore BinOpAdd NameLoad Num Assign NameStore BinOpAdd NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr orelse Raise Call NameLoad BinOpMod Call NameLoad Str NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpSub NameLoad NameLoad Assign NameStore NameLoad If CompareGt NameLoad Num body Assign NameStore UnaryOpUSub NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str Dict Str Str Str Str Str Str Str Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd BinOpSub NameLoad NameLoad Num If CompareEq NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str orelse If CompareEq NameLoad NameLoad body Raise Call NameLoad Call NameLoad Str Assign TupleStore NameStore NameStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpMod Str Dict Str Str Str Str Str Str Str Call NameLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr attr Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ListLoad NameLoad NameLoad NameLoad NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr BinOpSub NameLoad NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpAdd NameLoad BinOpMult SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr body Assign ListStore NameStore NameLoad Expr Call AttributeLoad Call AttributeLoad Call AttributeLoad NameLoad attr CompareEq AttributeLoad NameLoad attr NameLoad attr Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A sqlalchemy TreeClassManager N/A object N/A N/A Node class manager, which handles tree-wide operations such as insertion,
  deletion, and moving nodes around. No need to create it by hand: it is
  created by :class:``TreeManager``.

  :param node_class:
    class which was mapped to tree table.
  :param options:
    instance of :class:``TreeOptions``
   __init__ N/A N/A self node_class options N/A N/A N/A N/A self _tree_options options N/A N/A self _node_class node_class N/A __clause_element__ N/A N/A self N/A N/A N/A Allows to use instances of ``TreeClassManager`` directly as argument
    for ``sqlalchemy.orm.Query.order_by()`` to efficiently order a query into
    preorder traversal ordering (sort by first ``tree_id`` and then ``left``
    fields). Can be used like this (assume that :class:``TreeManager`` is
    attached to class ``Node`` and named ``'tree'``)::

      query = root.query_children()
      query.order_by(Node.tree)
     N/A N/A N/A N/A self _tree_options order_by_clause N/A filter_root_nodes N/A N/A self N/A N/A N/A Get a filter condition for all root nodes. N/A options N/A self _tree_options N/A N/A N/A options left_field 1 N/A query_root_nodes N/A N/A self session N/A None args kwargs N/A N/A Convenience method that gets a query for all root nodes using
    ``filter_root_nodes`` and the session associated with this node. The
    session must be passed explicitly if called from a class manager. N/A N/A session None N/A N/A session N/A N/A N/A sqlalchemy orm object_session N/A N/A self _get_obj N/A N/A N/A N/A N/A session query N/A self _node_class filter N/A N/A self filter_root_nodes args kwargs N/A filter_root_node_by_tree_id N/A N/A self N/A args N/A N/A Get a filter condition returning root nodes of the tree specified
    through the positional arguments (interpreted as tree ids). N/A options N/A self _tree_options N/A N/A N/A N/A self filter_root_nodes N/A N/A N/A options tree_id_field in_ args N/A query_root_node_by_tree_id N/A N/A self N/A args kwargs N/A N/A Returns the root nodes of the trees specified through the positional
    arguments (interpreted as tree ids) using ``filter_root_node_by_tree_id``
    and the session associated with this node. The session must be passed
    explicitly if called from a class manager. N/A session N/A N/A kwargs pop session None N/A N/A session None N/A N/A session N/A N/A N/A sqlalchemy orm object_session N/A N/A self _get_obj N/A N/A N/A N/A N/A session query N/A self _node_class filter N/A N/A self filter_root_node_by_tree_id args kwargs N/A filter_root_node_of_node N/A N/A self N/A args N/A N/A Get a filter condition returning the root nodes of the trees which
    include the passed-in nodes. N/A options N/A self _tree_options N/A N/A N/A N/A self filter_root_nodes N/A N/A N/A options tree_id_field in_ N/A map N/A N/A N/A n N/A N/A getattr n N/A N/A options tree_id_field name args N/A query_root_node_of_node N/A N/A self N/A args kwargs N/A N/A Returns the root nodes of the trees which contain the passed in nodes,
    using ``filter_root_node_by_tree_id``. The session used to perform the
    query is either a) the session explicitly passed in, b) the session
    associated with the first bound positional parameter, or c) the session
    associated with the instance manager's node. N/A session N/A N/A kwargs pop session None N/A N/A session None N/A N/A node args N/A N/A session N/A N/A N/A sqlalchemy orm object_session node N/A N/A session None N/A N/A N/A N/A session None N/A N/A session N/A session N/A N/A N/A sqlalchemy orm object_session N/A N/A self _get_obj N/A N/A N/A N/A N/A session query N/A self _node_class filter N/A N/A self filter_root_node_of_node args kwargs N/A N/A POSITION_LEFT left N/A POSITION_RIGHT right N/A POSITION_FIRST_CHILD first-child N/A POSITION_LAST_CHILD last-child insert_node N/A N/A self node target position session N/A None POSITION_LAST_CHILD None N/A N/A Sets up the tree state (``tree_id``, ``left``, ``right`` and ``depth``)
    for ``node`` (which has not yet been inserted into in the database) so it
    will be positioned relative to a given ``target`` node in the manner
    specified by ``position``, with any necessary space already having been
    made for it.

    A ``target`` of ``None`` indicates that ``node`` should become the last
    root node, which is a constant-time insertion operation. (Positioning root
    nodes with respect to other root nodes can be accomplished by using the
    ``POSITION_LEFT`` or ``POSITION_RIGHT`` constants and specifying the
    neighboring root node as ``target``)

    Accepted values for ``position`` are ``POSITION_FIRST_CHILD``,
    ``POSITION_LAST_CHILD``, ``POSITION_LEFT`` or ``POSITION_RIGHT``.
    ``POSITION_LAST_CHILD`` is likely to cause the least number of row
    updates, so therefore it is the default behavior if ``position`` is not
    specified.

    .. note::
      This is a low-level method; and naturally does NOT respect
      ``TreeOptions.order_insertion_by``. In most cases you should just set
      the node's parent and let this library call handle the details of
      insertion during the database flush.
     N/A options N/A self _tree_options N/A N/A session None N/A N/A N/A target None N/A N/A session N/A N/A N/A sqlalchemy orm object_session target N/A N/A session N/A N/A N/A sqlalchemy orm object_session node N/A pk N/A getattr node N/A N/A options pk_field name N/A N/A N/A pk None N/A N/A N/A N/A N/A N/A N/A N/A session query N/A self _node_class filter N/A N/A options pk_field pk limit 1 count N/A N/A N/A ValueError N/A _ cannot insert a node which has already been saved; use move_node() instead N/A N/A target None N/A N/A N/A setattr node N/A N/A options parent_id_field name None N/A N/A setattr node N/A N/A options tree_id_field name N/A N/A self _get_next_tree_id session N/A N/A setattr node N/A N/A options left_field name 1 N/A N/A setattr node N/A N/A options right_field name 2 N/A N/A setattr node N/A N/A options depth_field name 0 N/A N/A N/A N/A N/A getattr target N/A N/A options parent_id_field name None N/A position N/A N/A self POSITION_LEFT N/A self POSITION_RIGHT N/A N/A target_tree_id N/A getattr target N/A N/A options tree_id_field name N/A N/A position N/A self POSITION_LEFT N/A N/A node_tree_id target_tree_id N/A target_tree_id N/A target_tree_id 1 N/A N/A node_tree_id N/A target_tree_id 1 N/A N/A N/A self _manage_tree_gap 1 target_tree_id session N/A N/A setattr node N/A N/A options parent_id_field name None N/A N/A setattr node N/A N/A options tree_id_field name node_tree_id N/A N/A setattr node N/A N/A options left_field name 1 N/A N/A setattr node N/A N/A options right_field name 2 N/A N/A setattr node N/A N/A options depth_field name 0 N/A N/A N/A setattr node N/A N/A options left_field name 0 N/A N/A setattr node N/A N/A options right_field name 1 N/A N/A setattr node N/A N/A options depth_field name 0 N/A N/A gap_target depth left parent right_shift N/A N/A self _calculate_inter_tree_move_values node target position session N/A N/A parent None N/A N/A parent_id None N/A tree_id None N/A N/A parent_id N/A getattr parent N/A N/A options pk_field name N/A tree_id N/A getattr parent N/A N/A options tree_id_field name N/A N/A N/A self _create_gap right_shift gap_target tree_id session N/A N/A setattr node N/A N/A options left_field name left N/A N/A setattr node N/A N/A options right_field name N/A left 1 N/A N/A setattr node N/A N/A options depth_field name depth N/A N/A setattr node N/A N/A options tree_id_field name tree_id N/A N/A setattr node N/A N/A options parent_id_field name parent_id N/A _get_next_tree_id N/A N/A self session N/A N/A N/A Determines the next largest unused tree id for the tree managed by this
    manager. N/A options N/A self _tree_options N/A N/A N/A N/A N/A N/A N/A N/A session query N/A N/A N/A N/A N/A N/A sqlalchemy func max N/A options tree_id_field 1 label tree_id all N/A 0 N/A 0 1 N/A _manage_tree_gap N/A N/A self size target_tree_id session N/A N/A N/A Creates space for a new tree *after* the target by incrementing all
    tree id's greater than ``target_tree_id``. N/A options N/A self _tree_options N/A expr N/A N/A N/A N/A N/A N/A N/A options table update values N/A N/A N/A options tree_id_field name N/A N/A options tree_id_field size where N/A N/A options tree_id_field target_tree_id N/A N/A N/A session execute expr N/A _manage_space N/A N/A self size target tree_id session N/A N/A N/A Manages spaces in the tree identified by ``tree_id`` by changing the
    values of the left and right columns by ``size`` after the given
    ``target`` point. N/A options N/A self _tree_options N/A expr N/A N/A N/A N/A N/A N/A N/A options table update values N/A N/A options left_field N/A options right_field N/A N/A sqlalchemy case N/A N/A N/A N/A options left_field target N/A N/A options left_field size else_ N/A options left_field N/A N/A sqlalchemy case N/A N/A N/A N/A options right_field target N/A N/A options right_field size else_ N/A options right_field where N/A N/A N/A options tree_id_field tree_id N/A N/A N/A options left_field target N/A N/A options right_field target N/A N/A N/A session execute expr N/A _create_gap N/A N/A self size target tree_id session N/A N/A N/A Creates a space of a certain ``size`` after the given ``target`` point
    in the tree identified by ``tree_id``. N/A N/A N/A self _manage_space size target tree_id session N/A _close_gap N/A N/A self size target tree_id session N/A N/A N/A Closes a gap of a certain ``size`` after the given ``target`` point in
    the tree identified by ``tree_id``. N/A N/A N/A self _manage_space N/A size target tree_id session N/A _calculate_inter_tree_move_values N/A N/A self node target position session N/A N/A N/A Calculates values required when moving ``node`` relative to ``target``
    as specified by ``position`` (one of ``left``, ``right``, ``first-child``
    or ``last-child``). N/A options N/A self _tree_options N/A node_left N/A getattr node N/A N/A options left_field name N/A node_right N/A getattr node N/A N/A options right_field name N/A node_depth N/A getattr node N/A N/A options depth_field name N/A target_left N/A getattr target N/A N/A options left_field name N/A target_right N/A getattr target N/A N/A options right_field name N/A target_depth N/A getattr target N/A N/A options depth_field name N/A N/A N/A position N/A self POSITION_LAST_CHILD N/A position N/A self POSITION_FIRST_CHILD N/A N/A N/A position N/A self POSITION_LAST_CHILD N/A N/A gap_target N/A target_right 1 N/A N/A gap_target target_left N/A depth_change N/A N/A target_depth node_depth 1 N/A parent target N/A N/A N/A N/A position N/A self POSITION_LEFT N/A position N/A self POSITION_RIGHT N/A N/A N/A position N/A self POSITION_LEFT N/A N/A gap_target N/A target_left 1 N/A N/A gap_target target_right N/A depth_change N/A target_depth node_depth N/A parent N/A getattr target N/A N/A options parent_id_field name N/A parent N/A N/A parent N/A N/A N/A N/A N/A N/A session query N/A self _node_class filter N/A N/A options pk_field parent one N/A N/A N/A ValueError N/A N/A _ an invalid position was given: %s position N/A left_right_change N/A N/A gap_target node_left 1 N/A right_shift 0 N/A parent N/A N/A right_shift N/A N/A node_right node_left 1 N/A N/A gap_target depth_change left_right_change parent right_shift N/A move_node N/A N/A self node target position session N/A POSITION_LAST_CHILD None N/A N/A Moves ``node`` relative to a given ``target`` node as specified by
    ``position`` (when appropriate), by examining both nodes and calling the
    appropriate method to perform the move.

    A ``target`` of ``None`` indicates that ``node`` should be turned into a
    root node.

    Valid values for ``position`` are ``POSITION_LEFT``, ``POSITION_RIGHT``,
    ``POSITION_FIRST_CHILD`` or ``POSITION_LAST_CHILD``.

    ``node`` will be modified to reflect its new tree state in the database.
    Depending on the type of the move, a good many other nodes might be
    modified as well.

    This method explicitly checks for ``node`` being made a sibling of a root
    node, as this is a special case due to our use of tree ids to order root
    nodes.

    .. note::
      This is a low-level method; it does NOT respect
      ``MPTTMeta.order_insertion_by``. In most cases you should just move the
      node yourself by setting node.parent.
     N/A N/A session None N/A N/A session N/A N/A N/A sqlalchemy orm object_session node N/A 
    if target is None:
      if node.is_child_node():
          self._make_child_root_node(node)
    elif target.is_root_node() and          position in [self.POSITION_LEFT, self.POSITION_RIGHT]:
      self._make_sibling_of_root_node(node, target, position)
    else:
      if node.is_root_node():
        self._move_root_node(node, target, position)
      else:
        self._move_child_node(node, target, position)
     N/A _inter_tree_move_and_close_gap N/A N/A self node depth_change left_right_change new_tree_id parent_pk N/A None N/A N/A Removes ``node`` from its current tree, with the given set of changes
    being applied to ``node`` and its descendants, closing the gap left by
    moving ``node`` as it does so.

    If ``parent_pk`` is ``None``, this indicates that ``node`` is being moved
    to a brand new tree as its root node, and will thus have its parent field
    set to ``NULL``. Otherwise, ``node`` will have ``parent_pk`` set for its
    parent field. N/A options N/A self _tree_options N/A inter_tree_move_query N/A 
    UPDATE %(table)s
    SET %(level)s = CASE
        WHEN %(left)s >= %%s AND %(left)s <= %%s
          THEN %(level)s - %%s
        ELSE %(level)s END,
      %(tree_id)s = CASE
        WHEN %(left)s >= %%s AND %(left)s <= %%s
          THEN %%s
        ELSE %(tree_id)s END,
      %(left)s = CASE
        WHEN %(left)s >= %%s AND %(left)s <= %%s
          THEN %(left)s - %%s
        WHEN %(left)s > %%s
          THEN %(left)s - %%s
        ELSE %(left)s END,
      %(right)s = CASE
        WHEN %(right)s >= %%s AND %(right)s <= %%s
          THEN %(right)s - %%s
        WHEN %(right)s > %%s
          THEN %(right)s - %%s
        ELSE %(right)s END,
      %(parent)s = CASE
        WHEN %(pk)s = %%s
          THEN %(new_parent)s
        ELSE %(parent)s END
    WHERE %(tree_id)s = %%s N/A table level left tree_id right parent pk new_parent N/A qn N/A N/A N/A self tree_model _meta db_table N/A qn N/A N/A N/A opts get_field N/A N/A options depth_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options left_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options tree_id_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options right_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options parent_id_field name column N/A qn N/A N/A opts pk column N/A N/A N/A parent_pk None NULL %s N/A left N/A getattr node N/A N/A options left_field name N/A right N/A getattr node N/A N/A options right_field name N/A gap_size N/A N/A right left 1 N/A gap_target_left N/A left 1 N/A params N/A left right depth_change left right new_tree_id left right left_right_change gap_target_left gap_size left right left_right_change gap_target_left gap_size N/A node pk N/A getattr node N/A N/A options tree_id_field name N/A N/A parent_pk None N/A N/A N/A N/A params insert -1 parent_pk N/A cursor N/A N/A N/A N/A self _get_connection node cursor N/A N/A N/A cursor execute inter_tree_move_query params N/A _make_child_root_node N/A N/A self node new_tree_id N/A None N/A N/A Removes ``node`` from its tree, making it the root node of a new tree.
    If ``new_tree_id`` is not specified a new tree id will be generated.
    ``node`` will be modified to reflect its new tree state in the
    database. N/A options N/A self _tree_options N/A left N/A getattr node N/A N/A options left_field name N/A right N/A getattr node N/A N/A options right_field name N/A depth N/A getattr node N/A N/A options depth_field name N/A N/A new_tree_id N/A N/A new_tree_id N/A N/A self _get_next_tree_id N/A left_right_change N/A left 1 N/A N/A N/A self _inter_tree_move_and_close_gap node level left_right_change new_tree_id N/A N/A setattr node N/A N/A options left_field name N/A left left_right_change N/A N/A setattr node N/A N/A options right_field name N/A right left_right_change N/A N/A setattr node N/A N/A options depth_field name 0 N/A N/A setattr node N/A N/A options tree_id_field name new_tree_id N/A N/A setattr node N/A N/A options parent_id_field name None N/A N/A N/A node _mptt_cached_fields N/A N/A N/A options parent_id_field name None N/A _make_sibling_of_root_node N/A N/A self node target position N/A N/A N/A Moves ``node``, making it a sibling of the given ``target`` root node
    as specified by ``position``.

    ``node`` will be modified to reflect its new tree state in the database.

    Since we use tree ids to reduce the number of rows affected by tree
    management during insertion and deletion, root nodes are not true
    siblings; thus, making an item a sibling of a root node is a special case
    which involves shuffling tree ids around. N/A N/A node target N/A N/A N/A InvalidMoveError N/A _ A node may not be made a sibling of itself. N/A opts N/A N/A self model _meta N/A tree_id N/A getattr node N/A N/A options tree_id_field name N/A target_tree_id N/A getattr target N/A N/A options tree_id_field name N/A N/A N/A node is_child_node N/A N/A N/A position N/A self POSITION_LEFT N/A N/A gap_target N/A target_tree_id 1 N/A new_tree_id target_tree_id N/A N/A N/A position N/A self POSITION_RIGHT N/A N/A gap_target target_tree_id N/A new_tree_id N/A target_tree_id 1 N/A N/A N/A ValueError N/A N/A _ An invalid position was given: %s. position N/A N/A N/A self _manage_tree_gap 1 gap_target session N/A N/A tree_id gap_target N/A N/A N/A setattr node N/A N/A options tree_id_field name N/A tree_id 1 N/A N/A N/A self _make_child_root_node node new_tree_id N/A N/A N/A position N/A self POSITION_LEFT N/A N/A N/A target_tree_id tree_id N/A N/A left_sibling N/A N/A target get_previous_sibling N/A N/A node left_sibling N/A N/A N/A new_tree_id N/A getattr left_sibling N/A N/A options tree_id_field name N/A N/A lower_bound upper_bound N/A tree_id new_tree_id N/A shift -1 N/A N/A new_tree_id target_tree_id N/A N/A lower_bound upper_bound N/A new_tree_id tree_id N/A shift 1 N/A N/A N/A position N/A self POSITION_RIGHT N/A N/A N/A target_tree_id tree_id N/A N/A new_tree_id target_tree_id N/A N/A lower_bound upper_bound N/A tree_id target_tree_id N/A shift -1 N/A N/A right_sibling N/A N/A target get_next_sibling N/A N/A node right_sibling N/A N/A N/A new_tree_id N/A getattr right_sibling N/A N/A options tree_id_field name N/A N/A lower_bound upper_bound N/A new_tree_id tree_id N/A shift 1 N/A N/A N/A ValueError N/A N/A _ An invalid position was given: %s. position N/A root_sibling_query N/A 
      UPDATE %(table)s
      SET %(tree_id)s = CASE
            WHEN %(tree_id)s = %%s
              THEN %%s
            ELSE %(tree_id)s + %%s END
      WHERE %(tree_id)s >= %%s AND %(tree_id)s <= %%s N/A table tree_id N/A qn N/A N/A N/A self tree_model _meta db_table N/A qn N/A N/A N/A opts get_field N/A N/A options tree_id_field name column N/A cursor N/A N/A N/A N/A self _get_connection node cursor N/A N/A N/A cursor execute root_sibling_query N/A tree_id new_tree_id shift lower_bound upper_bound N/A N/A setattr node N/A N/A options tree_id_field name new_tree_id N/A _move_child_node N/A N/A self node target position N/A N/A N/A Calls the appropriate method to move child node ``node`` relative to
    the given ``target`` node as specified by ``position``. N/A tree_id N/A getattr node N/A N/A options tree_id_field name N/A target_tree_id N/A getattr target N/A N/A options tree_id_field name N/A N/A tree_id target_tree_id N/A N/A N/A N/A self _move_child_within_tree node target position N/A N/A N/A N/A self _move_child_to_new_tree node target position N/A _move_child_to_new_tree N/A N/A self node target position N/A N/A N/A Moves child node ``node`` to a different tree, inserting it relative to
    the given ``target`` node in the new tree as specified by ``position``.

    ``node`` will be modified to reflect its new tree state in the database.
     N/A left N/A getattr node N/A N/A options left_field name N/A right N/A getattr node N/A N/A options right_field name N/A depth N/A getattr node N/A N/A options depth_field name N/A new_tree_id N/A getattr target N/A N/A options tree_id_field name N/A N/A gap_target depth_change left_right_change parent new_parent_right N/A N/A self _calculate_inter_tree_move_values node target position session N/A tree_width N/A N/A right left 1 N/A N/A N/A self _create_gap tree_width gap_target new_tree_id session N/A N/A N/A self _inter_tree_move_and_close_gap node depth_change left_right_change new_tree_id N/A parent pk N/A N/A setattr node N/A N/A options left_field name N/A left left_right_change N/A N/A setattr node N/A N/A options right_field name N/A right left_right_change N/A N/A setattr node N/A N/A options depth_field name N/A depth depth_change N/A N/A setattr node N/A N/A options tree_id_field name new_tree_id N/A N/A setattr node N/A N/A options parent_id_field name parent N/A N/A N/A node _mptt_cached_fields N/A N/A N/A options parent_id_field name N/A parent pk N/A _move_child_within_tree N/A N/A self node target position N/A N/A N/A Moves child node ``node`` within its current tree relative to the given
    ``target`` node as specified by ``position``.

    ``node`` will be modified to reflect its new tree state in the database.
     N/A left N/A getattr node N/A N/A options left_field name N/A right N/A getattr node N/A N/A options right_field name N/A depth N/A getattr node N/A N/A options depth_field name N/A width N/A N/A right left 1 N/A tree_id N/A getattr node N/A N/A options tree_id_field name N/A target_left N/A getattr target N/A N/A options left_field name N/A target_right N/A getattr target N/A N/A options right_field name N/A target_depth N/A getattr target N/A N/A options depth_field name N/A N/A N/A position N/A self POSITION_LAST_CHILD N/A position N/A self POSITION_RIGHT N/A N/A N/A node target N/A N/A N/A InvalidMoveError N/A _ A node may not be made a child of itself. N/A N/A N/A left target_left right N/A N/A N/A InvalidMoveError N/A _ A node may not be made a child of any of its descendants. N/A N/A position N/A self POSITION_LAST_CHILD N/A N/A N/A target_right right N/A N/A new_left N/A target_right width N/A new_right N/A target_right 1 N/A N/A new_left target_right N/A new_right N/A N/A target_right width 1 N/A N/A N/A target_left left N/A N/A new_left N/A N/A target_left width 1 N/A new_right target_left N/A N/A new_left N/A target_left 1 N/A new_right N/A target_left width N/A depth_change N/A N/A depth target_depth 1 N/A parent target N/A N/A N/A N/A position N/A self POSITION_LEFT N/A position N/A self POSITION_RIGHT N/A N/A N/A node target N/A N/A N/A InvalidMove N/A _ A node may not be made a sibling of itself. N/A N/A N/A left target_left right N/A N/A N/A InvalidMove N/A _ A node may not be made a sibling of any of its descendants. N/A N/A position N/A self POSITION_LEFT N/A N/A N/A target_left left N/A N/A new_left N/A target_left width N/A new_right N/A target_left 1 N/A N/A new_left target_left N/A new_right N/A N/A target_left width 1 N/A N/A N/A target_right right N/A N/A new_left N/A N/A target_right width 1 N/A new_right target_right N/A N/A new_left N/A target_right 1 N/A new_right N/A target_right width N/A depth_change N/A depth target_depth N/A parent N/A getattr target N/A N/A options parent_id_field name N/A N/A N/A ValueError N/A N/A _ An invalid position was given: %s. position N/A left_boundary N/A min left new_left N/A right_boundary N/A max right new_right N/A left_right_change N/A new_left left N/A gap_size width N/A N/A left_right_change 0 N/A N/A gap_size N/A gap_size N/A opts N/A N/A self model _meta N/A move_subtree_query N/A 
    UPDATE %(table)s
    SET %(level)s = CASE
          WHEN %(left)s >= %%s AND %(left)s <= %%s
            THEN %(level)s - %%s
          ELSE %(level)s END,
        %(left)s = CASE
          WHEN %(left)s >= %%s AND %(left)s <= %%s
            THEN %(left)s + %%s
          WHEN %(left)s >= %%s AND %(left)s <= %%s
            THEN %(left)s + %%s
          ELSE %(left)s END,
        %(right)s = CASE
          WHEN %(right)s >= %%s AND %(right)s <= %%s
            THEN %(right)s + %%s
          WHEN %(right)s >= %%s AND %(right)s <= %%s
            THEN %(right)s + %%s
          ELSE %(right)s END,
        %(parent)s = CASE
          WHEN %(pk)s = %%s
            THEN %%s
          ELSE %(parent)s END
    WHERE %(tree_id)s = %%s N/A table level left right parent pk tree_id N/A qn N/A N/A N/A self tree_model _meta db_table N/A qn N/A N/A N/A opts get_field N/A N/A options depth_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options left_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options right_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options parent_id_field name column N/A qn N/A N/A opts pk column N/A qn N/A N/A N/A opts get_field N/A N/A options tree_id_field name column N/A cursor N/A N/A N/A N/A self _get_connection node cursor N/A N/A N/A cursor execute move_subtree_query N/A left right depth_change left right left_right_change left_boundary right_boundary gap_size left right left_right_change left_boundary right_boundary gap_size N/A node pk N/A parent pk tree_id N/A N/A setattr node N/A N/A options left_field name new_left N/A N/A setattr node N/A N/A options right_field name new_right N/A N/A setattr node N/A N/A options depth_field name N/A depth depth_change N/A N/A setattr node N/A N/A options parent_id_field name parent N/A N/A N/A node _mptt_cached_fields N/A N/A N/A options parent_id_field name N/A parent pk N/A _move_root_node N/A N/A self node target position N/A N/A N/A Moves root node``node`` to a different tree, inserting it relative to the given ``target`` node as specified by ``position``.

    ``node`` will be modified to reflect its new tree state in the database.
     N/A left N/A getattr node N/A N/A options left_field name N/A right N/A getattr node N/A N/A options right_field name N/A depth N/A getattr node N/A N/A options depth_field name N/A tree_id N/A getattr node N/A N/A options tree_id_field name N/A new_tree_id N/A getattr target N/A N/A options tree_id_field name N/A width N/A N/A right left 1 N/A N/A node target N/A N/A N/A InvalidMove N/A _ A node may not be made a child of itself. N/A N/A N/A tree_id new_tree_id N/A N/A N/A InvalidMove N/A _ A node may not be made a child of any of its descendants. N/A N/A gap_target depth_change left_right_change parent right_shift N/A N/A self _calculate_inter_tree_move_values node target position session N/A N/A N/A self _create_gap width gap_target new_tree_id session N/A opts N/A N/A self model _meta N/A move_tree_query N/A 
    UPDATE %(table)s
    SET %(level)s   = %(level)s - %%s,
        %(left)s    = %(left)s  - %%s,
        %(right)s   = %(right)s - %%s,
        %(tree_id)s = %%s,
        %(parent)s = CASE
          WHEN %(pk)s = %%s
            THEN %%s
          ELSE %(parent)s END
    WHERE %(left)s >= %%s AND %(left)s <= %%s
      AND %(tree_id)s = %%s N/A table level left right tree_id parent pk N/A qn N/A N/A N/A self tree_model _meta db_table N/A qn N/A N/A N/A opts get_field N/A N/A options depth_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options left_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options right_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options tree_id_field name column N/A qn N/A N/A N/A opts get_field N/A N/A options parent_id_field name column N/A qn N/A N/A opts pk column N/A cursor N/A N/A N/A N/A self _get_connection node cursor N/A N/A N/A cursor execute move_tree_query N/A depth_change left_right_change left_right_change new_tree_id N/A node pk N/A parent pk left right tree_id N/A N/A setattr node N/A N/A options left_field name N/A left left_right_change N/A N/A setattr node N/A N/A options right_field name N/A right left_right_change N/A N/A setattr node N/A N/A options depth_field name N/A depth depth_change N/A N/A setattr node N/A N/A options tree_id_field name new_tree_id N/A N/A setattr node N/A N/A options parent_id_field name parent N/A N/A N/A node _mptt_cached_fields N/A N/A N/A options parent_id_field name N/A parent pk N/A _do_rebuild_subtree N/A N/A self root_node_id root_path root_depth tree_id order_by N/A N/A N/A The main recursive function for rebuilding trees.

    :param root_node_id:
      subtree's root node primary key value.
    :param root_path:
      the pre-calculated path of root node.
    :param root_depth:
      the pre-calculated root node's depth.
    :param tree_id:
      the pre-calculated identifier for this tree.
    :param order_by:
      the children sort order.
     N/A options N/A self _tree_options N/A path N/A root_path N/A N/A ALPHABET N/A 0 N/A options steplen N/A depth N/A root_depth 1 N/A children N/A N/A N/A N/A sqlalchemy select N/A N/A options pk_field N/A N/A options parent_id_field root_node_id order_by order_by N/A query N/A N/A N/A options table update N/A child N/A N/A N/A N/A children execute fetchall N/A N/A N/A child child N/A N/A N/A N/A N/A N/A N/A query where N/A N/A options pk_field child values N/A N/A options path_field N/A options depth_field N/A options tree_id_field path depth tree_id execute N/A N/A N/A self _do_rebuild_subtree child path depth tree_id order_by N/A path N/A inc_path path N/A options steplen N/A N/A