Module ImportFrom alias alias alias alias alias alias alias alias alias alias alias alias alias alias alias ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Pass decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore TupleLoad FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict For TupleStore NameStore TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareEq NameLoad NameLoad body Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore BinOpAdd BinOpBitAnd NameLoad Num BinOpMult Num BinOpBitAnd BinOpRShift NameLoad Num Num Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore ListLoad TupleLoad NameLoad Num TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad Num TupleLoad NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore ListLoad For TupleStore NameStore NameStore Call NameLoad NameLoad body If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Index Num Assign NameStore SubscriptLoad NameLoad Slice Num If BoolOpAnd CompareEq NameLoad NameLoad CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Num TupleLoad NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Num TupleLoad NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Assign NameStore BinOpAdd BinOpBitAnd NameLoad Num BinOpMult Num BinOpBitAnd BinOpRShift NameLoad Num Num Expr Call AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Num TupleLoad NameLoad NameLoad orelse If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr ListLoad TupleLoad NameLoad Str TupleLoad NameLoad Str TupleLoad NameLoad NameLoad TupleLoad NameLoad Str TupleLoad NameLoad Num TupleLoad NameLoad NameLoad orelse Raise Call NameLoad Str Return NameLoad decorator_list
N/A byteplay LOAD_ATTR LOAD_CONST ROT_TWO DUP_TOP CALL_FUNCTION POP_TOP LOAD_FAST BUILD_TUPLE ROT_THREE UNPACK_SEQUENCE DUP_TOPX BINARY_SUBSCR GET_ITER LOAD_NAME RETURN_VALUE CodeTracer N/A object N/A N/A  A base class for implementing code tracers.

    This class defines the interface for a code tracer object, which is
    an object which can be passed as the first argument to a code object
    which has been transformed to enable tracing. Methods on the tracer
    are called with relevant arguments from the Python stack when that
    particular code segment is executing. The return value of a tracer
    method is ignored; exceptions are propagated.

     N/A __slots__ N/A dynamic_load N/A N/A self obj attr value N/A N/A N/A  Called when an dynamic attribute is loaded.

        This method is called by the dynamic scope when it loads an
        attribute from some object in the object hierarchy due to the
        execution of the LOAD_NAME opcode.

        Parameters
        ----------
        obj : Object
            The Enaml object which owns the dynamically scoped attr.

        attr : str
            The name of the attribute which was loaded.

        value : object
            The value which was loaded.

         N/A N/A load_attr N/A N/A self obj attr N/A N/A N/A  Called before the LOAD_ATTR opcode is executed.

        Parameters
        ----------
        obj : object
            The object which owns the attribute.

        attr : string
            The attribute being loaded.

         N/A N/A call_function N/A N/A self func argtuple argspec N/A N/A N/A  Called before the CALL_FUNCTION opcode is executed.

        Parameters
        ----------
        func : object
            The object being called.

        argtuple : tuple
            The argument tuple from the stack (see notes).

        argspec : int
            The argument tuple specification.

        Notes
        -----
        The `argstuple` contains both positional and keyword argument
        information. `argspec` is an int which specifies how to parse
        the information. The lower 16bits of `argspec` are significant.
        The lowest 8 bits are the number of positional arguments which
        are the first n items in `argtuple`. The second 8 bits are the
        number of keyword arguments which follow the positional args in
        `argtuple` and alternate name -> value. `argtuple` can be parsed
        into a conventional tuple and dict with the following:

            nargs = argspec & 0xFF
            args = argtuple[:nargs]
            kwargs = dict(zip(argtuple[nargs::2], argtuple[nargs+1::2]))

         N/A N/A binary_subscr N/A N/A self obj idx N/A N/A N/A  Called before the BINARY_SUBSCR opcode is executed.

        Parameters
        ----------
        obj : object
            The object being indexed.

        idx : object
            The index.

         N/A N/A get_iter N/A N/A self obj N/A N/A N/A  Called before the GET_ITER opcode is executed.

        Parameters
        ----------
        obj : object
            The object which should return an iterator.

         N/A N/A return_value N/A N/A self value N/A N/A N/A  Called before the RETURN_VALUE opcode is executed.

        Parameters
        ----------
        value : object
            The value that will be returned from the code object.

         N/A N/A N/A CodeInverter N/A object N/A N/A  A base class for implementing code inverters.

    This class defines the interface for a code inverter object, which is
    an object which can be passed as the first argument to a code object
    which has been transformed to enable inversion. The methods on the
    inverter are called with relevant arguments from the Python stack
    when that particular code segment is executing. The return values of
    a tracer method is ignored; exceptions are propagated.

    The default behavior of an inverter is to raise. Implementations
    must provide their own code in order to enable inversion.

     N/A __slots__ N/A fail N/A N/A self N/A N/A N/A  Called by handlers to raise an inversion exception.

         N/A N/A RuntimeError can't assign to expression N/A load_name N/A N/A self name value N/A N/A N/A  Called before the LOAD_NAME opcode is executed.

        This method should perform a STORE_NAME operation.

        Parameters
        ----------
        name : string
            The name being loaded.

        value : object
            The value to store.

         N/A N/A N/A self fail N/A load_attr N/A N/A self obj attr value N/A N/A N/A  Called before the LOAD_ATTR opcode is executed.

        This method should perform a STORE_ATTR operation.

        Parameters
        ----------
        obj : object
            The object which owns the attribute.

        attr : string
            The attribute being loaded.

        value : object
            The value to store

         N/A N/A N/A self fail N/A call_function N/A N/A self func argtuple argspec value N/A N/A N/A  Called before the CALL_FUNCTION opcode is executed.

        This method should perform an appropriate store operation.

        Parameters
        ----------
        func : object
            The object being called.

        argtuple : tuple
            The argument tuple from the stack (see Notes).

        argspec : int
            The argument tuple specification.

        value : object
            The value to store.

        Notes
        -----
        The semantics of the arguments is identical to the method
        `call_function` on the `CodeTracer` type.

         N/A N/A N/A self fail N/A binary_subscr N/A N/A self obj idx value N/A N/A N/A  Called before the BINARY_SUBSCR opcode is executed.

        This method should perform a STORE_SUBSCR operation.

        Parameters
        ----------
        obj : object
            The object being indexed.

        idx : object
            The index.

        value : object
            The value to store.

         N/A N/A N/A self fail N/A N/A inject_tracing N/A N/A codelist N/A N/A N/A  Inject tracing code into the given code list.

    This will inject the bytecode operations required to trace the
    execution of the code using a `CodeTracer` object. The generated
    opcodes expect a fast local '_[tracer]' to be available when the
    code is executed.

    Parameters
    ----------
    codelist : list
        The list of byteplay code ops to modify.

    Returns
    -------
    result : list
        A *new* list of code ops which implement the desired behavior.

     N/A inserts N/A N/A N/A idx N/A op op_arg N/A enumerate codelist N/A N/A N/A op LOAD_ATTR N/A N/A code N/A N/A DUP_TOP None N/A LOAD_FAST _[tracer] N/A LOAD_ATTR load_attr N/A ROT_TWO None N/A LOAD_CONST op_arg N/A CALL_FUNCTION 2 N/A POP_TOP None N/A N/A inserts N/A idx code N/A N/A N/A op CALL_FUNCTION N/A N/A n_stack_args N/A N/A op_arg 255 N/A 2 N/A N/A op_arg 8 255 N/A code N/A N/A BUILD_TUPLE n_stack_args N/A DUP_TOPX 2 N/A LOAD_FAST _[tracer] N/A LOAD_ATTR call_function N/A ROT_THREE None N/A LOAD_CONST op_arg N/A CALL_FUNCTION 3 N/A POP_TOP None N/A UNPACK_SEQUENCE n_stack_args N/A BUILD_TUPLE n_stack_args N/A UNPACK_SEQUENCE n_stack_args N/A N/A inserts N/A idx code N/A N/A N/A op BINARY_SUBSCR N/A N/A code N/A N/A DUP_TOPX 2 N/A LOAD_FAST _[tracer] N/A LOAD_ATTR binary_subscr N/A ROT_THREE None N/A CALL_FUNCTION 2 N/A POP_TOP None N/A N/A inserts N/A idx code N/A N/A N/A op GET_ITER N/A N/A code N/A N/A DUP_TOP None N/A LOAD_FAST _[tracer] N/A LOAD_ATTR get_iter N/A ROT_TWO None N/A CALL_FUNCTION 1 N/A POP_TOP None N/A N/A inserts N/A idx code N/A N/A N/A op RETURN_VALUE N/A N/A code N/A N/A DUP_TOP None N/A LOAD_FAST _[tracer] N/A LOAD_ATTR return_value N/A ROT_TWO None N/A CALL_FUNCTION 1 N/A POP_TOP None N/A N/A inserts N/A idx code N/A new_code N/A N/A N/A idx code_op N/A enumerate codelist N/A N/A N/A idx inserts N/A N/A N/A N/A new_code extend N/A inserts N/A idx N/A N/A N/A new_code append code_op N/A new_code N/A inject_inversion N/A N/A codelist N/A N/A N/A  Inject inversion code into the given code list.

    This will inject the bytecode operations required to invert the
    execution of the code using a `CodeInverter` object. The generated
    opcodes expect the fast local '_[inverter]' and '_[value]' to be
    available when the code is executed.

    Parameters
    ----------
    codelist : list
        The list of byteplay code ops to modify.

    Returns
    -------
    result : list
        A *new* list of code ops which implement the desired behavior.

    Raises
    ------
    ValueError
        The given code is not suitable for inversion.

     N/A N/A opcode oparg N/A codelist N/A -2 N/A new_code N/A codelist N/A -2 N/A N/A N/A opcode LOAD_NAME N/A N/A len codelist 3 N/A N/A N/A N/A new_code extend N/A N/A LOAD_FAST _[inverter] N/A LOAD_ATTR load_name N/A LOAD_CONST oparg N/A LOAD_FAST _[value] N/A CALL_FUNCTION 2 N/A RETURN_VALUE None N/A N/A N/A opcode LOAD_ATTR N/A N/A N/A N/A new_code extend N/A N/A LOAD_FAST _[inverter] N/A LOAD_ATTR load_attr N/A ROT_TWO None N/A LOAD_CONST oparg N/A LOAD_FAST _[value] N/A CALL_FUNCTION 3 N/A RETURN_VALUE None N/A N/A N/A opcode CALL_FUNCTION N/A N/A n_stack_args N/A N/A oparg 255 N/A 2 N/A N/A oparg 8 255 N/A N/A N/A new_code extend N/A N/A BUILD_TUPLE n_stack_args N/A LOAD_FAST _[inverter] N/A LOAD_ATTR call_function N/A ROT_THREE None N/A LOAD_CONST oparg N/A LOAD_FAST _[value] N/A CALL_FUNCTION 4 N/A RETURN_VALUE None N/A N/A N/A opcode BINARY_SUBSCR N/A N/A N/A N/A new_code extend N/A N/A LOAD_FAST _[inverter] N/A LOAD_ATTR binary_subscr N/A ROT_THREE None N/A LOAD_FAST _[value] N/A CALL_FUNCTION 3 N/A RETURN_VALUE None N/A N/A N/A ValueError can't invert code N/A new_code N/A