Module Expr Str ImportFrom alias Import alias identifier ImportFrom alias alias Import alias ImportFrom alias alias Import alias ImportFrom alias Assign NameStore Str Assign NameStore ListLoad Str Str Str Str Str Assign NameStore Str Assign NameStore ListLoad Str Str ClassDef bases NameLoad body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Str body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num Assign AttributeStore NameLoad attr ListLoad Num Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If CompareIs AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call NameLoad NameLoad keyword Num keyword Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Num Num AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore AttributeLoad NameLoad attr Assign ListStore SubscriptStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num SubscriptStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad If CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Return TupleLoad NameLoad NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign TupleStore SubscriptStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num SubscriptStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr AttributeStore AttributeLoad AttributeLoad NameLoad attr attr attr TupleLoad Num Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad SubscriptLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num SubscriptLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Index Num AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Return TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list ClassDef bases body Expr Str Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str AugAssignAdd AttributeStore NameLoad attr BinOpDiv NameLoad Num AugAssignAdd AttributeStore NameLoad attr BinOpDiv NameLoad Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str AugAssignMult AttributeStore NameLoad attr AttributeLoad NameLoad attr AugAssignMult AttributeStore NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index Num BinOpDiv BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num AugAssignAdd SubscriptStore AttributeLoad NameLoad attr Index Num BinOpDiv BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num Num body Expr Str If CompareGt NameLoad NameLoad body Assign NameStore NameLoad If CompareLt NameLoad NameLoad body Assign NameStore NameLoad Return NameLoad decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr SubscriptLoad Call NameLoad AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Index Num Assign AttributeStore NameLoad attr SubscriptLoad Call NameLoad AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Index Num Assign AttributeStore NameLoad attr SubscriptLoad Call NameLoad AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Index Num Assign AttributeStore NameLoad attr SubscriptLoad Call NameLoad AttributeLoad NameLoad attr keyword Lambda arguments args NameParam defaults SubscriptLoad NameLoad Index Num Index Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad If CompareGt BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad If CompareLt BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad If CompareGt BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad If CompareLt BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Assign TupleStore NameStore NameStore Call NameLoad Call AttributeLoad NameLoad attr ListLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num Expr Call NameLoad NameLoad NameLoad Assign NameStore NameLoad For NameStore Call NameLoad NameLoad NameLoad body If Call AttributeLoad NameLoad attr NameLoad NameLoad body If NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Assign NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Return ListLoad UnaryOpUSub AttributeLoad NameLoad attr UnaryOpUSub AttributeLoad NameLoad attr Assign NameStore BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num If CompareLt SubscriptLoad NameLoad Index Num Num body Assign NameStore BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpSub Call AttributeLoad NameLoad attr NameLoad NameLoad AttributeLoad NameLoad attr If CompareLt NameLoad Num body AugAssignAdd NameStore BinOpMult Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num NameLoad AugAssignAdd NameStore NameLoad If CompareGt NameLoad BinOpMult Num AttributeLoad NameLoad attr body AugAssignSub NameStore BinOpMult Num AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return ListLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad BinOpMult NameLoad Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareGt NameLoad AttributeLoad NameLoad attr body AugAssignSub NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareGt NameLoad AttributeLoad NameLoad attr body AugAssignSub NameStore AttributeLoad NameLoad attr If CompareLt Call AttributeLoad NameLoad attr BinOpSub NameLoad BinOpDiv AttributeLoad NameLoad attr Num Call AttributeLoad NameLoad attr BinOpSub NameLoad BinOpDiv AttributeLoad NameLoad attr Num body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num If CompareLt NameLoad Num body AugAssignAdd NameStore BinOpMult Num AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Assign NameStore BinOpSub Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad Num body Assign NameStore Num orelse If CompareLt NameLoad Num body Assign NameStore Num Assign NameStore BinOpAdd SubscriptLoad NameLoad Index Num BinOpMult NameLoad NameLoad Assign NameStore BinOpSub AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareLtE NameLoad BinOpMult AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If CompareGt NameLoad AttributeLoad NameLoad attr body Assign NameStore BinOpSub BinOpMult Num AttributeLoad NameLoad attr NameLoad If CompareGt NameLoad BinOpDiv AttributeLoad NameLoad attr Num body Return NameLoad Return NameLoad orelse Return NameLoad decorator_list decorator_list ClassDef bases body Expr Str Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num Assign NameStore Num FunctionDef arguments args NameParam NameParam NameParam defaults Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num TupleLoad Num Num Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Num Assign NameStore Num Assign NameStore ListLoad With Call NameLoad NameLoad NameStore body For NameStore Call AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr attr If UnaryOpNot Call NameLoad NameLoad body Continue orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad Call NameLoad BinOpMult ListLoad Call NameLoad Call NameLoad NameLoad SubscriptLoad NameLoad Slice Num Num orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign AttributeStore NameLoad attr ListLoad Call NameLoad SubscriptLoad NameLoad Index Num Call NameLoad SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore Call NameLoad BinOpMult ListLoad Call NameLoad Call NameLoad NameLoad SubscriptLoad NameLoad Slice Num Num orelse If CompareEq SubscriptLoad NameLoad Index Num Str body Assign NameStore Call NameLoad SubscriptLoad NameLoad Index Num Assign AttributeStore NameLoad attr SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr Call NameLoad Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return ListLoad SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For NameStore Call NameLoad Num body If CompareEq NameLoad Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num For NameStore AttributeLoad NameLoad attr body If Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore BinOpAdd NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AugAssignAdd NameStore Num If CompareEq NameLoad Num body Assign AttributeStore AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num Assign AttributeStore AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Num If CompareEq NameLoad Num body Expr Call AttributeLoad AttributeLoad NameLoad attr attr orelse If CompareGt NameLoad Num body Assign AttributeStore AttributeLoad NameLoad attr attr UnaryOpUSub AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore AttributeLoad NameLoad attr attr UnaryOpUSub AttributeLoad AttributeLoad NameLoad attr attr If Call AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call AttributeLoad NameLoad attr If CompareEq NameLoad AttributeLoad NameLoad attr body Return AttributeLoad NameLoad attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return CompareLt Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareGt SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Num If CompareLt SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Num If CompareGt SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Num If CompareLt SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Num body Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Num decorator_list decorator_list ClassDef bases body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign AttributeStore NameLoad attr Call NameLoad BinOpMult AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr ListLoad Num Num Num For NameStore AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr Call NameLoad BinOpMult AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad BinOpSub NameLoad NameLoad BinOpAdd NameLoad NameLoad BinOpAdd NameLoad NameLoad keyword Num keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return ListLoad Call NameLoad BinOpMult SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr Call NameLoad BinOpMult SubscriptLoad NameLoad Index Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign TupleStore AttributeStore NameLoad attr AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore TupleLoad Call NameLoad NameLoad Call NameLoad NameLoad Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad NameLoad keyword Num keyword Num Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore ListLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore NameLoad While UnaryOpNot NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr If Call AttributeLoad NameLoad attr body Assign NameStore NameLoad If CompareEq Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list
N/A N/A Pinball domain for reinforcement learning
 Domain Domain N/A numpy np itertools tee izip N/A itertools Tkinter Tk Canvas N/A os rlpy.Tools __rlpy_location__ N/A __copyright__ Copyright 2013, RLPy http://acl.mit.edu/RLPy N/A __credits__ N/A Alborz Geramifard Robert H. Klein Christoph Dann William Dabney Jonathan P. How N/A __license__ BSD 3-Clause N/A __author__ N/A Pierre-Luc Bacon Austin Hays Pinball N/A Domain N/A N/A 
    The goal of this domain is to maneuver a small ball on a plate into a hole.
    The plate may contain obstacles which should be avoided.

    **STATE:**
        The state is given by a 4-dimensional vector, consisting of position and
        velocity of the ball.

    **ACTIONS:**
        There are 5 actions, standing for slanting the  plat in x or y direction
        or a horizontal position
        of the plate.

    **REWARD:**
        Slanting the plate costs -4 reward in addition to -1 reward for each timestep.
        When the ball reaches the hole, the agent receives 10000 units of reward.

    **REFERENCE:**

    .. seealso::
        G.D. Konidaris and A.G. Barto:
        *Skill Discovery in Continuous Reinforcement Learning Domains using Skill Chaining.*
        Advances in Neural Information Processing Systems 22, pages 1015-1023, December 2009.
     N/A default_config_dir N/A N/A N/A os path join __rlpy_location__ Domains PinballConfigs __init__ N/A N/A self noise episodeCap configuration N/A 0.1 1000 N/A N/A N/A os path join default_config_dir pinball_simple_single.cfg N/A N/A 
        configuration:
            location of the configuration file
        episodeCap:
            maximum length of an episode
        noise:
            with probability noise, a uniformly random action is executed
         N/A N/A self NOISE noise N/A N/A self configuration configuration N/A N/A self screen None N/A N/A self episodeCap episodeCap N/A N/A self actions_num 5 N/A N/A self actions N/A N/A PinballModel ACC_X N/A PinballModel DEC_Y N/A PinballModel DEC_X N/A PinballModel ACC_Y N/A PinballModel ACC_NONE N/A N/A self statespace_limits N/A N/A np array N/A N/A 0.0 1.0 N/A 0.0 1.0 N/A -2.0 2.0 N/A -2.0 2.0 N/A N/A self continuous_dims N/A 4 N/A N/A N/A N/A super Pinball self __init__ N/A N/A self environment N/A PinballModel N/A self configuration random_state N/A self random_state N/A showDomain N/A N/A self a N/A N/A N/A N/A N/A self screen None N/A N/A master N/A Tk N/A N/A N/A master title RLPY Pinball N/A N/A self screen N/A Canvas master width 500.0 height 500.0 N/A N/A N/A N/A self screen configure background LightGray N/A N/A N/A N/A self screen pack N/A N/A self environment_view N/A PinballView N/A self screen 500.0 500.0 N/A self environment N/A N/A N/A N/A self environment_view blit N/A N/A N/A N/A self screen pack N/A N/A N/A N/A self screen update N/A step N/A N/A self a N/A N/A N/A s N/A self state N/A N/A N/A N/A N/A N/A self environment ball position N/A 0 N/A N/A N/A N/A self environment ball position N/A 1 N/A N/A N/A self environment ball xdot N/A N/A N/A self environment ball ydot s N/A N/A N/A N/A N/A self random_state random_sample N/A self NOISE N/A N/A a N/A N/A N/A self random_state choice N/A N/A self possibleActions N/A reward N/A N/A N/A self environment take_action a N/A N/A N/A N/A self environment _check_bounds N/A state N/A N/A np array N/A N/A N/A self environment get_state N/A N/A self state N/A N/A state copy N/A N/A reward state N/A N/A self isTerminal N/A N/A self possibleActions N/A s0 N/A N/A self N/A N/A N/A N/A N/A N/A N/A N/A self environment ball position N/A 0 N/A N/A N/A N/A self environment ball position N/A 1 N/A N/A self environment start_pos N/A N/A N/A N/A N/A self environment ball xdot N/A N/A N/A self environment ball ydot N/A 0.0 0.0 N/A N/A self state N/A N/A np array N/A N/A N/A N/A N/A self environment ball position N/A 0 N/A N/A N/A N/A self environment ball position N/A 1 N/A N/A N/A self environment ball xdot N/A N/A N/A self environment ball ydot N/A N/A N/A self state N/A N/A self isTerminal N/A N/A self possibleActions N/A possibleActions N/A N/A self s N/A 0 N/A N/A N/A N/A np array N/A self actions N/A isTerminal N/A N/A self N/A N/A N/A N/A N/A N/A self environment episode_ended N/A N/A BallModel N/A N/A N/A  This class maintains the state of the ball
    in the pinball domain. It takes care of moving
    it according to the current velocity and drag coefficient.

     N/A DRAG 0.995 __init__ N/A N/A self start_position radius N/A N/A N/A 
        :param start_position: The initial position
        :type start_position: float
        :param radius: The ball radius
        :type radius: float
         N/A N/A self position start_position N/A N/A self radius radius N/A N/A self xdot 0.0 N/A N/A self ydot 0.0 N/A add_impulse N/A N/A self delta_xdot delta_ydot N/A N/A N/A  Change the momentum of the ball
        :param delta_xdot: The change in velocity in the x direction
        :type delta_xdot: float
        :param delta_ydot: The change in velocity in the y direction
        :type delta_ydot: float
         N/A N/A self xdot N/A delta_xdot 5.0 N/A N/A self ydot N/A delta_ydot 5.0 N/A N/A self xdot N/A N/A self _clip N/A self xdot N/A N/A self ydot N/A N/A self _clip N/A self ydot N/A add_drag N/A N/A self N/A N/A N/A  Add a fixed amount of drag to the current velocity  N/A N/A self xdot N/A self DRAG N/A N/A self ydot N/A self DRAG N/A step N/A N/A self N/A N/A N/A  Move the ball by one increment  N/A N/A N/A self position N/A 0 N/A N/A N/A self xdot N/A self radius 20.0 N/A N/A N/A self position N/A 1 N/A N/A N/A self ydot N/A self radius 20.0 N/A _clip N/A N/A self val low high N/A -2 2 N/A N/A  Clip a value in a given range  N/A N/A val high N/A N/A val high N/A N/A val low N/A N/A val low N/A val N/A N/A PinballObstacle N/A N/A N/A  This class represents a single polygon obstacle in the
    pinball domain and detects when a :class:`BallModel` hits it.

    When a collision is detected, it also provides a way to
    compute the appropriate effect to apply on the ball.
     __init__ N/A N/A self points N/A N/A N/A 
        :param points: A list of points defining the polygon
        :type points: list of lists
         N/A N/A self points points N/A N/A self min_x N/A N/A min N/A self points key N/A N/A N/A pt N/A N/A pt N/A 0 N/A 0 N/A N/A self max_x N/A N/A max N/A self points key N/A N/A N/A pt N/A N/A pt N/A 0 N/A 0 N/A N/A self min_y N/A N/A min N/A self points key N/A N/A N/A pt N/A N/A pt N/A 1 N/A 1 N/A N/A self max_y N/A N/A max N/A self points key N/A N/A N/A pt N/A N/A pt N/A 1 N/A 1 N/A N/A self _double_collision False N/A N/A self _intercept None N/A collision N/A N/A self ball N/A N/A N/A  Determines if the ball hits this obstacle

    :param ball: An instance of :class:`BallModel`
    :type ball: :class:`BallModel`
         N/A N/A self _double_collision False N/A N/A N/A N/A N/A ball position N/A 0 N/A ball radius N/A self max_x N/A N/A False N/A N/A N/A N/A N/A ball position N/A 0 N/A ball radius N/A self min_x N/A N/A False N/A N/A N/A N/A N/A ball position N/A 1 N/A ball radius N/A self max_y N/A N/A False N/A N/A N/A N/A N/A ball position N/A 1 N/A ball radius N/A self min_y N/A N/A False N/A N/A a b N/A tee N/A N/A np vstack N/A N/A N/A np array N/A self points N/A N/A self points N/A 0 N/A N/A next b None N/A intercept_found False N/A pt_pair N/A izip a b N/A N/A N/A N/A self _intercept_edge pt_pair ball N/A N/A intercept_found N/A N/A N/A self _intercept N/A N/A self _select_edge pt_pair N/A self _intercept ball N/A N/A self _double_collision True N/A N/A N/A self _intercept pt_pair N/A intercept_found True N/A intercept_found N/A collision_effect N/A N/A self ball N/A N/A N/A  Based of the collision detection result triggered
    in :func:`PinballObstacle.collision`, compute the
        change in velocity.

    :param ball: An instance of :class:`BallModel`
    :type ball: :class:`BallModel`

         N/A N/A self _double_collision N/A N/A N/A N/A N/A ball xdot N/A N/A ball ydot N/A obstacle_vector N/A N/A N/A self _intercept N/A 1 N/A N/A self _intercept N/A 0 N/A N/A N/A obstacle_vector N/A 0 0 N/A N/A obstacle_vector N/A N/A N/A self _intercept N/A 0 N/A N/A self _intercept N/A 1 N/A velocity_vector N/A N/A np array N/A N/A ball xdot N/A ball ydot N/A theta N/A N/A N/A self _angle velocity_vector obstacle_vector N/A np pi N/A N/A theta 0 N/A N/A theta N/A 2 N/A np pi N/A intercept_theta N/A N/A self _angle N/A -1 0 obstacle_vector N/A theta intercept_theta N/A N/A theta N/A 2 N/A np pi N/A N/A theta N/A 2 N/A np pi N/A velocity N/A N/A N/A np linalg norm N/A N/A ball xdot N/A ball ydot N/A N/A N/A velocity N/A N/A np cos theta N/A velocity N/A N/A np sin theta N/A _select_edge N/A N/A self intersect1 intersect2 ball N/A N/A N/A  If the ball hits a corner, select one of two edges.

    :param intersect1: A pair of points defining an edge of the polygon
    :type intersect1: list of lists
    :param intersect2: A pair of points defining an edge of the polygon
    :type intersect2: list of lists
    :returns: The edge with the smallest angle with the velocity vector
    :rtype: list of lists

         N/A velocity N/A N/A np array N/A N/A ball xdot N/A ball ydot N/A obstacle_vector1 N/A N/A intersect1 N/A 1 N/A intersect1 N/A 0 N/A obstacle_vector2 N/A N/A intersect2 N/A 1 N/A intersect2 N/A 0 N/A angle1 N/A N/A self _angle velocity obstacle_vector1 N/A N/A angle1 N/A np pi N/A N/A angle1 N/A np pi N/A angle2 N/A N/A self _angle velocity obstacle_vector2 N/A N/A angle1 N/A np pi N/A N/A angle2 N/A np pi N/A N/A N/A N/A np abs N/A angle1 N/A N/A np pi 2.0 N/A N/A np abs N/A angle2 N/A N/A np pi 2.0 N/A N/A intersect1 N/A intersect2 N/A _angle N/A N/A self v1 v2 N/A N/A N/A  Compute the angle difference between two vectors

    :param v1: The x,y coordinates of the vector
    :type: v1: list
    :param v2: The x,y coordinates of the vector
    :type: v2: list
    :rtype: float

     N/A angle_diff N/A N/A N/A np arctan2 N/A v1 N/A 0 N/A v1 N/A 1 N/A N/A np arctan2 N/A v2 N/A 0 N/A v2 N/A 1 N/A N/A angle_diff 0 N/A N/A angle_diff N/A 2 N/A np pi N/A angle_diff N/A _intercept_edge N/A N/A self pt_pair ball N/A N/A N/A  Compute the projection on and edge and find out

    if it intercept with the ball.
    :param pt_pair: The pair of points defining an edge
    :type pt_pair: list of lists
    :param ball: An instance of :class:`BallModel`
    :type ball: :class:`BallModel`
    :returns: True if the ball has hit an edge of the polygon
    :rtype: bool

         N/A obstacle_edge N/A N/A pt_pair N/A 1 N/A pt_pair N/A 0 N/A difference N/A N/A N/A np array N/A ball position N/A pt_pair N/A 0 N/A scalar_proj N/A N/A N/A difference dot obstacle_edge N/A N/A obstacle_edge dot obstacle_edge N/A N/A scalar_proj 1.0 N/A N/A scalar_proj 1.0 N/A N/A N/A scalar_proj 0.0 N/A N/A scalar_proj 0.0 N/A closest_pt N/A N/A pt_pair N/A 0 N/A obstacle_edge scalar_proj N/A obstacle_to_ball N/A N/A ball position closest_pt N/A distance N/A N/A obstacle_to_ball dot obstacle_to_ball N/A N/A distance N/A N/A ball radius N/A ball radius N/A N/A velocity N/A N/A np array N/A N/A ball xdot N/A ball ydot N/A ball_to_obstacle N/A closest_pt N/A ball position N/A angle N/A N/A self _angle ball_to_obstacle velocity N/A N/A angle N/A np pi N/A N/A angle N/A N/A 2 N/A np pi angle N/A N/A angle N/A N/A np pi 1.99 N/A N/A False N/A True N/A N/A False N/A N/A PinballModel N/A N/A N/A  This class is a self-contained model of the pinball
    domain for reinforcement learning.

    It can be used either over RL-Glue through the :class:`PinballRLGlue`
    adapter or interactively with :class:`PinballView`.

     N/A ACC_X 0 N/A ACC_Y 1 N/A DEC_X 2 N/A DEC_Y 3 N/A ACC_NONE 4 N/A STEP_PENALTY -1 N/A THRUST_PENALTY -5 N/A END_EPISODE 10000 __init__ N/A N/A self configuration random_state N/A N/A N/A N/A np random RandomState N/A N/A  Read a configuration file for Pinball and draw the domain to screen

    :param configuration: a configuration file containing the polygons,
        source(s) and target location.
    :type configuration: str

         N/A N/A self random_state random_state N/A N/A self action_effects N/A N/A self ACC_X N/A self ACC_Y N/A self DEC_X N/A self DEC_Y N/A self ACC_NONE N/A 1 0 N/A 0 1 N/A -1 0 N/A 0 -1 N/A 0 0 N/A N/A self obstacles N/A N/A N/A self target_pos N/A N/A N/A self target_rad 0.01 N/A ball_rad 0.01 N/A start_pos N/A N/A N/A open configuration fp N/A N/A line N/A N/A fp readlines N/A N/A tokens N/A N/A N/A N/A line strip split N/A N/A N/A len tokens N/A N/A N/A N/A N/A N/A tokens N/A 0 polygon N/A N/A N/A N/A N/A self obstacles append N/A PinballObstacle N/A zip N/A N/A N/A iter N/A map float N/A tokens N/A 1 2 N/A N/A N/A N/A tokens N/A 0 target N/A N/A N/A self target_pos N/A N/A float N/A tokens N/A 1 N/A float N/A tokens N/A 2 N/A N/A self target_rad N/A float N/A tokens N/A 3 N/A N/A N/A N/A tokens N/A 0 start N/A N/A start_pos N/A zip N/A N/A N/A iter N/A map float N/A tokens N/A 1 2 N/A N/A N/A N/A tokens N/A 0 ball N/A N/A ball_rad N/A float N/A tokens N/A 1 N/A N/A self start_pos N/A start_pos N/A 0 N/A a N/A N/A N/A self random_state randint N/A len start_pos N/A N/A self ball N/A BallModel N/A list N/A start_pos N/A a ball_rad N/A get_state N/A N/A self N/A N/A N/A  Access the current 4-dimensional state vector

        :returns: a list containing the x position, y position, xdot, ydot
        :rtype: list

         N/A N/A N/A N/A N/A self ball position N/A 0 N/A N/A N/A self ball position N/A 1 N/A N/A self ball xdot N/A N/A self ball ydot N/A take_action N/A N/A self action N/A N/A N/A  Take a step in the environment

        :param action: The action to apply over the ball
        :type action: int

         N/A i N/A xrange 20 N/A N/A N/A i 0 N/A N/A N/A N/A N/A self ball add_impulse N/A N/A self action_effects N/A action N/A N/A N/A N/A self ball step N/A ncollision 0 N/A dxdy N/A N/A np array N/A 0 0 N/A obs N/A self obstacles N/A N/A N/A N/A obs collision N/A self ball N/A N/A dxdy N/A dxdy N/A N/A obs collision_effect N/A self ball N/A ncollision 1 N/A N/A ncollision 1 N/A N/A N/A N/A self ball xdot N/A dxdy N/A 0 N/A N/A N/A self ball ydot N/A dxdy N/A 1 N/A N/A i 19 N/A N/A N/A N/A N/A self ball step N/A N/A N/A ncollision 1 N/A N/A N/A N/A self ball xdot N/A N/A N/A self ball xdot N/A N/A N/A self ball ydot N/A N/A N/A self ball ydot N/A N/A N/A self episode_ended N/A N/A N/A self END_EPISODE N/A N/A N/A N/A self ball add_drag N/A N/A N/A self _check_bounds N/A N/A action N/A self ACC_NONE N/A N/A N/A self STEP_PENALTY N/A N/A self THRUST_PENALTY N/A episode_ended N/A N/A self N/A N/A N/A  Find out if the ball reached the target

        :returns: True if the ball reached the target position
        :rtype: bool

         N/A N/A N/A N/A N/A np linalg norm N/A N/A N/A np array N/A N/A self ball position N/A N/A np array N/A self target_pos N/A self target_rad N/A _check_bounds N/A N/A self N/A N/A N/A  Make sure that the ball stays within the environment  N/A N/A N/A N/A N/A self ball position N/A 0 1.0 N/A N/A N/A N/A N/A self ball position N/A 0 0.95 N/A N/A N/A N/A N/A self ball position N/A 0 0.0 N/A N/A N/A N/A N/A self ball position N/A 0 0.05 N/A N/A N/A N/A N/A self ball position N/A 1 1.0 N/A N/A N/A N/A N/A self ball position N/A 1 0.95 N/A N/A N/A N/A N/A self ball position N/A 1 0.0 N/A N/A N/A N/A N/A self ball position N/A 1 0.05 N/A N/A PinballView N/A N/A N/A  This class displays a :class:`PinballModel`

    This class is used in conjunction with the :func:`run_pinballview`
    function, acting as a *controller*.

     __init__ N/A N/A self screen width height model N/A N/A N/A 
           Changed from original PyGame implementation to work
           with Tkinter visualization.
         N/A N/A self screen screen N/A N/A self width 500.0 N/A N/A self height 500.0 N/A N/A self model model N/A N/A N/A self x N/A self y N/A N/A self _to_pixels N/A N/A N/A self model ball position N/A N/A self rad N/A int N/A N/A N/A N/A self model ball radius N/A self width N/A N/A self DARK_GRAY N/A 64 64 64 N/A N/A self DARK_BLUE N/A 0 0 128 N/A N/A self LIGHT_GRAY N/A 232 232 232 N/A N/A self BALL_COLOR N/A 0 0 255 N/A N/A self TARGET_COLOR N/A 255 0 0 N/A obs N/A model obstacles N/A N/A coords_list N/A map N/A self _to_pixels N/A obs points N/A chain N/A N/A itertools chain coords_list N/A coords N/A list chain N/A N/A N/A N/A self screen create_polygon coords fill blue N/A N/A N/A N/A self screen pack N/A N/A N/A self target_x N/A self target_y N/A N/A self _to_pixels N/A N/A self model target_pos N/A N/A self target_rad N/A int N/A N/A N/A self model target_rad N/A self width N/A target_id N/A N/A self drawcircle N/A self screen N/A self target_x N/A self target_y N/A self target_rad red N/A N/A self ball_id N/A N/A self drawcircle N/A self screen N/A self x N/A self y N/A self rad black N/A N/A N/A N/A self screen pack N/A drawcircle N/A N/A self canv x y rad color N/A N/A N/A N/A N/A canv create_oval N/A x rad N/A y rad N/A x rad N/A y rad width 0 fill color N/A _to_pixels N/A N/A self pt N/A N/A N/A  Converts from real units in the 0-1 range to pixel units

        :param pt: a point in real units
        :type pt: list
        :returns: the input point in pixel units
        :rtype: list

         N/A N/A N/A int N/A N/A pt N/A 0 N/A self width N/A int N/A N/A pt N/A 1 N/A self height N/A blit N/A N/A self N/A N/A N/A  Blit the ball onto the background surface  N/A N/A N/A N/A self screen coords N/A self ball_id N/A N/A self x N/A self rad N/A N/A self y N/A self rad N/A N/A self x N/A self rad N/A N/A self y N/A self rad N/A N/A N/A self x N/A self y N/A N/A self _to_pixels N/A N/A N/A self model ball position N/A N/A N/A N/A self screen pack N/A N/A run_pinballview N/A N/A width height configuration N/A N/A N/A 

        Changed from original Pierre-Luc Bacon implementation to reflect
        the visualization changes in the PinballView Class.

     N/A N/A width height N/A N/A float width N/A float height N/A master N/A Tk N/A N/A N/A master title RLPY Pinball N/A screen N/A Canvas master width 500.0 height 500.0 N/A N/A N/A screen configure background LightGray N/A N/A N/A screen pack N/A environment N/A PinballModel configuration N/A environment_view N/A PinballView screen width height environment N/A actions N/A N/A PinballModel ACC_X N/A PinballModel DEC_Y N/A PinballModel DEC_X N/A PinballModel ACC_Y N/A PinballModel ACC_NONE N/A done False N/A N/A done N/A N/A user_action N/A N/A N/A np random choice actions N/A N/A N/A environment_view blit N/A N/A N/A environment episode_ended N/A N/A done True N/A N/A N/A N/A environment take_action user_action N/A environment END_EPISODE N/A N/A done True N/A N/A N/A environment_view blit N/A N/A N/A screen update N/A