pax_global_header00006660000000000000000000000064147407636750014535gustar00rootroot0000000000000052 comment=0edb6ca3d733d8cb3fd1ddc7994bde61991ac4c2 python-executing-2.2.0/000077500000000000000000000000001474076367500150505ustar00rootroot00000000000000python-executing-2.2.0/.github/000077500000000000000000000000001474076367500164105ustar00rootroot00000000000000python-executing-2.2.0/.github/workflows/000077500000000000000000000000001474076367500204455ustar00rootroot00000000000000python-executing-2.2.0/.github/workflows/test.yml000066400000000000000000000042641474076367500221550ustar00rootroot00000000000000name: Tests on: push: branches: - master pull_request: workflow_dispatch: jobs: test: runs-on: ubuntu-20.04 strategy: matrix: python-version: [3.8, 3.9, '3.10', 3.11, 3.12-dev,3.13-dev] steps: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | python --version pip install -U pip pip install --upgrade coveralls setuptools setuptools_scm pep517 .[tests] pip install . - name: Mypy testing (<3.11) run: | pip install mypy==0.910 python -m mypy executing --exclude=executing/_position_node_finder.py # fromJson because https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3 if: ${{ !contains(fromJson('["pypy-3.6", "3.11","3.12-dev","3.13-dev"]'), matrix.python-version) }} # pypy < 3.8 very doesn't work - name: Mypy testing (3.11) run: | pip install mypy==0.971 python -m mypy executing # fromJson because https://github.community/t/passing-an-array-literal-to-contains-function-causes-syntax-error/17213/3 # TODO: enable typechecking for 3.12 if: ${{ contains(fromJson('["3.11"]'), matrix.python-version) }} # only >=3.11 use _position_node_finder.py - name: Test env: EXECUTING_SLOW_TESTS: 1 run: | # COVERAGE_PROCESS_START defines the path to the coverage config for coverage-enable-subprocess export COVERAGE_PROCESS_START=${GITHUB_WORKSPACE}/setup.cfg coverage run -m pytest tests # combine the coverage of all subprocesses coverage combine coverage report -m - name: Coveralls Python uses: AndreMiras/coveralls-python-action@v20201129 with: parallel: true flag-name: test-${{ matrix.python-version }} coveralls_finish: needs: test runs-on: ubuntu-latest steps: - name: Coveralls Finished uses: AndreMiras/coveralls-python-action@v20201129 with: parallel-finished: true python-executing-2.2.0/.gitignore000066400000000000000000000025631474076367500170460ustar00rootroot00000000000000/executing/version.py # Created by .ignore support plugin (hsz.mobi) ### Python template # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] *$py.class # C extensions *.so # Distribution / packaging .Python build/ develop-eggs/ dist/ downloads/ eggs/ .eggs/ lib/ lib64/ parts/ sdist/ var/ wheels/ *.egg-info/ .installed.cfg *.egg MANIFEST # PyInstaller # Usually these files are written by a python script from a template # before PyInstaller builds the exe, so as to inject date/other infos into it. *.manifest *.spec # Installer logs pip-log.txt pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ .coverage .coverage.* .cache nosetests.xml coverage.xml *.cover .hypothesis/ # Translations *.mo *.pot # Django stuff: *.log .static_storage/ .media/ local_settings.py # Flask stuff: instance/ .webassets-cache # Scrapy stuff: .scrapy # Sphinx documentation docs/_build/ # PyBuilder target/ # Jupyter Notebook .ipynb_checkpoints # pyenv .python-version # celery beat schedule file celerybeat-schedule # SageMath parsed files *.sage.py # Environments .env .venv env/ venv*/ ENV/ env.bak/ venv.bak/ # Spyder project settings .spyderproject .spyproject # Rope project settings .ropeproject # mkdocs documentation /site # mypy .mypy_cache/ .dmypy.json # VSCode .vscode/ # mutmut .mutmut-cache # testing tools /done.db /tests/last_samples/ python-executing-2.2.0/LICENSE.txt000066400000000000000000000020521474076367500166720ustar00rootroot00000000000000MIT License Copyright (c) 2019 Alex Hall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. python-executing-2.2.0/MANIFEST.in000066400000000000000000000000241474076367500166020ustar00rootroot00000000000000include LICENSE.txt python-executing-2.2.0/README.md000066400000000000000000000170351474076367500163350ustar00rootroot00000000000000# executing [![Build Status](https://github.com/alexmojaki/executing/workflows/Tests/badge.svg?branch=master)](https://github.com/alexmojaki/executing/actions) [![Coverage Status](https://coveralls.io/repos/github/alexmojaki/executing/badge.svg?branch=master)](https://coveralls.io/github/alexmojaki/executing?branch=master) [![Supports Python versions 3.5+, including PyPy](https://img.shields.io/pypi/pyversions/executing.svg)](https://pypi.python.org/pypi/executing) This mini-package lets you get information about what a frame is currently doing, particularly the AST node being executed. * [Usage](#usage) * [Getting the AST node](#getting-the-ast-node) * [Getting the source code of the node](#getting-the-source-code-of-the-node) * [Getting the `__qualname__` of the current function](#getting-the-__qualname__-of-the-current-function) * [The Source class](#the-source-class) * [Installation](#installation) * [How does it work?](#how-does-it-work) * [Is it reliable?](#is-it-reliable) * [Which nodes can it identify?](#which-nodes-can-it-identify) * [Projects that use this](#projects-that-use-this) ## Usage ### Getting the AST node ```python import executing node = executing.Source.executing(frame).node ``` Then `node` will be an AST node (from the `ast` standard library module) or None if the node couldn't be identified (which may happen often and should always be checked). `node` will always be the same instance for multiple calls with frames at the same point of execution. If you have a traceback object, pass it directly to `Source.executing()` rather than the `tb_frame` attribute to get the correct node. ### Getting the source code of the node For this you will need to separately install the [`asttokens`](https://github.com/gristlabs/asttokens) library, then obtain an `ASTTokens` object: ```python executing.Source.executing(frame).source.asttokens() ``` or: ```python executing.Source.for_frame(frame).asttokens() ``` or use one of the convenience methods: ```python executing.Source.executing(frame).text() executing.Source.executing(frame).text_range() ``` ### Getting the `__qualname__` of the current function ```python executing.Source.executing(frame).code_qualname() ``` or: ```python executing.Source.for_frame(frame).code_qualname(frame.f_code) ``` ### The `Source` class Everything goes through the `Source` class. Only one instance of the class is created for each filename. Subclassing it to add more attributes on creation or methods is recommended. The classmethods such as `executing` will respect this. See the source code and docstrings for more detail. ## Installation pip install executing If you don't like that you can just copy the file `executing.py`, there are no dependencies (but of course you won't get updates). ## How does it work? Suppose the frame is executing this line: ```python self.foo(bar.x) ``` and in particular it's currently obtaining the attribute `self.foo`. Looking at the bytecode, specifically `frame.f_code.co_code[frame.f_lasti]`, we can tell that it's loading an attribute, but it's not obvious which one. We can narrow down the statement being executed using `frame.f_lineno` and find the two `ast.Attribute` nodes representing `self.foo` and `bar.x`. How do we find out which one it is, without recreating the entire compiler in Python? The trick is to modify the AST slightly for each candidate expression and observe the changes in the bytecode instructions. We change the AST to this: ```python (self.foo ** 'longuniqueconstant')(bar.x) ``` and compile it, and the bytecode will be almost the same but there will be two new instructions: LOAD_CONST 'longuniqueconstant' BINARY_POWER and just before that will be a `LOAD_ATTR` instruction corresponding to `self.foo`. Seeing that it's in the same position as the original instruction lets us know we've found our match. ## Is it reliable? Yes - if it identifies a node, you can trust that it's identified the correct one. The tests are very thorough - in addition to unit tests which check various situations directly, there are property tests against a large number of files (see the filenames printed in [this build](https://travis-ci.org/alexmojaki/executing/jobs/557970457)) with real code. Specifically, for each file, the tests: 1. Identify as many nodes as possible from all the bytecode instructions in the file, and assert that they are all distinct 2. Find all the nodes that should be identifiable, and assert that they were indeed identified somewhere In other words, it shows that there is a one-to-one mapping between the nodes and the instructions that can be handled. This leaves very little room for a bug to creep in. Furthermore, `executing` checks that the instructions compiled from the modified AST exactly match the original code save for a few small known exceptions. This accounts for all the quirks and optimisations in the interpreter. ## Which nodes can it identify? Currently it works in almost all cases for the following `ast` nodes: - `Call`, e.g. `self.foo(bar)` - `Attribute`, e.g. `point.x` - `Subscript`, e.g. `lst[1]` - `BinOp`, e.g. `x + y` (doesn't include `and` and `or`) - `UnaryOp`, e.g. `-n` (includes `not` but only works sometimes) - `Compare` e.g. `a < b` (not for chains such as `0 < p < 1`) The plan is to extend to more operations in the future. ## Projects that use this ### My Projects - **[`stack_data`](https://github.com/alexmojaki/stack_data)**: Extracts data from stack frames and tracebacks, particularly to display more useful tracebacks than the default. Also uses another related library of mine: **[`pure_eval`](https://github.com/alexmojaki/pure_eval)**. - **[`futurecoder`](https://futurecoder.io/)**: Highlights the executing node in tracebacks using `executing` via `stack_data`, and provides debugging with `snoop`. - **[`snoop`](https://github.com/alexmojaki/snoop)**: A feature-rich and convenient debugging library. Uses `executing` to show the operation which caused an exception and to allow the `pp` function to display the source of its arguments. - **[`heartrate`](https://github.com/alexmojaki/heartrate)**: A simple real time visualisation of the execution of a Python program. Uses `executing` to highlight currently executing operations, particularly in each frame of the stack trace. - **[`sorcery`](https://github.com/alexmojaki/sorcery)**: Dark magic delights in Python. Uses `executing` to let special callables called spells know where they're being called from. ### Projects I've contributed to - **[`IPython`](https://github.com/ipython/ipython/pull/12150)**: Highlights the executing node in tracebacks using `executing` via [`stack_data`](https://github.com/alexmojaki/stack_data). - **[`icecream`](https://github.com/gruns/icecream)**: 🍦 Sweet and creamy print debugging. Uses `executing` to identify where `ic` is called and print its arguments. - **[`friendly_traceback`](https://github.com/friendly-traceback/friendly-traceback)**: Uses `stack_data` and `executing` to pinpoint the cause of errors and provide helpful explanations. - **[`python-devtools`](https://github.com/samuelcolvin/python-devtools)**: Uses `executing` for print debugging similar to `icecream`. - **[`sentry_sdk`](https://github.com/getsentry/sentry-python)**: Add the integration `sentry_sdk.integrations.executingExecutingIntegration()` to show the function `__qualname__` in each frame in sentry events. - **[`varname`](https://github.com/pwwang/python-varname)**: Dark magics about variable names in python. Uses `executing` to find where its various magical functions like `varname` and `nameof` are called from. python-executing-2.2.0/development.md000066400000000000000000000024201474076367500177120ustar00rootroot00000000000000# Development workflows & tools executing can check arbitrary python source files: - files in `tests/small_samples` are checked by default - files in `tests/samples` are checked if the `EXECUTING_SLOW_TESTS=1` is set run slow tests in parallel: ~~~ sh env EXECUTING_SLOW_TESTS=1 tox -p ~~~ pytest parmeters can be passed to tox. ~~~ sh env EXECUTING_SLOW_TESTS=1 tox -e py311 -- --sw ~~~ ## generate_small_sample `tox -e genererate_small_sample` can be used to: 1. find python source code which triggers a bug in executing 2. minimize this source code 3. stores this samples in `tests/small_samples` Usage: minimize failures in `tests/samples` ~~~ sh tox -e generate_small_sample-py311 ~~~ search other project for potential problems ~~~ sh tox -e generate_small_sample-py311 -- ~/path/to/python-3.11.0/ ~~~ ## mutmut [mutmut](https://mutmut.readthedocs.io/en/latest/) can be used to mutation testing The weak points in the tests which are discovered by mutmut are normally fixed by developer (creating new test cases). But "tox -e mutmut" combines `generate_small_sample` and mutmut. Tests are generated automatically for issues which are discovered by mutmut. Usage: ``` tox -e mutmut ``` You should have a clean git working directory, because mutmut changes files. python-executing-2.2.0/executing/000077500000000000000000000000001474076367500170435ustar00rootroot00000000000000python-executing-2.2.0/executing/__init__.py000066400000000000000000000014771474076367500211650ustar00rootroot00000000000000""" Get information about what a frame is currently doing. Typical usage: import executing node = executing.Source.executing(frame).node # node will be an AST node or None """ from collections import namedtuple _VersionInfo = namedtuple('_VersionInfo', ('major', 'minor', 'micro')) from .executing import Source, Executing, only, NotOneValueFound, cache, future_flags from ._pytest_utils import is_pytest_compatible try: from .version import __version__ # type: ignore[import] if "dev" in __version__: raise ValueError except Exception: # version.py is auto-generated with the git tag when building __version__ = "???" __version_info__ = _VersionInfo(-1, -1, -1) else: __version_info__ = _VersionInfo(*map(int, __version__.split('.'))) __all__ = ["Source","is_pytest_compatible"] python-executing-2.2.0/executing/_exceptions.py000066400000000000000000000010701474076367500217330ustar00rootroot00000000000000 class KnownIssue(Exception): """ Raised in case of an known problem. Mostly because of cpython bugs. Executing.node gets set to None in this case. """ pass class VerifierFailure(Exception): """ Thrown for an unexpected mapping from instruction to ast node Executing.node gets set to None in this case. """ def __init__(self, title, node, instruction): # type: (object, object, object) -> None self.node = node self.instruction = instruction super().__init__(title) # type: ignore[call-arg] python-executing-2.2.0/executing/_position_node_finder.py000066400000000000000000001036151474076367500237620ustar00rootroot00000000000000import ast import sys import dis from types import CodeType, FrameType from typing import Any, Callable, Iterator, Optional, Sequence, Set, Tuple, Type, Union, cast from .executing import EnhancedAST, NotOneValueFound, Source, only, function_node_types, assert_ from ._exceptions import KnownIssue, VerifierFailure from functools import lru_cache # the code in this module can use all python>=3.11 features def parents(node: EnhancedAST) -> Iterator[EnhancedAST]: while True: if hasattr(node, "parent"): node = node.parent yield node else: break # pragma: no mutate def node_and_parents(node: EnhancedAST) -> Iterator[EnhancedAST]: yield node yield from parents(node) def mangled_name(node: EnhancedAST) -> str: """ Parameters: node: the node which should be mangled name: the name of the node Returns: The mangled name of `node` """ if isinstance(node, ast.Attribute): name = node.attr elif isinstance(node, ast.Name): name = node.id elif isinstance(node, (ast.alias)): name = node.asname or node.name.split(".")[0] elif isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)): name = node.name elif isinstance(node, ast.ExceptHandler): assert node.name name = node.name elif sys.version_info >= (3,12) and isinstance(node,ast.TypeVar): name=node.name else: raise TypeError("no node to mangle for type "+repr(type(node))) if name.startswith("__") and not name.endswith("__"): parent,child=node.parent,node while not (isinstance(parent,ast.ClassDef) and child not in parent.bases): if not hasattr(parent,"parent"): break # pragma: no mutate parent,child=parent.parent,parent else: class_name=parent.name.lstrip("_") if class_name!="": return "_" + class_name + name return name @lru_cache(128) # pragma: no mutate def get_instructions(code: CodeType) -> list[dis.Instruction]: return list(dis.get_instructions(code)) types_cmp_issue_fix = ( ast.IfExp, ast.If, ast.Assert, ast.While, ) types_cmp_issue = types_cmp_issue_fix + ( ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ) op_type_map = { "**": ast.Pow, "*": ast.Mult, "@": ast.MatMult, "//": ast.FloorDiv, "/": ast.Div, "%": ast.Mod, "+": ast.Add, "-": ast.Sub, "<<": ast.LShift, ">>": ast.RShift, "&": ast.BitAnd, "^": ast.BitXor, "|": ast.BitOr, } class PositionNodeFinder(object): """ Mapping bytecode to ast-node based on the source positions, which where introduced in pyhon 3.11. In general every ast-node can be exactly referenced by its begin/end line/col_offset, which is stored in the bytecode. There are only some exceptions for methods and attributes. """ def __init__(self, frame: FrameType, stmts: Set[EnhancedAST], tree: ast.Module, lasti: int, source: Source): self.bc_dict={bc.offset:bc for bc in get_instructions(frame.f_code) } self.source = source self.decorator: Optional[EnhancedAST] = None # work around for https://github.com/python/cpython/issues/96970 while self.opname(lasti) == "CACHE": lasti -= 2 try: # try to map with all match_positions self.result = self.find_node(lasti) except NotOneValueFound: typ: tuple[Type] # LOAD_METHOD could load "".join for long "..."%(...) BinOps # this can only be associated by using all positions if self.opname(lasti) in ( "LOAD_METHOD", "LOAD_ATTR", "STORE_ATTR", "DELETE_ATTR", ): # lineno and col_offset of LOAD_METHOD and *_ATTR instructions get set to the beginning of # the attribute by the python compiler to improved error messages (PEP-657) # we ignore here the start position and try to find the ast-node just by end position and expected node type # This is save, because there can only be one attribute ending at a specific point in the source code. typ = (ast.Attribute,) elif self.opname(lasti) in ("CALL", "CALL_KW"): # A CALL instruction can be a method call, in which case the lineno and col_offset gets changed by the compiler. # Therefore we ignoring here this attributes and searchnig for a Call-node only by end_col_offset and end_lineno. # This is save, because there can only be one method ending at a specific point in the source code. # One closing ) only belongs to one method. typ = (ast.Call,) else: raise self.result = self.find_node( lasti, match_positions=("end_col_offset", "end_lineno"), typ=typ, ) instruction = self.instruction(lasti) assert instruction is not None self.result = self.fix_result(self.result, instruction) self.known_issues(self.result, instruction) self.test_for_decorator(self.result, lasti) # verify if self.decorator is None: self.verify(self.result, instruction) else: assert_(self.decorator in self.result.decorator_list) def test_for_decorator(self, node: EnhancedAST, index: int) -> None: if ( isinstance(node.parent, (ast.ClassDef, function_node_types)) and node in node.parent.decorator_list # type: ignore[attr-defined] ): node_func = node.parent while True: # the generated bytecode looks like follow: # index opname # ------------------ # index-4 PRECALL (only in 3.11) # index-2 CACHE # index CALL <- the call instruction # ... CACHE some CACHE instructions # maybe multiple other bytecode blocks for other decorators # index-4 PRECALL (only in 3.11) # index-2 CACHE # index CALL <- index of the next loop # ... CACHE some CACHE instructions # index+x STORE_* the ast-node of this instruction points to the decorated thing if not ( (self.opname(index - 4) == "PRECALL" or sys.version_info >= (3, 12)) and self.opname(index) == "CALL" ): # pragma: no mutate break # pragma: no mutate index += 2 while self.opname(index) in ("CACHE", "EXTENDED_ARG"): index += 2 if ( self.opname(index).startswith("STORE_") and self.find_node(index) == node_func ): self.result = node_func self.decorator = node return if sys.version_info < (3, 12): index += 4 def fix_result( self, node: EnhancedAST, instruction: dis.Instruction ) -> EnhancedAST: if ( sys.version_info >= (3, 12, 5) and instruction.opname in ("GET_ITER", "FOR_ITER") and isinstance(node.parent, ast.For) and node is node.parent.iter ): # node positions have changed in 3.12.5 # https://github.com/python/cpython/issues/93691 # `for` calls __iter__ and __next__ during execution, the calling # expression of these calls was the ast.For node since cpython 3.11 (see test_iter). # cpython 3.12.5 changed this to the `iter` node of the loop, to make tracebacks easier to read. # This keeps backward compatibility with older executing versions. # there are also cases like: # # for a in iter(l): pass # # where `iter(l)` would be otherwise the resulting node for the `iter()` call and the __iter__ call of the for implementation. # keeping the old behaviour makes it possible to distinguish both cases. return node.parent if ( sys.version_info >= (3, 12, 6) and instruction.opname in ("GET_ITER", "FOR_ITER") and isinstance( node.parent.parent, (ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp), ) and isinstance(node.parent,ast.comprehension) and node is node.parent.iter ): # same as above but only for comprehensions, see: # https://github.com/python/cpython/issues/123142 return node.parent.parent if sys.version_info >= (3, 12,6) and instruction.opname == "CALL": before = self.instruction_before(instruction) if ( before is not None and before.opname == "LOAD_CONST" and before.positions == instruction.positions and isinstance(node.parent, ast.withitem) and node is node.parent.context_expr ): # node positions for with-statements have change # and is now equal to the expression which created the context-manager # https://github.com/python/cpython/pull/120763 # with context_manager: # ... # but there is one problem to distinguish call-expressions from __exit__() # with context_manager(): # ... # the call for __exit__ # 20 1:5 1:22 LOAD_CONST(None) # 22 1:5 1:22 LOAD_CONST(None) # 24 1:5 1:22 LOAD_CONST(None) # 26 1:5 1:22 CALL() # <-- same source range as context_manager() # but we can use the fact that the previous load for None # has the same source range as the call, wich can not happen for normal calls # we return the same ast.With statement at the and to preserve backward compatibility return node.parent.parent if ( sys.version_info >= (3, 12,6) and instruction.opname == "BEFORE_WITH" and isinstance(node.parent, ast.withitem) and node is node.parent.context_expr ): # handle positions changes for __enter__ return node.parent.parent return node def known_issues(self, node: EnhancedAST, instruction: dis.Instruction) -> None: if instruction.opname in ("COMPARE_OP", "IS_OP", "CONTAINS_OP") and isinstance( node, types_cmp_issue ): if isinstance(node, types_cmp_issue_fix): # this is a workaround for https://github.com/python/cpython/issues/95921 # we can fix cases with only on comparison inside the test condition # # we can not fix cases like: # if a 1 ] assert_(comparisons, "expected at least one comparison") if len(comparisons) == 1: node = self.result = cast(EnhancedAST, comparisons[0]) else: raise KnownIssue( "multiple chain comparison inside %s can not be fixed" % (node) ) else: # Comprehension and generators get not fixed for now. raise KnownIssue("chain comparison inside %s can not be fixed" % (node)) if ( sys.version_info[:3] == (3, 11, 1) and isinstance(node, ast.Compare) and instruction.opname == "CALL" and any(isinstance(n, ast.Assert) for n in node_and_parents(node)) ): raise KnownIssue( "known bug in 3.11.1 https://github.com/python/cpython/issues/95921" ) if isinstance(node, ast.Assert): # pytest assigns the position of the assertion to all expressions of the rewritten assertion. # All the rewritten expressions get mapped to ast.Assert, which is the wrong ast-node. # We don't report this wrong result. raise KnownIssue("assert") if any(isinstance(n, ast.pattern) for n in node_and_parents(node)): # TODO: investigate raise KnownIssue("pattern matching ranges seems to be wrong") if ( sys.version_info >= (3, 12) and isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == "super" ): # super is optimized to some instructions which do not map nicely to a Call # find the enclosing function func = node.parent while hasattr(func, "parent") and not isinstance( func, (ast.AsyncFunctionDef, ast.FunctionDef) ): func = func.parent # get the first function argument (self/cls) first_arg = None if hasattr(func, "args"): args = [*func.args.posonlyargs, *func.args.args] if args: first_arg = args[0].arg if (instruction.opname, instruction.argval) in [ ("LOAD_DEREF", "__class__"), ("LOAD_FAST", first_arg), ("LOAD_DEREF", first_arg), ]: raise KnownIssue("super optimization") if self.is_except_cleanup(instruction, node): raise KnownIssue("exeption cleanup does not belong to the last node in a except block") if instruction.opname == "STORE_NAME" and instruction.argval == "__classcell__": # handle stores to __classcell__ as KnownIssue, # because they get complicated if they are used in `if` or `for` loops # example: # # class X: # # ... something # if some_condition: # def method(self): # super() # # The `STORE_NAME` instruction gets mapped to the `ast.If` node, # because it is the last element in the class. # This last element could be anything and gets dificult to verify. raise KnownIssue("store __classcell__") if ( instruction.opname == "CALL" and not isinstance(node,ast.Call) and any(isinstance(p, ast.Assert) for p in parents(node)) and sys.version_info >= (3, 11, 2) ): raise KnownIssue("exception generation maps to condition") if sys.version_info >= (3, 13): if instruction.opname in ( "STORE_FAST_STORE_FAST", "STORE_FAST_LOAD_FAST", "LOAD_FAST_LOAD_FAST", ): raise KnownIssue(f"can not map {instruction.opname} to two ast nodes") if instruction.opname == "LOAD_FAST" and instruction.argval == "__class__": # example: # class T: # def a(): # super() # some_node # <- there is a LOAD_FAST for this node because we use super() raise KnownIssue( f"loading of __class__ is accociated with a random node at the end of a class if you use super()" ) if ( instruction.opname == "COMPARE_OP" and isinstance(node, ast.UnaryOp) and isinstance(node.operand,ast.Compare) and isinstance(node.op, ast.Not) ): # work around for # https://github.com/python/cpython/issues/114671 self.result = node.operand @staticmethod def is_except_cleanup(inst: dis.Instruction, node: EnhancedAST) -> bool: if inst.opname not in ( "STORE_NAME", "STORE_FAST", "STORE_DEREF", "STORE_GLOBAL", "DELETE_NAME", "DELETE_FAST", "DELETE_DEREF", "DELETE_GLOBAL", ): return False # This bytecode does something exception cleanup related. # The position of the instruciton seems to be something in the last ast-node of the ExceptHandler # this could be a bug, but it might not be observable in normal python code. # example: # except Exception as exc: # enum_member._value_ = value # other example: # STORE_FAST of e was mapped to Constant(value=False) # except OSError as e: # if not _ignore_error(e): # raise # return False # STORE_FAST of msg was mapped to print(...) # except TypeError as msg: # print("Sorry:", msg, file=file) if ( isinstance(node, ast.Name) and isinstance(node.ctx,ast.Store) and inst.opname.startswith("STORE_") and mangled_name(node) == inst.argval ): # Storing the variable is valid and no exception cleanup, if the name is correct return False if ( isinstance(node, ast.Name) and isinstance(node.ctx,ast.Del) and inst.opname.startswith("DELETE_") and mangled_name(node) == inst.argval ): # Deleting the variable is valid and no exception cleanup, if the name is correct return False return any( isinstance(n, ast.ExceptHandler) and n.name and mangled_name(n) == inst.argval for n in parents(node) ) def verify(self, node: EnhancedAST, instruction: dis.Instruction) -> None: """ checks if this node could gererate this instruction """ op_name = instruction.opname extra_filter: Callable[[EnhancedAST], bool] = lambda e: True ctx: Type = type(None) def inst_match(opnames: Union[str, Sequence[str]], **kwargs: Any) -> bool: """ match instruction Parameters: opnames: (str|Seq[str]): inst.opname has to be equal to or in `opname` **kwargs: every arg has to match inst.arg Returns: True if all conditions match the instruction """ if isinstance(opnames, str): opnames = [opnames] return instruction.opname in opnames and kwargs == { k: getattr(instruction, k) for k in kwargs } def node_match(node_type: Union[Type, Tuple[Type, ...]], **kwargs: Any) -> bool: """ match the ast-node Parameters: node_type: type of the node **kwargs: every `arg` has to be equal `node.arg` or `node.arg` has to be an instance of `arg` if it is a type. """ return isinstance(node, node_type) and all( isinstance(getattr(node, k), v) if isinstance(v, type) else getattr(node, k) == v for k, v in kwargs.items() ) if op_name == "CACHE": return if inst_match("CALL") and node_match((ast.With, ast.AsyncWith)): # call to context.__exit__ return if inst_match(("CALL", "LOAD_FAST")) and node_match( (ast.ListComp, ast.GeneratorExp, ast.SetComp, ast.DictComp) ): # call to the generator function return if ( sys.version_info >= (3, 12) and inst_match(("LOAD_FAST_AND_CLEAR", "STORE_FAST")) and node_match((ast.ListComp, ast.SetComp, ast.DictComp)) ): return if inst_match(("CALL", "CALL_FUNCTION_EX")) and node_match( (ast.ClassDef, ast.Call) ): return if inst_match(("COMPARE_OP", "IS_OP", "CONTAINS_OP")) and node_match( ast.Compare ): return if inst_match("LOAD_NAME", argval="__annotations__") and node_match( ast.AnnAssign ): return if ( ( inst_match("LOAD_METHOD", argval="join") or inst_match("LOAD_ATTR", argval="join") # 3.12 or inst_match(("CALL", "BUILD_STRING")) ) and node_match(ast.BinOp, left=ast.Constant, op=ast.Mod) and isinstance(cast(ast.Constant, cast(ast.BinOp, node).left).value, str) ): # "..."%(...) uses "".join return if inst_match("STORE_SUBSCR") and node_match(ast.AnnAssign): # data: int return if inst_match(("DELETE_NAME", "DELETE_FAST")) and node_match( ast.Name, id=instruction.argval, ctx=ast.Del ): return if inst_match("BUILD_STRING") and ( node_match(ast.JoinedStr) or node_match(ast.BinOp, op=ast.Mod) ): return if inst_match(("BEFORE_WITH","WITH_EXCEPT_START")) and node_match(ast.With): return if inst_match(("STORE_NAME", "STORE_GLOBAL"), argval="__doc__") and node_match( ast.Constant ): # store docstrings return if ( inst_match(("STORE_NAME", "STORE_FAST", "STORE_GLOBAL", "STORE_DEREF")) and node_match(ast.ExceptHandler) and instruction.argval == mangled_name(node) ): # store exception in variable return if ( inst_match(("STORE_NAME", "STORE_FAST", "STORE_DEREF", "STORE_GLOBAL")) and node_match((ast.Import, ast.ImportFrom)) and any(mangled_name(cast(EnhancedAST, alias)) == instruction.argval for alias in cast(ast.Import, node).names) ): # store imported module in variable return if ( inst_match(("STORE_FAST", "STORE_DEREF", "STORE_NAME", "STORE_GLOBAL")) and ( node_match((ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)) or node_match( ast.Name, ctx=ast.Store, ) ) and instruction.argval == mangled_name(node) ): return if False: # TODO: match expressions are not supported for now if inst_match(("STORE_FAST", "STORE_NAME")) and node_match( ast.MatchAs, name=instruction.argval ): return if inst_match("COMPARE_OP", argval="==") and node_match(ast.MatchSequence): return if inst_match("COMPARE_OP", argval="==") and node_match(ast.MatchValue): return if inst_match("BINARY_OP") and node_match( ast.AugAssign, op=op_type_map[instruction.argrepr.removesuffix("=")] ): # a+=5 return if node_match(ast.Attribute, ctx=ast.Del) and inst_match( "DELETE_ATTR", argval=mangled_name(node) ): return if inst_match( ( "JUMP_IF_TRUE_OR_POP", "JUMP_IF_FALSE_OR_POP", "POP_JUMP_IF_TRUE", "POP_JUMP_IF_FALSE", ) ) and node_match(ast.BoolOp): # and/or short circuit return if inst_match("DELETE_SUBSCR") and node_match(ast.Subscript, ctx=ast.Del): return if ( node_match(ast.Name, ctx=ast.Load) or ( node_match(ast.Name, ctx=ast.Store) and isinstance(node.parent, ast.AugAssign) ) ) and inst_match( ( "LOAD_NAME", "LOAD_FAST", "LOAD_FAST_CHECK", "LOAD_GLOBAL", "LOAD_DEREF", "LOAD_FROM_DICT_OR_DEREF", ), argval=mangled_name(node), ): return if node_match(ast.Name, ctx=ast.Del) and inst_match( ("DELETE_NAME", "DELETE_GLOBAL", "DELETE_DEREF"), argval=mangled_name(node) ): return if node_match(ast.Constant) and inst_match( "LOAD_CONST", argval=cast(ast.Constant, node).value ): return if node_match( (ast.ListComp, ast.SetComp, ast.DictComp, ast.GeneratorExp, ast.For) ) and inst_match(("GET_ITER", "FOR_ITER")): return if sys.version_info >= (3, 12): if node_match(ast.UnaryOp, op=ast.UAdd) and inst_match( "CALL_INTRINSIC_1", argrepr="INTRINSIC_UNARY_POSITIVE" ): return if node_match(ast.Subscript) and inst_match("BINARY_SLICE"): return if node_match(ast.ImportFrom) and inst_match( "CALL_INTRINSIC_1", argrepr="INTRINSIC_IMPORT_STAR" ): return if ( node_match(ast.Yield) or isinstance(node.parent, ast.GeneratorExp) ) and inst_match("CALL_INTRINSIC_1", argrepr="INTRINSIC_ASYNC_GEN_WRAP"): return if node_match(ast.Name) and inst_match("LOAD_DEREF",argval="__classdict__"): return if node_match(ast.TypeVar) and ( inst_match("CALL_INTRINSIC_1", argrepr="INTRINSIC_TYPEVAR") or inst_match( "CALL_INTRINSIC_2", argrepr="INTRINSIC_TYPEVAR_WITH_BOUND" ) or inst_match( "CALL_INTRINSIC_2", argrepr="INTRINSIC_TYPEVAR_WITH_CONSTRAINTS" ) or inst_match(("STORE_FAST", "STORE_DEREF"), argrepr=mangled_name(node)) ): return if node_match(ast.TypeVarTuple) and ( inst_match("CALL_INTRINSIC_1", argrepr="INTRINSIC_TYPEVARTUPLE") or inst_match(("STORE_FAST", "STORE_DEREF"), argrepr=node.name) ): return if node_match(ast.ParamSpec) and ( inst_match("CALL_INTRINSIC_1", argrepr="INTRINSIC_PARAMSPEC") or inst_match(("STORE_FAST", "STORE_DEREF"), argrepr=node.name)): return if node_match(ast.TypeAlias): if( inst_match("CALL_INTRINSIC_1", argrepr="INTRINSIC_TYPEALIAS") or inst_match( ("STORE_NAME", "STORE_FAST", "STORE_DEREF"), argrepr=node.name.id ) or inst_match("CALL") ): return if node_match(ast.ClassDef) and node.type_params: if inst_match( ("STORE_DEREF", "LOAD_DEREF", "LOAD_FROM_DICT_OR_DEREF"), argrepr=".type_params", ): return if inst_match(("STORE_FAST", "LOAD_FAST"), argrepr=".generic_base"): return if inst_match( "CALL_INTRINSIC_1", argrepr="INTRINSIC_SUBSCRIPT_GENERIC" ): return if inst_match("LOAD_DEREF",argval="__classdict__"): return if node_match((ast.FunctionDef,ast.AsyncFunctionDef)) and node.type_params: if inst_match("CALL"): return if inst_match( "CALL_INTRINSIC_2", argrepr="INTRINSIC_SET_FUNCTION_TYPE_PARAMS" ): return if inst_match("LOAD_FAST",argval=".defaults"): return if inst_match("LOAD_FAST",argval=".kwdefaults"): return if inst_match("STORE_NAME", argval="__classdictcell__"): # this is a general thing return # f-strings if node_match(ast.JoinedStr) and ( inst_match("LOAD_ATTR", argval="join") or inst_match(("LIST_APPEND", "CALL")) ): return if node_match(ast.FormattedValue) and inst_match("FORMAT_VALUE"): return if sys.version_info >= (3, 13): if inst_match("NOP"): return if inst_match("TO_BOOL") and node_match(ast.BoolOp): return if inst_match("CALL_KW") and node_match((ast.Call, ast.ClassDef)): return if inst_match("LOAD_FAST", argval=".type_params"): return if inst_match("LOAD_FAST", argval="__classdict__"): return if inst_match("LOAD_FAST") and node_match( ( ast.FunctionDef, ast.ClassDef, ast.TypeAlias, ast.TypeVar, ast.Lambda, ast.AsyncFunctionDef, ) ): # These are loads for closure variables. # It is difficult to check that this is actually closure variable, see: # https://github.com/alexmojaki/executing/pull/80#discussion_r1716027317 return if ( inst_match("LOAD_FAST") and node_match(ast.TypeAlias) and node.name.id == instruction.argval ): return if inst_match("STORE_NAME",argval="__static_attributes__"): # the node is the first node in the body return if inst_match("LOAD_FAST") and isinstance(node.parent,ast.TypeVar): return # old verifier typ: Type = type(None) op_type: Type = type(None) if op_name.startswith(("BINARY_SUBSCR", "SLICE+")): typ = ast.Subscript ctx = ast.Load elif op_name.startswith("BINARY_"): typ = ast.BinOp op_type = op_type_map[instruction.argrepr] extra_filter = lambda e: isinstance(cast(ast.BinOp, e).op, op_type) elif op_name.startswith("UNARY_"): typ = ast.UnaryOp op_type = dict( UNARY_POSITIVE=ast.UAdd, UNARY_NEGATIVE=ast.USub, UNARY_NOT=ast.Not, UNARY_INVERT=ast.Invert, )[op_name] extra_filter = lambda e: isinstance(cast(ast.UnaryOp, e).op, op_type) elif op_name in ("LOAD_ATTR", "LOAD_METHOD", "LOOKUP_METHOD","LOAD_SUPER_ATTR"): typ = ast.Attribute ctx = ast.Load extra_filter = lambda e: mangled_name(e) == instruction.argval elif op_name in ( "LOAD_NAME", "LOAD_GLOBAL", "LOAD_FAST", "LOAD_DEREF", "LOAD_CLASSDEREF", ): typ = ast.Name ctx = ast.Load extra_filter = lambda e: cast(ast.Name, e).id == instruction.argval elif op_name in ("COMPARE_OP", "IS_OP", "CONTAINS_OP"): typ = ast.Compare extra_filter = lambda e: len(cast(ast.Compare, e).ops) == 1 elif op_name.startswith(("STORE_SLICE", "STORE_SUBSCR")): ctx = ast.Store typ = ast.Subscript elif op_name.startswith("STORE_ATTR"): ctx = ast.Store typ = ast.Attribute extra_filter = lambda e: mangled_name(e) == instruction.argval node_ctx = getattr(node, "ctx", None) ctx_match = ( ctx is not type(None) or not hasattr(node, "ctx") or isinstance(node_ctx, ctx) ) # check for old verifier if isinstance(node, typ) and ctx_match and extra_filter(node): return # generate error title = "ast.%s is not created from %s" % ( type(node).__name__, instruction.opname, ) raise VerifierFailure(title, node, instruction) def instruction(self, index: int) -> Optional[dis.Instruction]: return self.bc_dict.get(index,None) def instruction_before( self, instruction: dis.Instruction ) -> Optional[dis.Instruction]: return self.bc_dict.get(instruction.offset - 2, None) def opname(self, index: int) -> str: i=self.instruction(index) if i is None: return "CACHE" return i.opname extra_node_types=() if sys.version_info >= (3,12): extra_node_types = (ast.type_param,) def find_node( self, index: int, match_positions: Sequence[str] = ( "lineno", "end_lineno", "col_offset", "end_col_offset", ), typ: tuple[Type, ...] = ( ast.expr, ast.stmt, ast.excepthandler, ast.pattern, *extra_node_types, ), ) -> EnhancedAST: instruction = self.instruction(index) assert instruction is not None position = instruction.positions assert position is not None and position.lineno is not None return only( cast(EnhancedAST, node) for node in self.source._nodes_by_line[position.lineno] if isinstance(node, typ) if not isinstance(node, ast.Expr) # matchvalue.value has the same positions as matchvalue themself, so we exclude ast.MatchValue if not isinstance(node, ast.MatchValue) if all( getattr(position, attr) == getattr(node, attr) for attr in match_positions ) ) python-executing-2.2.0/executing/_pytest_utils.py000066400000000000000000000005421474076367500223250ustar00rootroot00000000000000import sys def is_pytest_compatible() -> bool: """ returns true if executing can be used for expressions inside assert statements which are rewritten by pytest """ if sys.version_info < (3, 11): return False try: import pytest except ImportError: return False return pytest.version_tuple >= (8, 3, 4) python-executing-2.2.0/executing/executing.py000066400000000000000000001223621474076367500214160ustar00rootroot00000000000000""" MIT License Copyright (c) 2021 Alex Hall Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ import __future__ import ast import dis import inspect import io import linecache import re import sys import types from collections import defaultdict from copy import deepcopy from functools import lru_cache from itertools import islice from itertools import zip_longest from operator import attrgetter from pathlib import Path from threading import RLock from tokenize import detect_encoding from typing import TYPE_CHECKING, Any, Callable, Dict, Iterable, Iterator, List, Optional, Sequence, Set, Sized, Tuple, \ Type, TypeVar, Union, cast if TYPE_CHECKING: # pragma: no cover from asttokens import ASTTokens, ASTText from asttokens.asttokens import ASTTextBase function_node_types = (ast.FunctionDef, ast.AsyncFunctionDef) # type: Tuple[Type, ...] cache = lru_cache(maxsize=None) # Type class used to expand out the definition of AST to include fields added by this library # It's not actually used for anything other than type checking though! class EnhancedAST(ast.AST): parent = None # type: EnhancedAST class Instruction(dis.Instruction): lineno = None # type: int # Type class used to expand out the definition of AST to include fields added by this library # It's not actually used for anything other than type checking though! class EnhancedInstruction(Instruction): _copied = None # type: bool def assert_(condition, message=""): # type: (Any, str) -> None """ Like an assert statement, but unaffected by -O :param condition: value that is expected to be truthy :type message: Any """ if not condition: raise AssertionError(str(message)) def get_instructions(co): # type: (types.CodeType) -> Iterator[EnhancedInstruction] lineno = co.co_firstlineno for inst in dis.get_instructions(co): inst = cast(EnhancedInstruction, inst) lineno = inst.starts_line or lineno assert_(lineno) inst.lineno = lineno yield inst TESTING = 0 class NotOneValueFound(Exception): def __init__(self,msg,values=[]): # type: (str, Sequence) -> None self.values=values super(NotOneValueFound,self).__init__(msg) T = TypeVar('T') def only(it): # type: (Iterable[T]) -> T if isinstance(it, Sized): if len(it) != 1: raise NotOneValueFound('Expected one value, found %s' % len(it)) # noinspection PyTypeChecker return list(it)[0] lst = tuple(islice(it, 2)) if len(lst) == 0: raise NotOneValueFound('Expected one value, found 0') if len(lst) > 1: raise NotOneValueFound('Expected one value, found several',lst) return lst[0] class Source(object): """ The source code of a single file and associated metadata. The main method of interest is the classmethod `executing(frame)`. If you want an instance of this class, don't construct it. Ideally use the classmethod `for_frame(frame)`. If you don't have a frame, use `for_filename(filename [, module_globals])`. These methods cache instances by filename, so at most one instance exists per filename. Attributes: - filename - text - lines - tree: AST parsed from text, or None if text is not valid Python All nodes in the tree have an extra `parent` attribute Other methods of interest: - statements_at_line - asttokens - code_qualname """ def __init__(self, filename, lines): # type: (str, Sequence[str]) -> None """ Don't call this constructor, see the class docstring. """ self.filename = filename self.text = ''.join(lines) self.lines = [line.rstrip('\r\n') for line in lines] self._nodes_by_line = defaultdict(list) self.tree = None self._qualnames = {} self._asttokens = None # type: Optional[ASTTokens] self._asttext = None # type: Optional[ASTText] try: self.tree = ast.parse(self.text, filename=filename) except (SyntaxError, ValueError): pass else: for node in ast.walk(self.tree): for child in ast.iter_child_nodes(node): cast(EnhancedAST, child).parent = cast(EnhancedAST, node) for lineno in node_linenos(node): self._nodes_by_line[lineno].append(node) visitor = QualnameVisitor() visitor.visit(self.tree) self._qualnames = visitor.qualnames @classmethod def for_frame(cls, frame, use_cache=True): # type: (types.FrameType, bool) -> "Source" """ Returns the `Source` object corresponding to the file the frame is executing in. """ return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {}, use_cache) @classmethod def for_filename( cls, filename, module_globals=None, use_cache=True, # noqa no longer used ): # type: (Union[str, Path], Optional[Dict[str, Any]], bool) -> "Source" if isinstance(filename, Path): filename = str(filename) def get_lines(): # type: () -> List[str] return linecache.getlines(cast(str, filename), module_globals) # Save the current linecache entry, then ensure the cache is up to date. entry = linecache.cache.get(filename) # type: ignore[attr-defined] linecache.checkcache(filename) lines = get_lines() if entry is not None and not lines: # There was an entry, checkcache removed it, and nothing replaced it. # This means the file wasn't simply changed (because the `lines` wouldn't be empty) # but rather the file was found not to exist, probably because `filename` was fake. # Restore the original entry so that we still have something. linecache.cache[filename] = entry # type: ignore[attr-defined] lines = get_lines() return cls._for_filename_and_lines(filename, tuple(lines)) @classmethod def _for_filename_and_lines(cls, filename, lines): # type: (str, Sequence[str]) -> "Source" source_cache = cls._class_local('__source_cache_with_lines', {}) # type: Dict[Tuple[str, Sequence[str]], Source] try: return source_cache[(filename, lines)] except KeyError: pass result = source_cache[(filename, lines)] = cls(filename, lines) return result @classmethod def lazycache(cls, frame): # type: (types.FrameType) -> None linecache.lazycache(frame.f_code.co_filename, frame.f_globals) @classmethod def executing(cls, frame_or_tb): # type: (Union[types.TracebackType, types.FrameType]) -> "Executing" """ Returns an `Executing` object representing the operation currently executing in the given frame or traceback object. """ if isinstance(frame_or_tb, types.TracebackType): # https://docs.python.org/3/reference/datamodel.html#traceback-objects # "tb_lineno gives the line number where the exception occurred; # tb_lasti indicates the precise instruction. # The line number and last instruction in the traceback may differ # from the line number of its frame object # if the exception occurred in a try statement with no matching except clause # or with a finally clause." tb = frame_or_tb frame = tb.tb_frame lineno = tb.tb_lineno lasti = tb.tb_lasti else: frame = frame_or_tb lineno = frame.f_lineno lasti = frame.f_lasti code = frame.f_code key = (code, id(code), lasti) executing_cache = cls._class_local('__executing_cache', {}) # type: Dict[Tuple[types.CodeType, int, int], Any] args = executing_cache.get(key) if not args: node = stmts = decorator = None source = cls.for_frame(frame) tree = source.tree if tree: try: stmts = source.statements_at_line(lineno) if stmts: if is_ipython_cell_code(code): decorator, node = find_node_ipython(frame, lasti, stmts, source) else: node_finder = NodeFinder(frame, stmts, tree, lasti, source) node = node_finder.result decorator = node_finder.decorator if node: new_stmts = {statement_containing_node(node)} assert_(new_stmts <= stmts) stmts = new_stmts except Exception: if TESTING: raise executing_cache[key] = args = source, node, stmts, decorator return Executing(frame, *args) @classmethod def _class_local(cls, name, default): # type: (str, T) -> T """ Returns an attribute directly associated with this class (as opposed to subclasses), setting default if necessary """ # classes have a mappingproxy preventing us from using setdefault result = cls.__dict__.get(name, default) setattr(cls, name, result) return result @cache def statements_at_line(self, lineno): # type: (int) -> Set[EnhancedAST] """ Returns the statement nodes overlapping the given line. Returns at most one statement unless semicolons are present. If the `text` attribute is not valid python, meaning `tree` is None, returns an empty set. Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)` should return at least one statement. """ return { statement_containing_node(node) for node in self._nodes_by_line[lineno] } def asttext(self): # type: () -> ASTText """ Returns an ASTText object for getting the source of specific AST nodes. See http://asttokens.readthedocs.io/en/latest/api-index.html """ from asttokens import ASTText # must be installed separately if self._asttext is None: self._asttext = ASTText(self.text, tree=self.tree, filename=self.filename) return self._asttext def asttokens(self): # type: () -> ASTTokens """ Returns an ASTTokens object for getting the source of specific AST nodes. See http://asttokens.readthedocs.io/en/latest/api-index.html """ import asttokens # must be installed separately if self._asttokens is None: if hasattr(asttokens, 'ASTText'): self._asttokens = self.asttext().asttokens else: # pragma: no cover self._asttokens = asttokens.ASTTokens(self.text, tree=self.tree, filename=self.filename) return self._asttokens def _asttext_base(self): # type: () -> ASTTextBase import asttokens # must be installed separately if hasattr(asttokens, 'ASTText'): return self.asttext() else: # pragma: no cover return self.asttokens() @staticmethod def decode_source(source): # type: (Union[str, bytes]) -> str if isinstance(source, bytes): encoding = Source.detect_encoding(source) return source.decode(encoding) else: return source @staticmethod def detect_encoding(source): # type: (bytes) -> str return detect_encoding(io.BytesIO(source).readline)[0] def code_qualname(self, code): # type: (types.CodeType) -> str """ Imitates the __qualname__ attribute of functions for code objects. Given: - A function `func` - A frame `frame` for an execution of `func`, meaning: `frame.f_code is func.__code__` `Source.for_frame(frame).code_qualname(frame.f_code)` will be equal to `func.__qualname__`*. Works for Python 2 as well, where of course no `__qualname__` attribute exists. Falls back to `code.co_name` if there is no appropriate qualname. Based on https://github.com/wbolster/qualname (* unless `func` is a lambda nested inside another lambda on the same line, in which case the outer lambda's qualname will be returned for the codes of both lambdas) """ assert_(code.co_filename == self.filename) return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name) class Executing(object): """ Information about the operation a frame is currently executing. Generally you will just want `node`, which is the AST node being executed, or None if it's unknown. If a decorator is currently being called, then: - `node` is a function or class definition - `decorator` is the expression in `node.decorator_list` being called - `statements == {node}` """ def __init__(self, frame, source, node, stmts, decorator): # type: (types.FrameType, Source, EnhancedAST, Set[ast.stmt], Optional[EnhancedAST]) -> None self.frame = frame self.source = source self.node = node self.statements = stmts self.decorator = decorator def code_qualname(self): # type: () -> str return self.source.code_qualname(self.frame.f_code) def text(self): # type: () -> str return self.source._asttext_base().get_text(self.node) def text_range(self): # type: () -> Tuple[int, int] return self.source._asttext_base().get_text_range(self.node) class QualnameVisitor(ast.NodeVisitor): def __init__(self): # type: () -> None super(QualnameVisitor, self).__init__() self.stack = [] # type: List[str] self.qualnames = {} # type: Dict[Tuple[str, int], str] def add_qualname(self, node, name=None): # type: (ast.AST, Optional[str]) -> None name = name or node.name # type: ignore[attr-defined] self.stack.append(name) if getattr(node, 'decorator_list', ()): lineno = node.decorator_list[0].lineno # type: ignore[attr-defined] else: lineno = node.lineno # type: ignore[attr-defined] self.qualnames.setdefault((name, lineno), ".".join(self.stack)) def visit_FunctionDef(self, node, name=None): # type: (ast.AST, Optional[str]) -> None assert isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.Lambda)), node self.add_qualname(node, name) self.stack.append('') children = [] # type: Sequence[ast.AST] if isinstance(node, ast.Lambda): children = [node.body] else: children = node.body for child in children: self.visit(child) self.stack.pop() self.stack.pop() # Find lambdas in the function definition outside the body, # e.g. decorators or default arguments # Based on iter_child_nodes for field, child in ast.iter_fields(node): if field == 'body': continue if isinstance(child, ast.AST): self.visit(child) elif isinstance(child, list): for grandchild in child: if isinstance(grandchild, ast.AST): self.visit(grandchild) visit_AsyncFunctionDef = visit_FunctionDef def visit_Lambda(self, node): # type: (ast.AST) -> None assert isinstance(node, ast.Lambda) self.visit_FunctionDef(node, '') def visit_ClassDef(self, node): # type: (ast.AST) -> None assert isinstance(node, ast.ClassDef) self.add_qualname(node) self.generic_visit(node) self.stack.pop() future_flags = sum( getattr(__future__, fname).compiler_flag for fname in __future__.all_feature_names ) def compile_similar_to(source, matching_code): # type: (ast.Module, types.CodeType) -> Any return compile( source, matching_code.co_filename, 'exec', flags=future_flags & matching_code.co_flags, dont_inherit=True, ) sentinel = 'io8urthglkjdghvljusketgIYRFYUVGHFRTBGVHKGF78678957647698' def is_rewritten_by_pytest(code): # type: (types.CodeType) -> bool return any( bc.opname != "LOAD_CONST" and isinstance(bc.argval,str) and bc.argval.startswith("@py") for bc in get_instructions(code) ) class SentinelNodeFinder(object): result = None # type: EnhancedAST def __init__(self, frame, stmts, tree, lasti, source): # type: (types.FrameType, Set[EnhancedAST], ast.Module, int, Source) -> None assert_(stmts) self.frame = frame self.tree = tree self.code = code = frame.f_code self.is_pytest = is_rewritten_by_pytest(code) if self.is_pytest: self.ignore_linenos = frozenset(assert_linenos(tree)) else: self.ignore_linenos = frozenset() self.decorator = None self.instruction = instruction = self.get_actual_current_instruction(lasti) op_name = instruction.opname extra_filter = lambda e: True # type: Callable[[Any], bool] ctx = type(None) # type: Type typ = type(None) # type: Type if op_name.startswith('CALL_'): typ = ast.Call elif op_name.startswith(('BINARY_SUBSCR', 'SLICE+')): typ = ast.Subscript ctx = ast.Load elif op_name.startswith('BINARY_'): typ = ast.BinOp op_type = dict( BINARY_POWER=ast.Pow, BINARY_MULTIPLY=ast.Mult, BINARY_MATRIX_MULTIPLY=getattr(ast, "MatMult", ()), BINARY_FLOOR_DIVIDE=ast.FloorDiv, BINARY_TRUE_DIVIDE=ast.Div, BINARY_MODULO=ast.Mod, BINARY_ADD=ast.Add, BINARY_SUBTRACT=ast.Sub, BINARY_LSHIFT=ast.LShift, BINARY_RSHIFT=ast.RShift, BINARY_AND=ast.BitAnd, BINARY_XOR=ast.BitXor, BINARY_OR=ast.BitOr, )[op_name] extra_filter = lambda e: isinstance(e.op, op_type) elif op_name.startswith('UNARY_'): typ = ast.UnaryOp op_type = dict( UNARY_POSITIVE=ast.UAdd, UNARY_NEGATIVE=ast.USub, UNARY_NOT=ast.Not, UNARY_INVERT=ast.Invert, )[op_name] extra_filter = lambda e: isinstance(e.op, op_type) elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'): typ = ast.Attribute ctx = ast.Load extra_filter = lambda e: attr_names_match(e.attr, instruction.argval) elif op_name in ('LOAD_NAME', 'LOAD_GLOBAL', 'LOAD_FAST', 'LOAD_DEREF', 'LOAD_CLASSDEREF'): typ = ast.Name ctx = ast.Load extra_filter = lambda e: e.id == instruction.argval elif op_name in ('COMPARE_OP', 'IS_OP', 'CONTAINS_OP'): typ = ast.Compare extra_filter = lambda e: len(e.ops) == 1 elif op_name.startswith(('STORE_SLICE', 'STORE_SUBSCR')): ctx = ast.Store typ = ast.Subscript elif op_name.startswith('STORE_ATTR'): ctx = ast.Store typ = ast.Attribute extra_filter = lambda e: attr_names_match(e.attr, instruction.argval) else: raise RuntimeError(op_name) with lock: exprs = { cast(EnhancedAST, node) for stmt in stmts for node in ast.walk(stmt) if isinstance(node, typ) if isinstance(getattr(node, "ctx", None), ctx) if extra_filter(node) if statement_containing_node(node) == stmt } if ctx == ast.Store: # No special bytecode tricks here. # We can handle multiple assigned attributes with different names, # but only one assigned subscript. self.result = only(exprs) return matching = list(self.matching_nodes(exprs)) if not matching and typ == ast.Call: self.find_decorator(stmts) else: self.result = only(matching) def find_decorator(self, stmts): # type: (Union[List[EnhancedAST], Set[EnhancedAST]]) -> None stmt = only(stmts) assert_(isinstance(stmt, (ast.ClassDef, function_node_types))) decorators = stmt.decorator_list # type: ignore[attr-defined] assert_(decorators) line_instructions = [ inst for inst in self.clean_instructions(self.code) if inst.lineno == self.frame.f_lineno ] last_decorator_instruction_index = [ i for i, inst in enumerate(line_instructions) if inst.opname == "CALL_FUNCTION" ][-1] assert_( line_instructions[last_decorator_instruction_index + 1].opname.startswith( "STORE_" ) ) decorator_instructions = line_instructions[ last_decorator_instruction_index - len(decorators) + 1 : last_decorator_instruction_index + 1 ] assert_({inst.opname for inst in decorator_instructions} == {"CALL_FUNCTION"}) decorator_index = decorator_instructions.index(self.instruction) decorator = decorators[::-1][decorator_index] self.decorator = decorator self.result = stmt def clean_instructions(self, code): # type: (types.CodeType) -> List[EnhancedInstruction] return [ inst for inst in get_instructions(code) if inst.opname not in ("EXTENDED_ARG", "NOP") if inst.lineno not in self.ignore_linenos ] def get_original_clean_instructions(self): # type: () -> List[EnhancedInstruction] result = self.clean_instructions(self.code) # pypy sometimes (when is not clear) # inserts JUMP_IF_NOT_DEBUG instructions in bytecode # If they're not present in our compiled instructions, # ignore them in the original bytecode if not any( inst.opname == "JUMP_IF_NOT_DEBUG" for inst in self.compile_instructions() ): result = [ inst for inst in result if inst.opname != "JUMP_IF_NOT_DEBUG" ] return result def matching_nodes(self, exprs): # type: (Set[EnhancedAST]) -> Iterator[EnhancedAST] original_instructions = self.get_original_clean_instructions() original_index = only( i for i, inst in enumerate(original_instructions) if inst == self.instruction ) for expr_index, expr in enumerate(exprs): setter = get_setter(expr) assert setter is not None # noinspection PyArgumentList replacement = ast.BinOp( left=expr, op=ast.Pow(), right=ast.Str(s=sentinel), ) ast.fix_missing_locations(replacement) setter(replacement) try: instructions = self.compile_instructions() finally: setter(expr) if sys.version_info >= (3, 10): try: handle_jumps(instructions, original_instructions) except Exception: # Give other candidates a chance if TESTING or expr_index < len(exprs) - 1: continue raise indices = [ i for i, instruction in enumerate(instructions) if instruction.argval == sentinel ] # There can be several indices when the bytecode is duplicated, # as happens in a finally block in 3.9+ # First we remove the opcodes caused by our modifications for index_num, sentinel_index in enumerate(indices): # Adjustment for removing sentinel instructions below # in past iterations sentinel_index -= index_num * 2 assert_(instructions.pop(sentinel_index).opname == 'LOAD_CONST') assert_(instructions.pop(sentinel_index).opname == 'BINARY_POWER') # Then we see if any of the instruction indices match for index_num, sentinel_index in enumerate(indices): sentinel_index -= index_num * 2 new_index = sentinel_index - 1 if new_index != original_index: continue original_inst = original_instructions[original_index] new_inst = instructions[new_index] # In Python 3.9+, changing 'not x in y' to 'not sentinel_transformation(x in y)' # changes a CONTAINS_OP(invert=1) to CONTAINS_OP(invert=0),,UNARY_NOT if ( original_inst.opname == new_inst.opname in ('CONTAINS_OP', 'IS_OP') and original_inst.arg != new_inst.arg # type: ignore[attr-defined] and ( original_instructions[original_index + 1].opname != instructions[new_index + 1].opname == 'UNARY_NOT' )): # Remove the difference for the upcoming assert instructions.pop(new_index + 1) # Check that the modified instructions don't have anything unexpected # 3.10 is a bit too weird to assert this in all cases but things still work if sys.version_info < (3, 10): for inst1, inst2 in zip_longest( original_instructions, instructions ): assert_(inst1 and inst2 and opnames_match(inst1, inst2)) yield expr def compile_instructions(self): # type: () -> List[EnhancedInstruction] module_code = compile_similar_to(self.tree, self.code) code = only(self.find_codes(module_code)) return self.clean_instructions(code) def find_codes(self, root_code): # type: (types.CodeType) -> list checks = [ attrgetter('co_firstlineno'), attrgetter('co_freevars'), attrgetter('co_cellvars'), lambda c: is_ipython_cell_code_name(c.co_name) or c.co_name, ] # type: List[Callable] if not self.is_pytest: checks += [ attrgetter('co_names'), attrgetter('co_varnames'), ] def matches(c): # type: (types.CodeType) -> bool return all( f(c) == f(self.code) for f in checks ) code_options = [] if matches(root_code): code_options.append(root_code) def finder(code): # type: (types.CodeType) -> None for const in code.co_consts: if not inspect.iscode(const): continue if matches(const): code_options.append(const) finder(const) finder(root_code) return code_options def get_actual_current_instruction(self, lasti): # type: (int) -> EnhancedInstruction """ Get the instruction corresponding to the current frame offset, skipping EXTENDED_ARG instructions """ # Don't use get_original_clean_instructions # because we need the actual instructions including # EXTENDED_ARG instructions = list(get_instructions(self.code)) index = only( i for i, inst in enumerate(instructions) if inst.offset == lasti ) while True: instruction = instructions[index] if instruction.opname != "EXTENDED_ARG": return instruction index += 1 def non_sentinel_instructions(instructions, start): # type: (List[EnhancedInstruction], int) -> Iterator[Tuple[int, EnhancedInstruction]] """ Yields (index, instruction) pairs excluding the basic instructions introduced by the sentinel transformation """ skip_power = False for i, inst in islice(enumerate(instructions), start, None): if inst.argval == sentinel: assert_(inst.opname == "LOAD_CONST") skip_power = True continue elif skip_power: assert_(inst.opname == "BINARY_POWER") skip_power = False continue yield i, inst def walk_both_instructions(original_instructions, original_start, instructions, start): # type: (List[EnhancedInstruction], int, List[EnhancedInstruction], int) -> Iterator[Tuple[int, EnhancedInstruction, int, EnhancedInstruction]] """ Yields matching indices and instructions from the new and original instructions, leaving out changes made by the sentinel transformation. """ original_iter = islice(enumerate(original_instructions), original_start, None) new_iter = non_sentinel_instructions(instructions, start) inverted_comparison = False while True: try: original_i, original_inst = next(original_iter) new_i, new_inst = next(new_iter) except StopIteration: return if ( inverted_comparison and original_inst.opname != new_inst.opname == "UNARY_NOT" ): new_i, new_inst = next(new_iter) inverted_comparison = ( original_inst.opname == new_inst.opname in ("CONTAINS_OP", "IS_OP") and original_inst.arg != new_inst.arg # type: ignore[attr-defined] ) yield original_i, original_inst, new_i, new_inst def handle_jumps(instructions, original_instructions): # type: (List[EnhancedInstruction], List[EnhancedInstruction]) -> None """ Transforms instructions in place until it looks more like original_instructions. This is only needed in 3.10+ where optimisations lead to more drastic changes after the sentinel transformation. Replaces JUMP instructions that aren't also present in original_instructions with the sections that they jump to until a raise or return. In some other cases duplication found in `original_instructions` is replicated in `instructions`. """ while True: for original_i, original_inst, new_i, new_inst in walk_both_instructions( original_instructions, 0, instructions, 0 ): if opnames_match(original_inst, new_inst): continue if "JUMP" in new_inst.opname and "JUMP" not in original_inst.opname: # Find where the new instruction is jumping to, ignoring # instructions which have been copied in previous iterations start = only( i for i, inst in enumerate(instructions) if inst.offset == new_inst.argval and not getattr(inst, "_copied", False) ) # Replace the jump instruction with the jumped to section of instructions # That section may also be deleted if it's not similarly duplicated # in original_instructions new_instructions = handle_jump( original_instructions, original_i, instructions, start ) assert new_instructions is not None instructions[new_i : new_i + 1] = new_instructions else: # Extract a section of original_instructions from original_i to return/raise orig_section = [] for section_inst in original_instructions[original_i:]: orig_section.append(section_inst) if section_inst.opname in ("RETURN_VALUE", "RAISE_VARARGS"): break else: # No return/raise - this is just a mismatch we can't handle raise AssertionError instructions[new_i:new_i] = only(find_new_matching(orig_section, instructions)) # instructions has been modified, the for loop can't sensibly continue # Restart it from the beginning, checking for other issues break else: # No mismatched jumps found, we're done return def find_new_matching(orig_section, instructions): # type: (List[EnhancedInstruction], List[EnhancedInstruction]) -> Iterator[List[EnhancedInstruction]] """ Yields sections of `instructions` which match `orig_section`. The yielded sections include sentinel instructions, but these are ignored when checking for matches. """ for start in range(len(instructions) - len(orig_section)): indices, dup_section = zip( *islice( non_sentinel_instructions(instructions, start), len(orig_section), ) ) if len(dup_section) < len(orig_section): return if sections_match(orig_section, dup_section): yield instructions[start:indices[-1] + 1] def handle_jump(original_instructions, original_start, instructions, start): # type: (List[EnhancedInstruction], int, List[EnhancedInstruction], int) -> Optional[List[EnhancedInstruction]] """ Returns the section of instructions starting at `start` and ending with a RETURN_VALUE or RAISE_VARARGS instruction. There should be a matching section in original_instructions starting at original_start. If that section doesn't appear elsewhere in original_instructions, then also delete the returned section of instructions. """ for original_j, original_inst, new_j, new_inst in walk_both_instructions( original_instructions, original_start, instructions, start ): assert_(opnames_match(original_inst, new_inst)) if original_inst.opname in ("RETURN_VALUE", "RAISE_VARARGS"): inlined = deepcopy(instructions[start : new_j + 1]) for inl in inlined: inl._copied = True orig_section = original_instructions[original_start : original_j + 1] if not check_duplicates( original_start, orig_section, original_instructions ): instructions[start : new_j + 1] = [] return inlined return None def check_duplicates(original_i, orig_section, original_instructions): # type: (int, List[EnhancedInstruction], List[EnhancedInstruction]) -> bool """ Returns True if a section of original_instructions starting somewhere other than original_i and matching orig_section is found, i.e. orig_section is duplicated. """ for dup_start in range(len(original_instructions)): if dup_start == original_i: continue dup_section = original_instructions[dup_start : dup_start + len(orig_section)] if len(dup_section) < len(orig_section): return False if sections_match(orig_section, dup_section): return True return False def sections_match(orig_section, dup_section): # type: (List[EnhancedInstruction], List[EnhancedInstruction]) -> bool """ Returns True if the given lists of instructions have matching linenos and opnames. """ return all( ( orig_inst.lineno == dup_inst.lineno # POP_BLOCKs have been found to have differing linenos in innocent cases or "POP_BLOCK" == orig_inst.opname == dup_inst.opname ) and opnames_match(orig_inst, dup_inst) for orig_inst, dup_inst in zip(orig_section, dup_section) ) def opnames_match(inst1, inst2): # type: (Instruction, Instruction) -> bool return ( inst1.opname == inst2.opname or "JUMP" in inst1.opname and "JUMP" in inst2.opname or (inst1.opname == "PRINT_EXPR" and inst2.opname == "POP_TOP") or ( inst1.opname in ("LOAD_METHOD", "LOOKUP_METHOD") and inst2.opname == "LOAD_ATTR" ) or (inst1.opname == "CALL_METHOD" and inst2.opname == "CALL_FUNCTION") ) def get_setter(node): # type: (EnhancedAST) -> Optional[Callable[[ast.AST], None]] parent = node.parent for name, field in ast.iter_fields(parent): if field is node: def setter(new_node): # type: (ast.AST) -> None return setattr(parent, name, new_node) return setter elif isinstance(field, list): for i, item in enumerate(field): if item is node: def setter(new_node): # type: (ast.AST) -> None field[i] = new_node return setter return None lock = RLock() @cache def statement_containing_node(node): # type: (ast.AST) -> EnhancedAST while not isinstance(node, ast.stmt): node = cast(EnhancedAST, node).parent return cast(EnhancedAST, node) def assert_linenos(tree): # type: (ast.AST) -> Iterator[int] for node in ast.walk(tree): if ( hasattr(node, 'parent') and isinstance(statement_containing_node(node), ast.Assert) ): for lineno in node_linenos(node): yield lineno def _extract_ipython_statement(stmt): # type: (EnhancedAST) -> ast.Module # IPython separates each statement in a cell to be executed separately # So NodeFinder should only compile one statement at a time or it # will find a code mismatch. while not isinstance(stmt.parent, ast.Module): stmt = stmt.parent # use `ast.parse` instead of `ast.Module` for better portability # python3.8 changes the signature of `ast.Module` # Inspired by https://github.com/pallets/werkzeug/pull/1552/files tree = ast.parse("") tree.body = [cast(ast.stmt, stmt)] ast.copy_location(tree, stmt) return tree def is_ipython_cell_code_name(code_name): # type: (str) -> bool return bool(re.match(r"(|)$", code_name)) def is_ipython_cell_filename(filename): # type: (str) -> bool return bool(re.search(r" bool return ( is_ipython_cell_filename(code_obj.co_filename) and is_ipython_cell_code_name(code_obj.co_name) ) def find_node_ipython(frame, lasti, stmts, source): # type: (types.FrameType, int, Set[EnhancedAST], Source) -> Tuple[Optional[Any], Optional[Any]] node = decorator = None for stmt in stmts: tree = _extract_ipython_statement(stmt) try: node_finder = NodeFinder(frame, stmts, tree, lasti, source) if (node or decorator) and (node_finder.result or node_finder.decorator): # Found potential nodes in separate statements, # cannot resolve ambiguity, give up here return None, None node = node_finder.result decorator = node_finder.decorator except Exception: pass return decorator, node def attr_names_match(attr, argval): # type: (str, str) -> bool """ Checks that the user-visible attr (from ast) can correspond to the argval in the bytecode, i.e. the real attribute fetched internally, which may be mangled for private attributes. """ if attr == argval: return True if not attr.startswith("__"): return False return bool(re.match(r"^_\w+%s$" % attr, argval)) def node_linenos(node): # type: (ast.AST) -> Iterator[int] if hasattr(node, "lineno"): linenos = [] # type: Sequence[int] if hasattr(node, "end_lineno") and isinstance(node, ast.expr): assert node.end_lineno is not None # type: ignore[attr-defined] linenos = range(node.lineno, node.end_lineno + 1) # type: ignore[attr-defined] else: linenos = [node.lineno] # type: ignore[attr-defined] for lineno in linenos: yield lineno if sys.version_info >= (3, 11): from ._position_node_finder import PositionNodeFinder as NodeFinder else: NodeFinder = SentinelNodeFinder python-executing-2.2.0/executing/py.typed000066400000000000000000000000001474076367500205300ustar00rootroot00000000000000python-executing-2.2.0/make_release.sh000077500000000000000000000011441474076367500200240ustar00rootroot00000000000000#!/usr/bin/env bash set -eux # Ensure that there are no uncommitted changes # which would mess up using the git tag as a version [ -z "$(git status --porcelain)" ] if [ -z "${1+x}" ] then set +x echo Provide a version argument echo "${0} .." exit 1 else if [[ ${1} =~ ^([0-9]+)(\.[0-9]+)?(\.[0-9]+)?$ ]]; then : else echo "Not a valid release tag." exit 1 fi fi tox -p 3 export TAG="v${1}" git tag "${TAG}" git push origin master "${TAG}" rm -rf ./build ./dist python -m build --sdist --wheel . twine upload ./dist/*.whl dist/*.tar.gz python-executing-2.2.0/pyproject.toml000066400000000000000000000006301474076367500177630ustar00rootroot00000000000000[build-system] requires = ["setuptools", "wheel", "setuptools_scm[toml]"] build-backend = "setuptools.build_meta" [tool.setuptools_scm] write_to = "executing/version.py" write_to_template = "__version__ = '{version}'" [tool.mypy] show_error_codes=true disallow_untyped_defs=true disallow_untyped_calls=true warn_redundant_casts=true [[tool.mypy.overrides]] module = "astroid" ignore_missing_imports = truepython-executing-2.2.0/setup.cfg000066400000000000000000000022511474076367500166710ustar00rootroot00000000000000[metadata] name = executing author = Alex Hall author_email = alex.mojaki@gmail.com license = MIT description = Get the currently executing AST node of a frame, and other information long_description = file: README.md long_description_content_type = text/markdown url = https://github.com/alexmojaki/executing classifiers = License :: OSI Approved :: MIT License Programming Language :: Python Programming Language :: Python :: 3 Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 Programming Language :: Python :: 3.12 Programming Language :: Python :: 3.13 [options] packages = executing zip_safe = False include_package_data = True setup_requires = setuptools; setuptools_scm[toml] python_requires = >=3.8 [options.extras_require] tests= asttokens>=2.1.0 ipython pytest coverage coverage-enable-subprocess littleutils rich; python_version >='3.11' [options.package_data] executing = py.typed [coverage:run] relative_files = True include = executing/executing.py parallel = true branch = true [bdist_wheel] universal=1 python-executing-2.2.0/setup.py000066400000000000000000000000661474076367500165640ustar00rootroot00000000000000from setuptools import setup setup(name="executing") python-executing-2.2.0/tests/000077500000000000000000000000001474076367500162125ustar00rootroot00000000000000python-executing-2.2.0/tests/__init__.py000066400000000000000000000000001474076367500203110ustar00rootroot00000000000000python-executing-2.2.0/tests/analyse.py000066400000000000000000000063001474076367500202170ustar00rootroot00000000000000import sys import pathlib import dis import types import inspect from executing import Source import executing executing.executing.TESTING = 1 from rich import print as rprint import rich class Frame: pass if len(sys.argv) <= 1 or sys.argv[1] in ("--help", "-h"): print( """ analyse.py [line | first_line:last_line] Analyses a range in the given source in the specified range and maps every bytecode to the node found by executing. """ ) sys.exit(0) filename = pathlib.Path(sys.argv[1]) if ":" in sys.argv[2]: start, end = sys.argv[2].split(":") start = int(start) end = int(end) else: start = end = int(sys.argv[2]) code = filename.read_text() def inspect_opcode(bytecode, index, lineno): frame = Frame() frame.f_lasti = index frame.f_code = bytecode frame.f_globals = globals() frame.f_lineno = lineno source = Source.for_frame(frame) try: ex = Source.executing(frame) except RuntimeError: raise except Exception as e: return "[red]" + type(e).__name__ + ": " + str(e).split("\n")[0] result = "[green]" + type(ex.node).__name__ if hasattr(ex.node, "name"): result += "(" + str(ex.node.name) + ")" elif hasattr(ex.node, "id"): result += "(" + ex.node.id + ")" elif hasattr(ex.node, "attr"): result += "(." + ex.node.attr + ")" elif hasattr(ex.node, "value"): result += f"({ex.node.value})" if ex.decorator: result += " @%s" % ex.decorator return result import rich.syntax from rich.console import Console from rich.table import Table, Column from rich.highlighter import ReprHighlighter console = Console() console.print( rich.syntax.Syntax(code, "python", line_numbers=True, line_range=(start, end)) ) print("all bytecodes in this range:") bc = compile(code, filename, "exec") def inspect(bc): first = True table = Table( title=bc.co_name + ":", box=None, title_style="blue", title_justify="left", ) table.add_column("offset", justify="right") table.add_column("start") table.add_column("end") table.add_column("instruction") table.add_column("ast-node") highlighter=ReprHighlighter() for i in dis.get_instructions(bc, show_caches=True): if ( i.positions.lineno is not None and i.positions.lineno <= end and start <= i.positions.end_lineno ): if first: first = False ex = inspect_opcode(bc, i.offset, i.positions.lineno) table.add_row( str(i.offset), "%s:%s" % (i.positions.lineno, i.positions.col_offset), "%s:%s" % (i.positions.end_lineno, i.positions.end_col_offset), highlighter("%s(%s)" % (i.opname, i.argrepr)), ex, style="on grey19" if i.opname=="CACHE" else "on grey30" #**({"style":"on white" } if i.opname=="CACHE" else {}) ) if first == False: console.print() console.print(table) for const in bc.co_consts: if isinstance(const, types.CodeType): inspect(const) inspect(bc) python-executing-2.2.0/tests/conftest.py000066400000000000000000000012541474076367500204130ustar00rootroot00000000000000 from typing import Optional, Sequence, Union from executing._pytest_utils import is_pytest_compatible import _pytest.assertion.rewrite as rewrite import importlib.machinery import types if not is_pytest_compatible(): original_find_spec = rewrite.AssertionRewritingHook.find_spec def find_spec( self, name: str, path: Optional[Sequence[Union[str, bytes]]] = None, target: Optional[types.ModuleType] = None, ) -> Optional[importlib.machinery.ModuleSpec]: if name == "tests.test_main": return None return original_find_spec(self, name, path, target) rewrite.AssertionRewritingHook.find_spec = find_spec python-executing-2.2.0/tests/deadcode.py000066400000000000000000000074211474076367500203200ustar00rootroot00000000000000import ast import copy import dis import sys sentinel_rep = 2 # generate sentinel at runtime to keep it out of the bytecode # this allows the algorithm to check also this file sentinel = "xsglegahghegflgfaih" * sentinel_rep def constant(value): if sys.version_info >= (3, 6): return ast.Constant(value=value) elif isinstance(value, int): return ast.Num(value) elif isinstance(value, str): return ast.Str(value) else: raise TypeError def index(value): if sys.version_info >= (3, 9): return constant(value) else: return ast.Index(constant(value)) class DeadcodeTransformer(ast.NodeTransformer): def visit(self, node): constant_type = ( ast.Constant if sys.version_info >= (3, 6) else (ast.Num, ast.Str, ast.Bytes, ast.NameConstant, ast.Ellipsis) ) if getattr(node, "_check_is_deadcode", False): if isinstance(node, constant_type) and isinstance(node.value, str): # docstring for example return constant(sentinel) elif isinstance(node, ast.stmt): return ast.Expr( value=ast.Call( func=ast.Name(id="foo", ctx=ast.Load()), args=[constant(sentinel)], keywords=[], ) ) elif isinstance(node, ast.expr): if hasattr(node, "ctx") and isinstance(node.ctx, (ast.Store, ast.Del)): return ast.Subscript( value=ast.Name(id="foo", ctx=ast.Load()), slice=index(sentinel), ctx=node.ctx, ) else: return ast.Subscript( value=ast.Tuple( elts=[node, constant(sentinel)], ctx=ast.Load(), ), slice=index(0), ctx=ast.Load(), ) else: raise TypeError(node) else: return super().visit(node) def is_deadcode(node): if isinstance(node, ast.withitem): node = node.context_expr if isinstance(node, ast.ExceptHandler): node = node.body[0] if sys.version_info >= (3,8) and isinstance(node.parent, ast.NamedExpr) and node.parent.target is node: node = node.parent if sys.version_info >= (3,12) and isinstance(node.parent,ast.TypeAlias): node = node.parent if ( sys.version_info >= (3, 6) and isinstance(node.parent, ast.AnnAssign) and node.parent.target is node ): # AnnAssign.target has to be ast.Name node = node.parent if hasattr(node, "_is_deadcode"): return node._is_deadcode node._check_is_deadcode = True module = node while hasattr(module, "parent"): module = module.parent assert isinstance(module, ast.Module) # create working copy of the ast module2 = copy.deepcopy(module) del node._check_is_deadcode module2 = ast.fix_missing_locations(DeadcodeTransformer().visit(module2)) try: code = compile(module2, "", "exec") except: print(ast.dump(module2)) raise visited = set() def contains_sentinel(code): if code in visited: return False for inst in dis.get_instructions(code): arg = inst.argval if isinstance(arg, type(code)) and contains_sentinel(arg): return True if arg == sentinel: return True visited.add(code) return False node._is_deadcode = not contains_sentinel(code) return node._is_deadcode python-executing-2.2.0/tests/generate_small_sample.py000066400000000000000000000132431474076367500231120ustar00rootroot00000000000000from .test_main import TestFiles from pathlib import Path import hashlib from pysource_minimize import minimize import sys import textwrap import os import linecache from executing import Source from multiprocessing import get_context import tempfile import hashlib import time import contextlib import os from rich.progress import Progress, track from rich.syntax import Syntax from rich.console import Console import argparse import ast last_samples_dir = Path(__file__).parent / "last_samples" last_samples_dir.mkdir(exist_ok=True) small_samples = Path(__file__).parent / "small_samples" def source_hash(source_code): return hashlib.sha256(source_code.encode("utf8")).hexdigest() def big_samples(folder): yield from last_samples_dir.rglob("*.py") hashes = set() for p in folder.rglob("*.py"): try: content = p.read_text() except: continue if content.count("\n") > 50000: # Long files take too much time to check and are most likely generated code or repetitive continue h = source_hash(content) if h in hashes: continue hashes.add(h) yield p def test_file(filename: Path): code = filename.read_text() # Clear caches to avoid accumulating too much data in memory. # This is usually not a problem for executing, but this usage scenario is different linecache.clearcache() for cache_name in ("__source_cache_with_lines", "__executing_cache"): if hasattr(Source, cache_name): delattr(Source, cache_name) test = TestFiles() try: ast.parse(code) except (RecursionError,SyntaxError): return True try: with open(os.devnull, "w") as dev_null: with contextlib.redirect_stderr(dev_null): with contextlib.redirect_stdout(dev_null): test.check_filename(filename, check_names=True) except: return False return True def map_file(filename: Path): return test_file(filename), filename def main(): parser = argparse.ArgumentParser(prog="generate_small_samples") parser.add_argument("source_folder", default="tests/samples", nargs="?") args = parser.parse_args() folder = Path(args.source_folder) if not (folder.exists() and folder.is_dir()): print("source_folder has to be an existing directory") exit(1) console = Console() end_time = time.time() + 60 * 60 console.print() console.print(f"Check files in tests/last_samples and {folder}:") console.print() with Progress() as progress: task_collect = progress.add_task(description="collect files ...", total=None) with get_context("spawn").Pool(maxtasksperchild=100) as p: files = list( progress.track( big_samples(folder), task_id=task_collect, description="collect files...", ) ) progress.reset(task_collect, description="check files...", total=len(files)) for result, filename in progress.track( p.imap_unordered(map_file, files), task_id=task_collect ): break_file = Path(__file__).parent / "break_generate" if break_file.exists(): break_file.unlink() sys.exit(0) if not result: print(f"{filename} is failing the tests -> minimize\n") failing_code = filename.read_text() break else: progress.stop() console.print() console.print( f" :fireworks: checked {len(files)} files and everything was ok :fireworks:" ) console.print() return p.terminate() (last_samples_dir / f"{source_hash(failing_code)}.py").write_text(failing_code) def check_for_error(source: str): with tempfile.NamedTemporaryFile(delete=False) as tmp_file: tmp_file.write(source.encode("utf8")) tmp_file.flush() test_ok = test_file(Path(tmp_file.name)) return not test_ok task_minimize = progress.add_task("minimize...") def update(current, total): progress.update(task_minimize, completed=total - current, total=total) min_code = minimize(failing_code, check_for_error, progress_callback=update) name = f"{source_hash(min_code)}.py" mutmut_header = os.environ.get("MUTMUT_HEADER", None) header = "" if mutmut_header != None: header = ( "This sample was generated for the following code mutation detected by mutmut:\n\n" + mutmut_header ) header = textwrap.indent(header, "# ", lambda _: True) + "\n" name = f"{source_hash(header)}.py" min_code = header + min_code result_location = small_samples / name result_location.write_text(min_code) console.print() console.print("This is the minimal example to reproduce the bug:") console.print(Syntax.from_path(result_location, line_numbers=True)) console.print() console.print(f"The example was saved under:\n [blue]{result_location}") console.print() console.print("This example is now part of the test and can be run with:") console.print( f" > tox -e py{sys.version_info.major}{sys.version_info.minor} -- -k {name[:10]}" ) console.print() console.print( "Have fun debugging :smiley: and dont forget to run me again," " if you think you fixed everything." ) if __name__ == "__main__": main() python-executing-2.2.0/tests/global_tester_calls.py000066400000000000000000000010741474076367500225720ustar00rootroot00000000000000from .utils import tester # tester calls tested with test_tester at global scope assert tester([1, 2, 3]) == [1, 2, 3] assert tester.asd is tester assert tester[1 + 2] is tester assert tester**4 is tester assert tester * 3 is tester assert tester - 2 is tester assert tester + 1 is tester assert -tester is +tester is ~tester is tester assert (tester < 7) is tester assert (tester >= 78) is tester assert (tester != 79) is tester # assert (5 != tester != 6) is tester assert tester.foo(45, False) == 45 assert (tester or 234) == 234 assert (tester and 1123) is tester python-executing-2.2.0/tests/mutmut_workflow.py000066400000000000000000000060331474076367500220530ustar00rootroot00000000000000import subprocess as sp import os import shelve import time files = ["executing/_position_node_finder.py", "tests/deadcode.py"] py_version = "py311" def mutmut_run(num: str | None = None): cmd = [ "mutmut", "run", "--paths-to-mutate", ",".join(files), "--runner", f"tox -e {py_version} -- --ff", *([num] if num is not None else []), ] print(">", *cmd) sp.run(cmd) def survived() -> set[str]: """ set of all the ids which survived """ nums = sp.check_output(["mutmut", "result-ids", "survived"]).decode().split() if not all(num.isnumeric() for num in nums): return set() return set(nums) def main(): # Mutmut is not really build for this kind of integration. # This is the reason for some weird code here. # make sure that there are no known bugs sp.check_call(["git", "checkout", *files]) sp.check_call(["tox", "-e", py_version]) # done.db contains all mutmut ids which have been already tried to fix. # Useful if this is run multiple times with shelve.open("done.db") as done: while True: todo = survived() - done.keys() if not todo: # mutmut has to run without id first # It also only checks for the first 100 untested mutations, # `not todo` does not imply that there is nothing more to test mutmut_run() todo = survived() - done.keys() if not todo: break print("survived mutations todo:", todo) for num in todo: # make sure to base this run on clean files sp.check_call(["git", "checkout", *files]) # applies the mutated state to the files and runs the mutation mutmut_run(num) # skip if the mutation has not survived (is covered by some tests) if num not in survived(): continue header_diff = sp.check_output(["mutmut", "show", num]).decode() sp.check_call(["mutmut", "apply", num]) # generate a sample for the mutmut run sp.check_call( ["tox", "-e", f"generate_small_sample-{py_version}"], env=os.environ | {"MUTMUT_HEADER": header_diff}, ) sp.check_call(["git", "checkout", *files]) # The normal tests should pass. # There are some cases where generate_small_sample found a different bug # and the tests failed. # this script will fail in this case and the bug should be fixed by the developer result = sp.run(["tox", "-e", py_version]) if result.returncode != 0: print( "generate_small_sample found a different bug that should be fixed by the developer" ) exit(1) done[num] = True if __name__ == "__main__": main() python-executing-2.2.0/tests/not_code.txt000066400000000000000000000000201474076367500205350ustar00rootroot00000000000000this isn't code python-executing-2.2.0/tests/sample_results/000077500000000000000000000000001474076367500212545ustar00rootroot00000000000000python-executing-2.2.0/tests/sample_results/_parser-py-2.7.json000066400000000000000000000000041474076367500245260ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-py-3.10.json000066400000000000000000002153731474076367500246220ustar00rootroot00000000000000[ [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL_FUNCTION", "range(32)" ], [ "CALL_FUNCTION", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL_FUNCTION", "chr(127)" ], [ "CALL_FUNCTION", "frozenset(chr(127))" ], [ "BINARY_OR", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\\n\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\" \\t\")" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\n\")" ], [ "BINARY_OR", "TOML_WS | frozenset(\"\\n\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL_FUNCTION", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\\"'\")" ], [ "BINARY_OR", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL_FUNCTION", "frozenset(string.hexdigits)" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL_FUNCTION", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "chr(i)" ], [ "LOAD_FAST", "fp" ], [ "LOAD_METHOD", "fp.read" ], [ "CALL_METHOD", "fp.read()" ], [ "LOAD_FAST", "b" ], [ "LOAD_METHOD", "b.decode" ], [ "CALL_METHOD", "b.decode()" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_GLOBAL", "loads" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION_KW", "loads(s, parse_float=parse_float)" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "CALL_FUNCTION", "Output(NestedDict(), Flags())" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "make_safe_parse_float(parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "CONTAINS_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "header" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "key_value_rule(src, pos, out, header, parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.finalize_pending" ], [ "CALL_METHOD", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_list_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_dict_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.add" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_FUNCTION_KW", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.clear" ], [ "CALL_METHOD", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_METHOD", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL_METHOD", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_parent" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"flags\"]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "CALL_METHOD", "self.get_or_create_nest(key[:-1])" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "last_key" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "last_key in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_METHOD", "list_.append" ], [ "CALL_METHOD", "list_.append({})" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.index" ], [ "LOAD_FAST", "expect" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.index(expect, pos)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "expect" ], [ "CALL_FUNCTION", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_METHOD", "error_on.isdisjoint" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SUBSCR", "src[pos:new_pos]" ], [ "CALL_METHOD", "error_on.isdisjoint(src[pos:new_pos])" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos_before_skip" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.get_or_create_nest(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.append_nest_to_list(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_ADD", "header + key_parent" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL_FUNCTION", "len(key)" ], [ "CALL_FUNCTION", "range(1, len(key))" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "cont_key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL_METHOD", "out.data.get_or_create_nest(abs_key_parent)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_ADD", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "key[:i]" ], [ "BINARY_ADD", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CONTAINS_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "array" ], [ "LOAD_METHOD", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL_METHOD", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "flags" ], [ "LOAD_METHOD", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL_FUNCTION_KW", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key_stem" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "src[pos : pos + 2]" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "CONTAINS_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_ADD", "pos + hex_len" ], [ "BINARY_SUBSCR", "src[pos : pos + hex_len]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_METHOD", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_METHOD", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "LOAD_FAST", "hex_len" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "int(hex_str, 16)" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "literal" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SUBSCR", "src[pos:end_pos]" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_ADD", "end_pos + 3" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_ADD", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_MULTIPLY", "delim * 2" ], [ "BINARY_ADD", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "parse_escapes" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_escapes(src, pos)" ], [ "LOAD_FAST", "parsed_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_METHOD", "RE_DATETIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_DATETIME.match(src, pos)" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL_FUNCTION", "match_to_datetime(datetime_match)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_METHOD", "datetime_match.end" ], [ "CALL_METHOD", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_METHOD", "RE_LOCALTIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_LOCALTIME.match(src, pos)" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_METHOD", "localtime_match.end" ], [ "CALL_METHOD", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL_FUNCTION", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_METHOD", "RE_NUMBER.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_NUMBER.match(src, pos)" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_METHOD", "number_match.end" ], [ "CALL_METHOD", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "BINARY_SUBSCR", "src[pos : pos + 3]" ], [ "LOAD_FAST", "first_three" ], [ "CONTAINS_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL_FUNCTION", "parse_float(first_three)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "BINARY_SUBSCR", "src[pos : pos + 4]" ], [ "LOAD_FAST", "first_four" ], [ "CONTAINS_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL_FUNCTION", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid value\")" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "msg" ], [ "LOAD_FAST", "coord_repr" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "coord_repr(src, pos)" ], [ "CALL_FUNCTION", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_ADD", "src.count(\"\\n\", 0, pos) + 1" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_SUBTRACT", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "column" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "IS_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL_FUNCTION", "parse_float(float_str)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-py-3.11.json000066400000000000000000003435031474076367500246200ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import annotations" ], [ "STORE_NAME", "from collections.abc import Iterable" ], [ "STORE_NAME", "import string" ], [ "STORE_NAME", "from types import MappingProxyType" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL", "range(32)" ], [ "CALL", "(chr(i) for i in range(32))" ], [ "CALL", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL", "chr(127)" ], [ "CALL", "frozenset(chr(127))" ], [ "BINARY_OP", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "STORE_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "STORE_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\\n\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_COMMENT_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\" \\t\")" ], [ "STORE_NAME", "TOML_WS" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\n\")" ], [ "BINARY_OP", "TOML_WS | frozenset(\"\\n\")" ], [ "STORE_NAME", "TOML_WS_AND_NEWLINE" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "STORE_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\\"'\")" ], [ "BINARY_OP", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "STORE_NAME", "KEY_INITIAL_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL", "frozenset(string.hexdigits)" ], [ "STORE_NAME", "HEXDIGIT_CHARS" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "STORE_NAME", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_NAME", "ValueError" ], [ "CALL", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "STORE_NAME", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def load(fp: BinaryIO, /, *, parse_float: ParseFloat = float) -> dict[str, Any]:\n \"\"\"Parse TOML from a binary file object.\"\"\"\n b = fp.read()\n try:\n s = b.decode()\n except AttributeError:\n raise TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n ) from None\n return loads(s, parse_float=parse_float)" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def loads(s: str, /, *, parse_float: ParseFloat = float) -> dict[str, Any]: # noqa: C901\n \"\"\"Parse TOML from a string.\"\"\"\n\n # The spec allows converting \"\\r\\n\" to \"\\n\", even in string\n # literals. Let's do so to simplify parsing.\n src = s.replace(\"\\r\\n\", \"\\n\")\n pos = 0\n out = Output(NestedDict(), Flags())\n header: Key = ()\n parse_float = make_safe_parse_float(parse_float)\n\n # Parse one statement at a time\n # (typically means one line in TOML source)\n while True:\n # 1. Skip line leading whitespace\n pos = skip_chars(src, pos, TOML_WS)\n\n # 2. Parse rules. Expect one of the following:\n # - end of file\n # - end of line\n # - comment\n # - key/value pair\n # - append dict to list (and move to its namespace)\n # - create dict (and move to its namespace)\n # Skip trailing whitespace when applicable.\n try:\n char = src[pos]\n except IndexError:\n break\n if char == \"\\n\":\n pos += 1\n continue\n if char in KEY_INITIAL_CHARS:\n pos = key_value_rule(src, pos, out, header, parse_float)\n pos = skip_chars(src, pos, TOML_WS)\n elif char == \"[\":\n try:\n second_char: str | None = src[pos + 1]\n except IndexError:\n second_char = None\n out.flags.finalize_pending()\n if second_char == \"[\":\n pos, header = create_list_rule(src, pos, out)\n else:\n pos, header = create_dict_rule(src, pos, out)\n pos = skip_chars(src, pos, TOML_WS)\n elif char != \"#\":\n raise suffixed_err(src, pos, \"Invalid statement\")\n\n # 3. Skip comment\n pos = skip_comment(src, pos)\n\n # 4. Expect end of line or end of file\n try:\n char = src[pos]\n except IndexError:\n break\n if char != \"\\n\":\n raise suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )\n pos += 1\n\n return out.data.dict" ], [ "CALL", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "STORE_NAME", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "CALL", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "STORE_NAME", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_NAME", "NamedTuple" ], [ "CALL", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos:\n try:\n while src[pos] in chars:\n pos += 1\n except IndexError:\n pass\n return pos" ], [ "STORE_NAME", "def skip_until(\n src: str,\n pos: Pos,\n expect: str,\n *,\n error_on: frozenset[str],\n error_on_eof: bool,\n) -> Pos:\n try:\n new_pos = src.index(expect, pos)\n except ValueError:\n new_pos = len(src)\n if error_on_eof:\n raise suffixed_err(src, new_pos, f\"Expected {expect!r}\") from None\n\n if not error_on.isdisjoint(src[pos:new_pos]):\n while src[pos] not in error_on:\n pos += 1\n raise suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")\n return new_pos" ], [ "STORE_NAME", "def skip_comment(src: str, pos: Pos) -> Pos:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char == \"#\":\n return skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )\n return pos" ], [ "STORE_NAME", "def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos:\n while True:\n pos_before_skip = pos\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n pos = skip_comment(src, pos)\n if pos == pos_before_skip:\n return pos" ], [ "STORE_NAME", "def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 1 # Skip \"[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot declare {key} twice\")\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.get_or_create_nest(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]\", pos):\n raise suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")\n return pos + 1, key" ], [ "STORE_NAME", "def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 2 # Skip \"[[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n # Free the namespace now that it points to another empty list item...\n out.flags.unset_all(key)\n # ...but this key precisely is still prohibited from table declaration\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.append_nest_to_list(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]]\", pos):\n raise suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")\n return pos + 2, key" ], [ "STORE_NAME", "def key_value_rule(\n src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat\n) -> Pos:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n abs_key_parent = header + key_parent\n\n relative_path_cont_keys = (header + key[:i] for i in range(1, len(key)))\n for cont_key in relative_path_cont_keys:\n # Check that dotted key syntax does not redefine an existing table\n if out.flags.is_(cont_key, Flags.EXPLICIT_NEST):\n raise suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")\n # Containers in the relative path can't be opened with the table syntax or\n # dotted key/value syntax in following table sections.\n out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)\n\n if out.flags.is_(abs_key_parent, Flags.FROZEN):\n raise suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )\n\n try:\n nest = out.data.get_or_create_nest(abs_key_parent)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\")\n # Mark inline table and array namespaces recursively immutable\n if isinstance(value, (dict, list)):\n out.flags.set(header + key, Flags.FROZEN, recursive=True)\n nest[key_stem] = value\n return pos" ], [ "STORE_NAME", "def parse_key_value_pair(\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Key, Any]:\n pos, key = parse_key(src, pos)\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \"=\":\n raise suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, value = parse_value(src, pos, parse_float)\n return pos, key, value" ], [ "STORE_NAME", "def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]:\n pos, key_part = parse_key_part(src, pos)\n key: Key = (key_part,)\n pos = skip_chars(src, pos, TOML_WS)\n while True:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \".\":\n return pos, key\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, key_part = parse_key_part(src, pos)\n key += (key_part,)\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char in BARE_KEY_CHARS:\n start_pos = pos\n pos = skip_chars(src, pos, BARE_KEY_CHARS)\n return pos, src[start_pos:pos]\n if char == \"'\":\n return parse_literal_str(src, pos)\n if char == '\"':\n return parse_one_line_basic_str(src, pos)\n raise suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "STORE_NAME", "def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1\n return parse_basic_str(src, pos, multiline=False)" ], [ "STORE_NAME", "def parse_array(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, list]:\n pos += 1\n array: list = []\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array\n while True:\n pos, val = parse_value(src, pos, parse_float)\n array.append(val)\n pos = skip_comments_and_array_ws(src, pos)\n\n c = src[pos : pos + 1]\n if c == \"]\":\n return pos + 1, array\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed array\")\n pos += 1\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array" ], [ "STORE_NAME", "def parse_inline_table(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, dict]:\n pos += 1\n nested_dict = NestedDict()\n flags = Flags()\n\n pos = skip_chars(src, pos, TOML_WS)\n if src.startswith(\"}\", pos):\n return pos + 1, nested_dict.dict\n while True:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n if flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n try:\n nest = nested_dict.get_or_create_nest(key_parent, access_lists=False)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")\n nest[key_stem] = value\n pos = skip_chars(src, pos, TOML_WS)\n c = src[pos : pos + 1]\n if c == \"}\":\n return pos + 1, nested_dict.dict\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed inline table\")\n if isinstance(value, (dict, list)):\n flags.set(key, Flags.FROZEN, recursive=True)\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_basic_str_escape(\n src: str, pos: Pos, *, multiline: bool = False\n) -> tuple[Pos, str]:\n escape_id = src[pos : pos + 2]\n pos += 2\n if multiline and escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}:\n # Skip whitespace until next non-whitespace character or end of\n # the doc. Error if non-whitespace is found before newline.\n if escape_id != \"\\\\\\n\":\n pos = skip_chars(src, pos, TOML_WS)\n try:\n char = src[pos]\n except IndexError:\n return pos, \"\"\n if char != \"\\n\":\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n return pos, \"\"\n if escape_id == \"\\\\u\":\n return parse_hex_char(src, pos, 4)\n if escape_id == \"\\\\U\":\n return parse_hex_char(src, pos, 8)\n try:\n return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]\n except KeyError:\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\") from None" ], [ "STORE_NAME", "def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]:\n return parse_basic_str_escape(src, pos, multiline=True)" ], [ "STORE_NAME", "def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]:\n hex_str = src[pos : pos + hex_len]\n if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str):\n raise suffixed_err(src, pos, \"Invalid hex value\")\n pos += hex_len\n hex_int = int(hex_str, 16)\n if not is_unicode_scalar_value(hex_int):\n raise suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")\n return pos, chr(hex_int)" ], [ "STORE_NAME", "def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1 # Skip starting apostrophe\n start_pos = pos\n pos = skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )\n return pos + 1, src[start_pos:pos]" ], [ "STORE_NAME", "def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]:\n pos += 3\n if src.startswith(\"\\n\", pos):\n pos += 1\n\n if literal:\n delim = \"'\"\n end_pos = skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )\n result = src[pos:end_pos]\n pos = end_pos + 3\n else:\n delim = '\"'\n pos, result = parse_basic_str(src, pos, multiline=True)\n\n # Add at maximum two extra apostrophes/quotes if the end sequence\n # is 4 or 5 chars long instead of just 3.\n if not src.startswith(delim, pos):\n return pos, result\n pos += 1\n if not src.startswith(delim, pos):\n return pos, result + delim\n pos += 1\n return pos, result + (delim * 2)" ], [ "STORE_NAME", "def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]:\n if multiline:\n error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape_multiline\n else:\n error_on = ILLEGAL_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape\n result = \"\"\n start_pos = pos\n while True:\n try:\n char = src[pos]\n except IndexError:\n raise suffixed_err(src, pos, \"Unterminated string\") from None\n if char == '\"':\n if not multiline:\n return pos + 1, result + src[start_pos:pos]\n if src.startswith('\"\"\"', pos):\n return pos + 3, result + src[start_pos:pos]\n pos += 1\n continue\n if char == \"\\\\\":\n result += src[start_pos:pos]\n pos, parsed_escape = parse_escapes(src, pos)\n result += parsed_escape\n start_pos = pos\n continue\n if char in error_on:\n raise suffixed_err(src, pos, f\"Illegal character {char!r}\")\n pos += 1" ], [ "STORE_NAME", "def parse_value( # noqa: C901\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Any]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n\n # IMPORTANT: order conditions based on speed of checking and likelihood\n\n # Basic strings\n if char == '\"':\n if src.startswith('\"\"\"', pos):\n return parse_multiline_str(src, pos, literal=False)\n return parse_one_line_basic_str(src, pos)\n\n # Literal strings\n if char == \"'\":\n if src.startswith(\"'''\", pos):\n return parse_multiline_str(src, pos, literal=True)\n return parse_literal_str(src, pos)\n\n # Booleans\n if char == \"t\":\n if src.startswith(\"true\", pos):\n return pos + 4, True\n if char == \"f\":\n if src.startswith(\"false\", pos):\n return pos + 5, False\n\n # Arrays\n if char == \"[\":\n return parse_array(src, pos, parse_float)\n\n # Inline tables\n if char == \"{\":\n return parse_inline_table(src, pos, parse_float)\n\n # Dates and times\n datetime_match = RE_DATETIME.match(src, pos)\n if datetime_match:\n try:\n datetime_obj = match_to_datetime(datetime_match)\n except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e\n return datetime_match.end(), datetime_obj\n localtime_match = RE_LOCALTIME.match(src, pos)\n if localtime_match:\n return localtime_match.end(), match_to_localtime(localtime_match)\n\n # Integers and \"normal\" floats.\n # The regex will greedily match any type starting with a decimal\n # char, so needs to be located after handling of dates and times.\n number_match = RE_NUMBER.match(src, pos)\n if number_match:\n return number_match.end(), match_to_number(number_match, parse_float)\n\n # Special floats\n first_three = src[pos : pos + 3]\n if first_three in {\"inf\", \"nan\"}:\n return pos + 3, parse_float(first_three)\n first_four = src[pos : pos + 4]\n if first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}:\n return pos + 4, parse_float(first_four)\n\n raise suffixed_err(src, pos, \"Invalid value\")" ], [ "STORE_NAME", "def suffixed_err(src: str, pos: Pos, msg: str) -> TOMLDecodeError:\n \"\"\"Return a `TOMLDecodeError` where error message is suffixed with\n coordinates in source.\"\"\"\n\n def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"\n\n return TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "STORE_NAME", "def is_unicode_scalar_value(codepoint: int) -> bool:\n return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111)" ], [ "STORE_NAME", "def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat:\n \"\"\"A decorator to make `parse_float` safe.\n\n `parse_float` must not return dicts or lists, because these types\n would be mixed with parsed TOML tables and arrays, thus confusing\n the parser. The returned decorated callable raises `ValueError`\n instead of returning illegal types.\n \"\"\"\n # The default `float` callable never returns illegal types. Optimize it.\n if parse_float is float: # type: ignore[comparison-overlap]\n return float\n\n def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value\n\n return safe_parse_float" ], [ "LOAD_FAST", "(chr(i) for i in range(32))" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL", "chr(i)" ], [ "STORE_NAME", "\"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_FAST", "fp" ], [ "LOAD_METHOD", "fp.read" ], [ "CALL", "fp.read()" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "b" ], [ "LOAD_METHOD", "b.decode" ], [ "CALL", "b.decode()" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_GLOBAL", "loads" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "loads(s, parse_float=parse_float)" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "STORE_FAST", "src" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "CALL", "Output(NestedDict(), Flags())" ], [ "STORE_FAST", "out" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "make_safe_parse_float(parse_float)" ], [ "STORE_FAST", "parse_float" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "CONTAINS_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "header" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "key_value_rule(src, pos, out, header, parse_float)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "STORE_FAST", "second_char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "second_char" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.finalize_pending" ], [ "CALL", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_list_rule(src, pos, out)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_dict_rule(src, pos, out)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "STORE_NAME", "\"\"\"Flags that map to parsed keys/namespaces.\"\"\"" ], [ "STORE_NAME", "FROZEN" ], [ "STORE_NAME", "EXPLICIT_NEST" ], [ "STORE_NAME", " def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()" ], [ "STORE_NAME", " def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))" ], [ "STORE_NAME", " def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()" ], [ "STORE_NAME", " def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)" ], [ "STORE_NAME", " def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "STORE_NAME", " def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.add" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "STORE_FAST", "key" ], [ "STORE_FAST", "flag" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.clear" ], [ "CALL", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_METHOD", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_FAST", "key_parent" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "inner_cont" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"flags\"]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"recursive_flags\"]" ], [ "STORE_NAME", " def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}" ], [ "STORE_NAME", " def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont" ], [ "STORE_NAME", " def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "STORE_FAST", "cont" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "CALL", "self.get_or_create_nest(key[:-1])" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "last_key" ], [ "LOAD_FAST", "last_key" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "last_key in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "STORE_FAST", "list_" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_METHOD", "list_.append" ], [ "CALL", "list_.append({})" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_NAME", "data: NestedDict" ], [ "STORE_SUBSCR", "data: NestedDict" ], [ "LOAD_NAME", "flags: Flags" ], [ "STORE_SUBSCR", "flags: Flags" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.index" ], [ "LOAD_FAST", "expect" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.index(expect, pos)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "expect" ], [ "CALL", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_METHOD", "error_on.isdisjoint" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SUBSCR", "src[pos:new_pos]" ], [ "CALL", "error_on.isdisjoint(src[pos:new_pos])" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "CALL", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "pos_before_skip" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos_before_skip" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.get_or_create_nest(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.append_nest_to_list(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_DEREF", "key" ], [ "STORE_FAST", "value" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_OP", "header + key_parent" ], [ "STORE_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL", "len(key)" ], [ "CALL", "range(1, len(key))" ], [ "CALL", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "STORE_FAST", "cont_key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "cont_key" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL", "out.data.get_or_create_nest(abs_key_parent)" ], [ "STORE_FAST", "nest" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_OP", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "i" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "key[:i]" ], [ "BINARY_OP", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key_part(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key_part" ], [ "LOAD_FAST", "key_part" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key_part(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key_part" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "key_part" ], [ "BINARY_OP", "key += (key_part,)" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CONTAINS_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "array" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "val" ], [ "LOAD_FAST", "array" ], [ "LOAD_METHOD", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "STORE_FAST", "nested_dict" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "STORE_FAST", "flags" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_FAST", "flags" ], [ "LOAD_METHOD", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_METHOD", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "STORE_FAST", "nest" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key_stem" ], [ "CALL", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_METHOD", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SUBSCR", "src[pos : pos + 2]" ], [ "STORE_FAST", "escape_id" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "CONTAINS_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_OP", "pos + hex_len" ], [ "BINARY_SUBSCR", "src[pos : pos + hex_len]" ], [ "STORE_FAST", "hex_str" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_METHOD", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_OP", "pos += hex_len" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "int(hex_str, 16)" ], [ "STORE_FAST", "hex_int" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 3" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "literal" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "STORE_FAST", "end_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SUBSCR", "src[pos:end_pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_OP", "end_pos + 3" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str(src, pos, multiline=True)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "delim * 2" ], [ "BINARY_OP", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "STORE_FAST", "parse_escapes" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "STORE_FAST", "parse_escapes" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_OP", "result += src[start_pos:pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "parse_escapes" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_escapes(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "parsed_escape" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "parsed_escape" ], [ "BINARY_OP", "result += parsed_escape" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "CALL", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_ATTR", "RE_DATETIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_DATETIME.match(src, pos)" ], [ "STORE_FAST", "datetime_match" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL", "match_to_datetime(datetime_match)" ], [ "STORE_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "ValueError" ], [ "STORE_FAST", " except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_METHOD", "datetime_match.end" ], [ "CALL", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_ATTR", "RE_LOCALTIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_LOCALTIME.match(src, pos)" ], [ "STORE_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_METHOD", "localtime_match.end" ], [ "CALL", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_ATTR", "RE_NUMBER.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_NUMBER.match(src, pos)" ], [ "STORE_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_METHOD", "number_match.end" ], [ "CALL", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "BINARY_SUBSCR", "src[pos : pos + 3]" ], [ "STORE_FAST", "first_three" ], [ "LOAD_FAST", "first_three" ], [ "CONTAINS_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL", "parse_float(first_three)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "BINARY_SUBSCR", "src[pos : pos + 4]" ], [ "STORE_FAST", "first_four" ], [ "LOAD_FAST", "first_four" ], [ "CONTAINS_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid value\")" ], [ "STORE_FAST", " def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "msg" ], [ "LOAD_FAST", "coord_repr" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "coord_repr(src, pos)" ], [ "CALL", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_OP", "src.count(\"\\n\", 0, pos) + 1" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "STORE_FAST", "column" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_OP", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "STORE_FAST", "column" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "column" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "IS_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "STORE_FAST", " def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL", "parse_float(float_str)" ], [ "STORE_FAST", "float_value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-py-3.12.json000066400000000000000000003455261474076367500246300ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import annotations" ], [ "STORE_NAME", "from collections.abc import Iterable" ], [ "STORE_NAME", "import string" ], [ "STORE_NAME", "from types import MappingProxyType" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL", "range(32)" ], [ "CALL", "(chr(i) for i in range(32))" ], [ "CALL", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL", "chr(127)" ], [ "CALL", "frozenset(chr(127))" ], [ "BINARY_OP", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "STORE_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "STORE_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\\n\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_COMMENT_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\" \\t\")" ], [ "STORE_NAME", "TOML_WS" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\n\")" ], [ "BINARY_OP", "TOML_WS | frozenset(\"\\n\")" ], [ "STORE_NAME", "TOML_WS_AND_NEWLINE" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "STORE_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\\"'\")" ], [ "BINARY_OP", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "STORE_NAME", "KEY_INITIAL_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL", "frozenset(string.hexdigits)" ], [ "STORE_NAME", "HEXDIGIT_CHARS" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "STORE_NAME", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_NAME", "ValueError" ], [ "CALL", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "STORE_NAME", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def load(fp: BinaryIO, /, *, parse_float: ParseFloat = float) -> dict[str, Any]:\n \"\"\"Parse TOML from a binary file object.\"\"\"\n b = fp.read()\n try:\n s = b.decode()\n except AttributeError:\n raise TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n ) from None\n return loads(s, parse_float=parse_float)" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def loads(s: str, /, *, parse_float: ParseFloat = float) -> dict[str, Any]: # noqa: C901\n \"\"\"Parse TOML from a string.\"\"\"\n\n # The spec allows converting \"\\r\\n\" to \"\\n\", even in string\n # literals. Let's do so to simplify parsing.\n src = s.replace(\"\\r\\n\", \"\\n\")\n pos = 0\n out = Output(NestedDict(), Flags())\n header: Key = ()\n parse_float = make_safe_parse_float(parse_float)\n\n # Parse one statement at a time\n # (typically means one line in TOML source)\n while True:\n # 1. Skip line leading whitespace\n pos = skip_chars(src, pos, TOML_WS)\n\n # 2. Parse rules. Expect one of the following:\n # - end of file\n # - end of line\n # - comment\n # - key/value pair\n # - append dict to list (and move to its namespace)\n # - create dict (and move to its namespace)\n # Skip trailing whitespace when applicable.\n try:\n char = src[pos]\n except IndexError:\n break\n if char == \"\\n\":\n pos += 1\n continue\n if char in KEY_INITIAL_CHARS:\n pos = key_value_rule(src, pos, out, header, parse_float)\n pos = skip_chars(src, pos, TOML_WS)\n elif char == \"[\":\n try:\n second_char: str | None = src[pos + 1]\n except IndexError:\n second_char = None\n out.flags.finalize_pending()\n if second_char == \"[\":\n pos, header = create_list_rule(src, pos, out)\n else:\n pos, header = create_dict_rule(src, pos, out)\n pos = skip_chars(src, pos, TOML_WS)\n elif char != \"#\":\n raise suffixed_err(src, pos, \"Invalid statement\")\n\n # 3. Skip comment\n pos = skip_comment(src, pos)\n\n # 4. Expect end of line or end of file\n try:\n char = src[pos]\n except IndexError:\n break\n if char != \"\\n\":\n raise suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )\n pos += 1\n\n return out.data.dict" ], [ "CALL", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "STORE_NAME", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "CALL", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "STORE_NAME", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_NAME", "NamedTuple" ], [ "CALL", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos:\n try:\n while src[pos] in chars:\n pos += 1\n except IndexError:\n pass\n return pos" ], [ "STORE_NAME", "def skip_until(\n src: str,\n pos: Pos,\n expect: str,\n *,\n error_on: frozenset[str],\n error_on_eof: bool,\n) -> Pos:\n try:\n new_pos = src.index(expect, pos)\n except ValueError:\n new_pos = len(src)\n if error_on_eof:\n raise suffixed_err(src, new_pos, f\"Expected {expect!r}\") from None\n\n if not error_on.isdisjoint(src[pos:new_pos]):\n while src[pos] not in error_on:\n pos += 1\n raise suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")\n return new_pos" ], [ "STORE_NAME", "def skip_comment(src: str, pos: Pos) -> Pos:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char == \"#\":\n return skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )\n return pos" ], [ "STORE_NAME", "def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos:\n while True:\n pos_before_skip = pos\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n pos = skip_comment(src, pos)\n if pos == pos_before_skip:\n return pos" ], [ "STORE_NAME", "def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 1 # Skip \"[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot declare {key} twice\")\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.get_or_create_nest(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]\", pos):\n raise suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")\n return pos + 1, key" ], [ "STORE_NAME", "def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 2 # Skip \"[[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n # Free the namespace now that it points to another empty list item...\n out.flags.unset_all(key)\n # ...but this key precisely is still prohibited from table declaration\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.append_nest_to_list(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]]\", pos):\n raise suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")\n return pos + 2, key" ], [ "STORE_NAME", "def key_value_rule(\n src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat\n) -> Pos:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n abs_key_parent = header + key_parent\n\n relative_path_cont_keys = (header + key[:i] for i in range(1, len(key)))\n for cont_key in relative_path_cont_keys:\n # Check that dotted key syntax does not redefine an existing table\n if out.flags.is_(cont_key, Flags.EXPLICIT_NEST):\n raise suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")\n # Containers in the relative path can't be opened with the table syntax or\n # dotted key/value syntax in following table sections.\n out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)\n\n if out.flags.is_(abs_key_parent, Flags.FROZEN):\n raise suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )\n\n try:\n nest = out.data.get_or_create_nest(abs_key_parent)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\")\n # Mark inline table and array namespaces recursively immutable\n if isinstance(value, (dict, list)):\n out.flags.set(header + key, Flags.FROZEN, recursive=True)\n nest[key_stem] = value\n return pos" ], [ "STORE_NAME", "def parse_key_value_pair(\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Key, Any]:\n pos, key = parse_key(src, pos)\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \"=\":\n raise suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, value = parse_value(src, pos, parse_float)\n return pos, key, value" ], [ "STORE_NAME", "def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]:\n pos, key_part = parse_key_part(src, pos)\n key: Key = (key_part,)\n pos = skip_chars(src, pos, TOML_WS)\n while True:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \".\":\n return pos, key\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, key_part = parse_key_part(src, pos)\n key += (key_part,)\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char in BARE_KEY_CHARS:\n start_pos = pos\n pos = skip_chars(src, pos, BARE_KEY_CHARS)\n return pos, src[start_pos:pos]\n if char == \"'\":\n return parse_literal_str(src, pos)\n if char == '\"':\n return parse_one_line_basic_str(src, pos)\n raise suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "STORE_NAME", "def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1\n return parse_basic_str(src, pos, multiline=False)" ], [ "STORE_NAME", "def parse_array(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, list]:\n pos += 1\n array: list = []\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array\n while True:\n pos, val = parse_value(src, pos, parse_float)\n array.append(val)\n pos = skip_comments_and_array_ws(src, pos)\n\n c = src[pos : pos + 1]\n if c == \"]\":\n return pos + 1, array\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed array\")\n pos += 1\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array" ], [ "STORE_NAME", "def parse_inline_table(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, dict]:\n pos += 1\n nested_dict = NestedDict()\n flags = Flags()\n\n pos = skip_chars(src, pos, TOML_WS)\n if src.startswith(\"}\", pos):\n return pos + 1, nested_dict.dict\n while True:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n if flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n try:\n nest = nested_dict.get_or_create_nest(key_parent, access_lists=False)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")\n nest[key_stem] = value\n pos = skip_chars(src, pos, TOML_WS)\n c = src[pos : pos + 1]\n if c == \"}\":\n return pos + 1, nested_dict.dict\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed inline table\")\n if isinstance(value, (dict, list)):\n flags.set(key, Flags.FROZEN, recursive=True)\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_basic_str_escape(\n src: str, pos: Pos, *, multiline: bool = False\n) -> tuple[Pos, str]:\n escape_id = src[pos : pos + 2]\n pos += 2\n if multiline and escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}:\n # Skip whitespace until next non-whitespace character or end of\n # the doc. Error if non-whitespace is found before newline.\n if escape_id != \"\\\\\\n\":\n pos = skip_chars(src, pos, TOML_WS)\n try:\n char = src[pos]\n except IndexError:\n return pos, \"\"\n if char != \"\\n\":\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n return pos, \"\"\n if escape_id == \"\\\\u\":\n return parse_hex_char(src, pos, 4)\n if escape_id == \"\\\\U\":\n return parse_hex_char(src, pos, 8)\n try:\n return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]\n except KeyError:\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\") from None" ], [ "STORE_NAME", "def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]:\n return parse_basic_str_escape(src, pos, multiline=True)" ], [ "STORE_NAME", "def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]:\n hex_str = src[pos : pos + hex_len]\n if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str):\n raise suffixed_err(src, pos, \"Invalid hex value\")\n pos += hex_len\n hex_int = int(hex_str, 16)\n if not is_unicode_scalar_value(hex_int):\n raise suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")\n return pos, chr(hex_int)" ], [ "STORE_NAME", "def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1 # Skip starting apostrophe\n start_pos = pos\n pos = skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )\n return pos + 1, src[start_pos:pos]" ], [ "STORE_NAME", "def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]:\n pos += 3\n if src.startswith(\"\\n\", pos):\n pos += 1\n\n if literal:\n delim = \"'\"\n end_pos = skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )\n result = src[pos:end_pos]\n pos = end_pos + 3\n else:\n delim = '\"'\n pos, result = parse_basic_str(src, pos, multiline=True)\n\n # Add at maximum two extra apostrophes/quotes if the end sequence\n # is 4 or 5 chars long instead of just 3.\n if not src.startswith(delim, pos):\n return pos, result\n pos += 1\n if not src.startswith(delim, pos):\n return pos, result + delim\n pos += 1\n return pos, result + (delim * 2)" ], [ "STORE_NAME", "def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]:\n if multiline:\n error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape_multiline\n else:\n error_on = ILLEGAL_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape\n result = \"\"\n start_pos = pos\n while True:\n try:\n char = src[pos]\n except IndexError:\n raise suffixed_err(src, pos, \"Unterminated string\") from None\n if char == '\"':\n if not multiline:\n return pos + 1, result + src[start_pos:pos]\n if src.startswith('\"\"\"', pos):\n return pos + 3, result + src[start_pos:pos]\n pos += 1\n continue\n if char == \"\\\\\":\n result += src[start_pos:pos]\n pos, parsed_escape = parse_escapes(src, pos)\n result += parsed_escape\n start_pos = pos\n continue\n if char in error_on:\n raise suffixed_err(src, pos, f\"Illegal character {char!r}\")\n pos += 1" ], [ "STORE_NAME", "def parse_value( # noqa: C901\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Any]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n\n # IMPORTANT: order conditions based on speed of checking and likelihood\n\n # Basic strings\n if char == '\"':\n if src.startswith('\"\"\"', pos):\n return parse_multiline_str(src, pos, literal=False)\n return parse_one_line_basic_str(src, pos)\n\n # Literal strings\n if char == \"'\":\n if src.startswith(\"'''\", pos):\n return parse_multiline_str(src, pos, literal=True)\n return parse_literal_str(src, pos)\n\n # Booleans\n if char == \"t\":\n if src.startswith(\"true\", pos):\n return pos + 4, True\n if char == \"f\":\n if src.startswith(\"false\", pos):\n return pos + 5, False\n\n # Arrays\n if char == \"[\":\n return parse_array(src, pos, parse_float)\n\n # Inline tables\n if char == \"{\":\n return parse_inline_table(src, pos, parse_float)\n\n # Dates and times\n datetime_match = RE_DATETIME.match(src, pos)\n if datetime_match:\n try:\n datetime_obj = match_to_datetime(datetime_match)\n except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e\n return datetime_match.end(), datetime_obj\n localtime_match = RE_LOCALTIME.match(src, pos)\n if localtime_match:\n return localtime_match.end(), match_to_localtime(localtime_match)\n\n # Integers and \"normal\" floats.\n # The regex will greedily match any type starting with a decimal\n # char, so needs to be located after handling of dates and times.\n number_match = RE_NUMBER.match(src, pos)\n if number_match:\n return number_match.end(), match_to_number(number_match, parse_float)\n\n # Special floats\n first_three = src[pos : pos + 3]\n if first_three in {\"inf\", \"nan\"}:\n return pos + 3, parse_float(first_three)\n first_four = src[pos : pos + 4]\n if first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}:\n return pos + 4, parse_float(first_four)\n\n raise suffixed_err(src, pos, \"Invalid value\")" ], [ "STORE_NAME", "def suffixed_err(src: str, pos: Pos, msg: str) -> TOMLDecodeError:\n \"\"\"Return a `TOMLDecodeError` where error message is suffixed with\n coordinates in source.\"\"\"\n\n def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"\n\n return TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "STORE_NAME", "def is_unicode_scalar_value(codepoint: int) -> bool:\n return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111)" ], [ "STORE_NAME", "def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat:\n \"\"\"A decorator to make `parse_float` safe.\n\n `parse_float` must not return dicts or lists, because these types\n would be mixed with parsed TOML tables and arrays, thus confusing\n the parser. The returned decorated callable raises `ValueError`\n instead of returning illegal types.\n \"\"\"\n # The default `float` callable never returns illegal types. Optimize it.\n if parse_float is float: # type: ignore[comparison-overlap]\n return float\n\n def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value\n\n return safe_parse_float" ], [ "LOAD_FAST", "(chr(i) for i in range(32))" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL", "chr(i)" ], [ "STORE_NAME", "\"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_FAST", "fp" ], [ "LOAD_ATTR", "fp.read" ], [ "CALL", "fp.read()" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "b" ], [ "LOAD_ATTR", "b.decode" ], [ "CALL", "b.decode()" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "loads" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "loads(s, parse_float=parse_float)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.replace" ], [ "CALL", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "STORE_FAST", "src" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "CALL", "Output(NestedDict(), Flags())" ], [ "STORE_FAST", "out" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "make_safe_parse_float(parse_float)" ], [ "STORE_FAST", "parse_float" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "CONTAINS_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "header" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "key_value_rule(src, pos, out, header, parse_float)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "STORE_FAST", "second_char" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.finalize_pending" ], [ "CALL", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_list_rule(src, pos, out)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_dict_rule(src, pos, out)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "second_char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "STORE_NAME", "\"\"\"Flags that map to parsed keys/namespaces.\"\"\"" ], [ "STORE_NAME", "FROZEN" ], [ "STORE_NAME", "EXPLICIT_NEST" ], [ "STORE_NAME", " def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()" ], [ "STORE_NAME", " def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))" ], [ "STORE_NAME", " def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()" ], [ "STORE_NAME", " def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)" ], [ "STORE_NAME", " def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "STORE_NAME", " def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_ATTR", "self._pending_flags.add" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "STORE_FAST", "key" ], [ "STORE_FAST", "flag" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_ATTR", "self._pending_flags.clear" ], [ "CALL", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_ATTR", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_FAST", "key_parent" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_ATTR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "inner_cont" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"flags\"]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"recursive_flags\"]" ], [ "STORE_NAME", " def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}" ], [ "STORE_NAME", " def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont" ], [ "STORE_NAME", " def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "STORE_FAST", "cont" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "CALL", "self.get_or_create_nest(key[:-1])" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "last_key" ], [ "LOAD_FAST", "last_key" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "last_key in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "STORE_FAST", "list_" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_ATTR", "list_.append" ], [ "CALL", "list_.append({})" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_NAME", "data: NestedDict" ], [ "STORE_SUBSCR", "data: NestedDict" ], [ "LOAD_NAME", "flags: Flags" ], [ "STORE_SUBSCR", "flags: Flags" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.index" ], [ "LOAD_FAST", "expect" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.index(expect, pos)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_ATTR", "error_on.isdisjoint" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SLICE", "src[pos:new_pos]" ], [ "CALL", "error_on.isdisjoint(src[pos:new_pos])" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "BUILD_STRING", "f\"Found invalid character {src[pos]!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "expect" ], [ "BUILD_STRING", "f\"Expected {expect!r}\"" ], [ "CALL", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "pos_before_skip" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos_before_skip" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot declare {key} twice\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.get_or_create_nest(key)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.append_nest_to_list(key)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_DEREF", "key" ], [ "STORE_FAST", "value" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_OP", "header + key_parent" ], [ "STORE_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL", "len(key)" ], [ "CALL", "range(1, len(key))" ], [ "CALL", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "STORE_FAST", "cont_key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "cont_key" ], [ "BUILD_STRING", "f\"Cannot redefine namespace {cont_key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "abs_key_parent" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {abs_key_parent}\"" ], [ "CALL", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL", "out.data.get_or_create_nest(abs_key_parent)" ], [ "STORE_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_OP", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "i" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SLICE", "key[:i]" ], [ "BINARY_OP", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key_part(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key_part" ], [ "LOAD_FAST", "key_part" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_key_part(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key_part" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "key_part" ], [ "BINARY_OP", "key += (key_part,)" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CONTAINS_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "array" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "val" ], [ "LOAD_FAST", "array" ], [ "LOAD_ATTR", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "STORE_FAST", "nested_dict" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "STORE_FAST", "flags" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "key" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "STORE_FAST", "key_parent" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "STORE_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key_stem" ], [ "BUILD_STRING", "f\"Duplicate inline table key {key_stem!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "src[pos : pos + 2]" ], [ "STORE_FAST", "escape_id" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "CONTAINS_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_OP", "pos + hex_len" ], [ "BINARY_SLICE", "src[pos : pos + hex_len]" ], [ "STORE_FAST", "hex_str" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_ATTR", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_OP", "pos += hex_len" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "int(hex_str, 16)" ], [ "STORE_FAST", "hex_int" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 3" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "literal" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "STORE_FAST", "end_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SLICE", "src[pos:end_pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_OP", "end_pos + 3" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_basic_str(src, pos, multiline=True)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "delim * 2" ], [ "BINARY_OP", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "STORE_FAST", "parse_escapes" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "STORE_FAST", "parse_escapes" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result += src[start_pos:pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "parse_escapes" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_escapes(src, pos)" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "parsed_escape" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "parsed_escape" ], [ "BINARY_OP", "result += parsed_escape" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "BUILD_STRING", "f\"Illegal character {char!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_ATTR", "RE_DATETIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_DATETIME.match(src, pos)" ], [ "STORE_FAST", "datetime_match" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL", "match_to_datetime(datetime_match)" ], [ "STORE_FAST", "datetime_obj" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_ATTR", "datetime_match.end" ], [ "CALL", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_ATTR", "RE_LOCALTIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_LOCALTIME.match(src, pos)" ], [ "STORE_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_ATTR", "localtime_match.end" ], [ "CALL", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_ATTR", "RE_NUMBER.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "RE_NUMBER.match(src, pos)" ], [ "STORE_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_ATTR", "number_match.end" ], [ "CALL", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "BINARY_SLICE", "src[pos : pos + 3]" ], [ "STORE_FAST", "first_three" ], [ "LOAD_FAST", "first_three" ], [ "CONTAINS_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL", "parse_float(first_three)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "BINARY_SLICE", "src[pos : pos + 4]" ], [ "STORE_FAST", "first_four" ], [ "LOAD_FAST", "first_four" ], [ "CONTAINS_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid value\")" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "ValueError" ], [ "STORE_FAST", " except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "STORE_FAST", " def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "msg" ], [ "LOAD_FAST", "coord_repr" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL", "coord_repr(src, pos)" ], [ "BUILD_STRING", "f\"{msg} (at {coord_repr(src, pos)})\"" ], [ "CALL", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_OP", "src.count(\"\\n\", 0, pos) + 1" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "STORE_FAST", "column" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_OP", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "STORE_FAST", "column" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "column" ], [ "BUILD_STRING", "f\"line {line}, column {column}\"" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "IS_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "STORE_FAST", " def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL", "parse_float(float_str)" ], [ "STORE_FAST", "float_value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-py-3.13.json000066400000000000000000003076041474076367500246240ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import annotations" ], [ "STORE_NAME", "from collections.abc import Iterable" ], [ "STORE_NAME", "import string" ], [ "STORE_NAME", "from types import MappingProxyType" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from typing import Any, BinaryIO, NamedTuple" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._re import (\n RE_DATETIME,\n RE_LOCALTIME,\n RE_NUMBER,\n match_to_datetime,\n match_to_localtime,\n match_to_number,\n)" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "STORE_NAME", "from ._types import Key, ParseFloat, Pos" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL", "range(32)" ], [ "CALL", "(chr(i) for i in range(32))" ], [ "CALL", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL", "chr(127)" ], [ "CALL", "frozenset(chr(127))" ], [ "BINARY_OP", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "STORE_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "STORE_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\t\\n\")" ], [ "BINARY_OP", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_NAME", "ILLEGAL_COMMENT_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\" \\t\")" ], [ "STORE_NAME", "TOML_WS" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\n\")" ], [ "BINARY_OP", "TOML_WS | frozenset(\"\\n\")" ], [ "STORE_NAME", "TOML_WS_AND_NEWLINE" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits" ], [ "BINARY_OP", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "STORE_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL", "frozenset(\"\\\"'\")" ], [ "BINARY_OP", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "STORE_NAME", "KEY_INITIAL_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL", "frozenset(string.hexdigits)" ], [ "STORE_NAME", "HEXDIGIT_CHARS" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "STORE_NAME", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_NAME", "ValueError" ], [ "CALL", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "STORE_NAME", "class TOMLDecodeError(ValueError):\n \"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def load(fp: BinaryIO, /, *, parse_float: ParseFloat = float) -> dict[str, Any]:\n \"\"\"Parse TOML from a binary file object.\"\"\"\n b = fp.read()\n try:\n s = b.decode()\n except AttributeError:\n raise TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n ) from None\n return loads(s, parse_float=parse_float)" ], [ "LOAD_NAME", "float" ], [ "STORE_NAME", "def loads(s: str, /, *, parse_float: ParseFloat = float) -> dict[str, Any]: # noqa: C901\n \"\"\"Parse TOML from a string.\"\"\"\n\n # The spec allows converting \"\\r\\n\" to \"\\n\", even in string\n # literals. Let's do so to simplify parsing.\n src = s.replace(\"\\r\\n\", \"\\n\")\n pos = 0\n out = Output(NestedDict(), Flags())\n header: Key = ()\n parse_float = make_safe_parse_float(parse_float)\n\n # Parse one statement at a time\n # (typically means one line in TOML source)\n while True:\n # 1. Skip line leading whitespace\n pos = skip_chars(src, pos, TOML_WS)\n\n # 2. Parse rules. Expect one of the following:\n # - end of file\n # - end of line\n # - comment\n # - key/value pair\n # - append dict to list (and move to its namespace)\n # - create dict (and move to its namespace)\n # Skip trailing whitespace when applicable.\n try:\n char = src[pos]\n except IndexError:\n break\n if char == \"\\n\":\n pos += 1\n continue\n if char in KEY_INITIAL_CHARS:\n pos = key_value_rule(src, pos, out, header, parse_float)\n pos = skip_chars(src, pos, TOML_WS)\n elif char == \"[\":\n try:\n second_char: str | None = src[pos + 1]\n except IndexError:\n second_char = None\n out.flags.finalize_pending()\n if second_char == \"[\":\n pos, header = create_list_rule(src, pos, out)\n else:\n pos, header = create_dict_rule(src, pos, out)\n pos = skip_chars(src, pos, TOML_WS)\n elif char != \"#\":\n raise suffixed_err(src, pos, \"Invalid statement\")\n\n # 3. Skip comment\n pos = skip_comment(src, pos)\n\n # 4. Expect end of line or end of file\n try:\n char = src[pos]\n except IndexError:\n break\n if char != \"\\n\":\n raise suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )\n pos += 1\n\n return out.data.dict" ], [ "CALL", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "STORE_NAME", "class Flags:\n \"\"\"Flags that map to parsed keys/namespaces.\"\"\"\n\n # Marks an immutable namespace (inline array or inline table).\n FROZEN = 0\n # Marks a nest that has been explicitly created and can no longer\n # be opened using the \"[table]\" syntax.\n EXPLICIT_NEST = 1\n\n def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()\n\n def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))\n\n def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()\n\n def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)\n\n def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)\n\n def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "CALL", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "STORE_NAME", "class NestedDict:\n def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}\n\n def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont\n\n def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_NAME", "NamedTuple" ], [ "CALL", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "class Output(NamedTuple):\n data: NestedDict\n flags: Flags" ], [ "STORE_NAME", "def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos:\n try:\n while src[pos] in chars:\n pos += 1\n except IndexError:\n pass\n return pos" ], [ "STORE_NAME", "def skip_until(\n src: str,\n pos: Pos,\n expect: str,\n *,\n error_on: frozenset[str],\n error_on_eof: bool,\n) -> Pos:\n try:\n new_pos = src.index(expect, pos)\n except ValueError:\n new_pos = len(src)\n if error_on_eof:\n raise suffixed_err(src, new_pos, f\"Expected {expect!r}\") from None\n\n if not error_on.isdisjoint(src[pos:new_pos]):\n while src[pos] not in error_on:\n pos += 1\n raise suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")\n return new_pos" ], [ "STORE_NAME", "def skip_comment(src: str, pos: Pos) -> Pos:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char == \"#\":\n return skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )\n return pos" ], [ "STORE_NAME", "def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos:\n while True:\n pos_before_skip = pos\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n pos = skip_comment(src, pos)\n if pos == pos_before_skip:\n return pos" ], [ "STORE_NAME", "def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 1 # Skip \"[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot declare {key} twice\")\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.get_or_create_nest(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]\", pos):\n raise suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")\n return pos + 1, key" ], [ "STORE_NAME", "def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]:\n pos += 2 # Skip \"[[\"\n pos = skip_chars(src, pos, TOML_WS)\n pos, key = parse_key(src, pos)\n\n if out.flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n # Free the namespace now that it points to another empty list item...\n out.flags.unset_all(key)\n # ...but this key precisely is still prohibited from table declaration\n out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)\n try:\n out.data.append_nest_to_list(key)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n\n if not src.startswith(\"]]\", pos):\n raise suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")\n return pos + 2, key" ], [ "STORE_NAME", "def key_value_rule(\n src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat\n) -> Pos:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n abs_key_parent = header + key_parent\n\n relative_path_cont_keys = (header + key[:i] for i in range(1, len(key)))\n for cont_key in relative_path_cont_keys:\n # Check that dotted key syntax does not redefine an existing table\n if out.flags.is_(cont_key, Flags.EXPLICIT_NEST):\n raise suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")\n # Containers in the relative path can't be opened with the table syntax or\n # dotted key/value syntax in following table sections.\n out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)\n\n if out.flags.is_(abs_key_parent, Flags.FROZEN):\n raise suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )\n\n try:\n nest = out.data.get_or_create_nest(abs_key_parent)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\")\n # Mark inline table and array namespaces recursively immutable\n if isinstance(value, (dict, list)):\n out.flags.set(header + key, Flags.FROZEN, recursive=True)\n nest[key_stem] = value\n return pos" ], [ "STORE_NAME", "def parse_key_value_pair(\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Key, Any]:\n pos, key = parse_key(src, pos)\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \"=\":\n raise suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, value = parse_value(src, pos, parse_float)\n return pos, key, value" ], [ "STORE_NAME", "def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]:\n pos, key_part = parse_key_part(src, pos)\n key: Key = (key_part,)\n pos = skip_chars(src, pos, TOML_WS)\n while True:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char != \".\":\n return pos, key\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)\n pos, key_part = parse_key_part(src, pos)\n key += (key_part,)\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n if char in BARE_KEY_CHARS:\n start_pos = pos\n pos = skip_chars(src, pos, BARE_KEY_CHARS)\n return pos, src[start_pos:pos]\n if char == \"'\":\n return parse_literal_str(src, pos)\n if char == '\"':\n return parse_one_line_basic_str(src, pos)\n raise suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "STORE_NAME", "def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1\n return parse_basic_str(src, pos, multiline=False)" ], [ "STORE_NAME", "def parse_array(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, list]:\n pos += 1\n array: list = []\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array\n while True:\n pos, val = parse_value(src, pos, parse_float)\n array.append(val)\n pos = skip_comments_and_array_ws(src, pos)\n\n c = src[pos : pos + 1]\n if c == \"]\":\n return pos + 1, array\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed array\")\n pos += 1\n\n pos = skip_comments_and_array_ws(src, pos)\n if src.startswith(\"]\", pos):\n return pos + 1, array" ], [ "STORE_NAME", "def parse_inline_table(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, dict]:\n pos += 1\n nested_dict = NestedDict()\n flags = Flags()\n\n pos = skip_chars(src, pos, TOML_WS)\n if src.startswith(\"}\", pos):\n return pos + 1, nested_dict.dict\n while True:\n pos, key, value = parse_key_value_pair(src, pos, parse_float)\n key_parent, key_stem = key[:-1], key[-1]\n if flags.is_(key, Flags.FROZEN):\n raise suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")\n try:\n nest = nested_dict.get_or_create_nest(key_parent, access_lists=False)\n except KeyError:\n raise suffixed_err(src, pos, \"Cannot overwrite a value\") from None\n if key_stem in nest:\n raise suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")\n nest[key_stem] = value\n pos = skip_chars(src, pos, TOML_WS)\n c = src[pos : pos + 1]\n if c == \"}\":\n return pos + 1, nested_dict.dict\n if c != \",\":\n raise suffixed_err(src, pos, \"Unclosed inline table\")\n if isinstance(value, (dict, list)):\n flags.set(key, Flags.FROZEN, recursive=True)\n pos += 1\n pos = skip_chars(src, pos, TOML_WS)" ], [ "STORE_NAME", "def parse_basic_str_escape(\n src: str, pos: Pos, *, multiline: bool = False\n) -> tuple[Pos, str]:\n escape_id = src[pos : pos + 2]\n pos += 2\n if multiline and escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}:\n # Skip whitespace until next non-whitespace character or end of\n # the doc. Error if non-whitespace is found before newline.\n if escape_id != \"\\\\\\n\":\n pos = skip_chars(src, pos, TOML_WS)\n try:\n char = src[pos]\n except IndexError:\n return pos, \"\"\n if char != \"\\n\":\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")\n pos += 1\n pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE)\n return pos, \"\"\n if escape_id == \"\\\\u\":\n return parse_hex_char(src, pos, 4)\n if escape_id == \"\\\\U\":\n return parse_hex_char(src, pos, 8)\n try:\n return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]\n except KeyError:\n raise suffixed_err(src, pos, \"Unescaped '\\\\' in a string\") from None" ], [ "STORE_NAME", "def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]:\n return parse_basic_str_escape(src, pos, multiline=True)" ], [ "STORE_NAME", "def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]:\n hex_str = src[pos : pos + hex_len]\n if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str):\n raise suffixed_err(src, pos, \"Invalid hex value\")\n pos += hex_len\n hex_int = int(hex_str, 16)\n if not is_unicode_scalar_value(hex_int):\n raise suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")\n return pos, chr(hex_int)" ], [ "STORE_NAME", "def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]:\n pos += 1 # Skip starting apostrophe\n start_pos = pos\n pos = skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )\n return pos + 1, src[start_pos:pos]" ], [ "STORE_NAME", "def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]:\n pos += 3\n if src.startswith(\"\\n\", pos):\n pos += 1\n\n if literal:\n delim = \"'\"\n end_pos = skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )\n result = src[pos:end_pos]\n pos = end_pos + 3\n else:\n delim = '\"'\n pos, result = parse_basic_str(src, pos, multiline=True)\n\n # Add at maximum two extra apostrophes/quotes if the end sequence\n # is 4 or 5 chars long instead of just 3.\n if not src.startswith(delim, pos):\n return pos, result\n pos += 1\n if not src.startswith(delim, pos):\n return pos, result + delim\n pos += 1\n return pos, result + (delim * 2)" ], [ "STORE_NAME", "def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]:\n if multiline:\n error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape_multiline\n else:\n error_on = ILLEGAL_BASIC_STR_CHARS\n parse_escapes = parse_basic_str_escape\n result = \"\"\n start_pos = pos\n while True:\n try:\n char = src[pos]\n except IndexError:\n raise suffixed_err(src, pos, \"Unterminated string\") from None\n if char == '\"':\n if not multiline:\n return pos + 1, result + src[start_pos:pos]\n if src.startswith('\"\"\"', pos):\n return pos + 3, result + src[start_pos:pos]\n pos += 1\n continue\n if char == \"\\\\\":\n result += src[start_pos:pos]\n pos, parsed_escape = parse_escapes(src, pos)\n result += parsed_escape\n start_pos = pos\n continue\n if char in error_on:\n raise suffixed_err(src, pos, f\"Illegal character {char!r}\")\n pos += 1" ], [ "STORE_NAME", "def parse_value( # noqa: C901\n src: str, pos: Pos, parse_float: ParseFloat\n) -> tuple[Pos, Any]:\n try:\n char: str | None = src[pos]\n except IndexError:\n char = None\n\n # IMPORTANT: order conditions based on speed of checking and likelihood\n\n # Basic strings\n if char == '\"':\n if src.startswith('\"\"\"', pos):\n return parse_multiline_str(src, pos, literal=False)\n return parse_one_line_basic_str(src, pos)\n\n # Literal strings\n if char == \"'\":\n if src.startswith(\"'''\", pos):\n return parse_multiline_str(src, pos, literal=True)\n return parse_literal_str(src, pos)\n\n # Booleans\n if char == \"t\":\n if src.startswith(\"true\", pos):\n return pos + 4, True\n if char == \"f\":\n if src.startswith(\"false\", pos):\n return pos + 5, False\n\n # Arrays\n if char == \"[\":\n return parse_array(src, pos, parse_float)\n\n # Inline tables\n if char == \"{\":\n return parse_inline_table(src, pos, parse_float)\n\n # Dates and times\n datetime_match = RE_DATETIME.match(src, pos)\n if datetime_match:\n try:\n datetime_obj = match_to_datetime(datetime_match)\n except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e\n return datetime_match.end(), datetime_obj\n localtime_match = RE_LOCALTIME.match(src, pos)\n if localtime_match:\n return localtime_match.end(), match_to_localtime(localtime_match)\n\n # Integers and \"normal\" floats.\n # The regex will greedily match any type starting with a decimal\n # char, so needs to be located after handling of dates and times.\n number_match = RE_NUMBER.match(src, pos)\n if number_match:\n return number_match.end(), match_to_number(number_match, parse_float)\n\n # Special floats\n first_three = src[pos : pos + 3]\n if first_three in {\"inf\", \"nan\"}:\n return pos + 3, parse_float(first_three)\n first_four = src[pos : pos + 4]\n if first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}:\n return pos + 4, parse_float(first_four)\n\n raise suffixed_err(src, pos, \"Invalid value\")" ], [ "STORE_NAME", "def suffixed_err(src: str, pos: Pos, msg: str) -> TOMLDecodeError:\n \"\"\"Return a `TOMLDecodeError` where error message is suffixed with\n coordinates in source.\"\"\"\n\n def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"\n\n return TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "STORE_NAME", "def is_unicode_scalar_value(codepoint: int) -> bool:\n return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111)" ], [ "STORE_NAME", "def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat:\n \"\"\"A decorator to make `parse_float` safe.\n\n `parse_float` must not return dicts or lists, because these types\n would be mixed with parsed TOML tables and arrays, thus confusing\n the parser. The returned decorated callable raises `ValueError`\n instead of returning illegal types.\n \"\"\"\n # The default `float` callable never returns illegal types. Optimize it.\n if parse_float is float: # type: ignore[comparison-overlap]\n return float\n\n def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value\n\n return safe_parse_float" ], [ "LOAD_FAST", "(chr(i) for i in range(32))" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL", "chr(i)" ], [ "STORE_NAME", "\"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "STORE_NAME", "\"\"\"An error raised if a document is not valid TOML.\"\"\"" ], [ "LOAD_FAST", "fp" ], [ "LOAD_ATTR", "fp.read" ], [ "CALL", "fp.read()" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "b" ], [ "LOAD_ATTR", "b.decode" ], [ "CALL", "b.decode()" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "loads" ], [ "CALL_KW", "loads(s, parse_float=parse_float)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.replace" ], [ "CALL", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "STORE_FAST", "src" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "CALL", "Output(NestedDict(), Flags())" ], [ "STORE_FAST", "out" ], [ "STORE_FAST", "header" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "make_safe_parse_float(parse_float)" ], [ "STORE_FAST", "parse_float" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "CONTAINS_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "key_value_rule(src, pos, out, header, parse_float)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "STORE_FAST", "second_char" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.finalize_pending" ], [ "CALL", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_list_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "out" ], [ "CALL", "create_dict_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "second_char" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "STORE_NAME", "\"\"\"Flags that map to parsed keys/namespaces.\"\"\"" ], [ "STORE_NAME", "FROZEN" ], [ "STORE_NAME", "EXPLICIT_NEST" ], [ "STORE_NAME", " def __init__(self) -> None:\n self._flags: dict[str, dict] = {}\n self._pending_flags: set[tuple[Key, int]] = set()" ], [ "STORE_NAME", " def add_pending(self, key: Key, flag: int) -> None:\n self._pending_flags.add((key, flag))" ], [ "STORE_NAME", " def finalize_pending(self) -> None:\n for key, flag in self._pending_flags:\n self.set(key, flag, recursive=False)\n self._pending_flags.clear()" ], [ "STORE_NAME", " def unset_all(self, key: Key) -> None:\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return\n cont = cont[k][\"nested\"]\n cont.pop(key[-1], None)" ], [ "STORE_NAME", " def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003\n cont = self._flags\n key_parent, key_stem = key[:-1], key[-1]\n for k in key_parent:\n if k not in cont:\n cont[k] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont = cont[k][\"nested\"]\n if key_stem not in cont:\n cont[key_stem] = {\"flags\": set(), \"recursive_flags\": set(), \"nested\": {}}\n cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "STORE_NAME", " def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "STORE_NAME", " def is_(self, key: Key, flag: int) -> bool:\n if not key:\n return False # document root has no flags\n cont = self._flags\n for k in key[:-1]:\n if k not in cont:\n return False\n inner_cont = cont[k]\n if flag in inner_cont[\"recursive_flags\"]:\n return True\n cont = inner_cont[\"nested\"]\n key_stem = key[-1]\n if key_stem in cont:\n cont = cont[key_stem]\n return flag in cont[\"flags\"] or flag in cont[\"recursive_flags\"]\n return False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_ATTR", "self._pending_flags.add" ], [ "CALL", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set" ], [ "CALL_KW", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_ATTR", "self._pending_flags.clear" ], [ "CALL", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "CONTAINS_OP", "k not in cont" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_ATTR", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_parent" ], [ "STORE_FAST", "k" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "CONTAINS_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_ATTR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "STORE_FAST", "k" ], [ "CONTAINS_OP", "k not in cont" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "key_stem" ], [ "CONTAINS_OP", "key_stem in cont" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "STORE_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"flags\"]" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"recursive_flags\"]" ], [ "STORE_NAME", " def __init__(self) -> None:\n # The parsed content of the TOML document\n self.dict: dict[str, Any] = {}" ], [ "STORE_NAME", " def get_or_create_nest(\n self,\n key: Key,\n *,\n access_lists: bool = True,\n ) -> dict:\n cont: Any = self.dict\n for k in key:\n if k not in cont:\n cont[k] = {}\n cont = cont[k]\n if access_lists and isinstance(cont, list):\n cont = cont[-1]\n if not isinstance(cont, dict):\n raise KeyError(\"There is no nest behind this key\")\n return cont" ], [ "STORE_NAME", " def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "STORE_NAME", " def append_nest_to_list(self, key: Key) -> None:\n cont = self.get_or_create_nest(key[:-1])\n last_key = key[-1]\n if last_key in cont:\n list_ = cont[last_key]\n if not isinstance(list_, list):\n raise KeyError(\"An object other than list found behind this key\")\n list_.append({})\n else:\n cont[last_key] = [{}]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "STORE_FAST", "k" ], [ "CONTAINS_OP", "k not in cont" ], [ "STORE_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "STORE_FAST", "cont" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "CALL", "self.get_or_create_nest(key[:-1])" ], [ "STORE_FAST", "cont" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "STORE_FAST", "last_key" ], [ "CONTAINS_OP", "last_key in cont" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "STORE_FAST", "list_" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_ATTR", "list_.append" ], [ "CALL", "list_.append({})" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_NAME", "data: NestedDict" ], [ "STORE_SUBSCR", "data: NestedDict" ], [ "LOAD_NAME", "flags: Flags" ], [ "STORE_SUBSCR", "flags: Flags" ], [ "STORE_NAME", "flags: Flags" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.index" ], [ "CALL", "src.index(expect, pos)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_ATTR", "error_on.isdisjoint" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SLICE", "src[pos:new_pos]" ], [ "CALL", "error_on.isdisjoint(src[pos:new_pos])" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "BUILD_STRING", "f\"Found invalid character {src[pos]!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "STORE_FAST", "new_pos" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "expect" ], [ "BUILD_STRING", "f\"Expected {expect!r}\"" ], [ "CALL", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL_KW", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "pos_before_skip" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "CALL", "skip_comment(src, pos)" ], [ "STORE_FAST", "pos" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "CALL", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot declare {key} twice\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.get_or_create_nest(key)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key" ], [ "CALL", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL", "out.data.append_nest_to_list(key)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "pos" ], [ "STORE_DEREF", "key" ], [ "STORE_FAST", "value" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_OP", "header + key_parent" ], [ "STORE_FAST", "abs_key_parent" ], [ "LOAD_FAST", "(header + key[:i] for i in range(1, len(key)))" ], [ "LOAD_FAST", "(header + key[:i] for i in range(1, len(key)))" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL", "len(key)" ], [ "CALL", "range(1, len(key))" ], [ "CALL", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "STORE_FAST", "cont_key" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "cont_key" ], [ "BUILD_STRING", "f\"Cannot redefine namespace {cont_key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "abs_key_parent" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {abs_key_parent}\"" ], [ "CALL", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL", "out.data.get_or_create_nest(abs_key_parent)" ], [ "STORE_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_OP", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_KW", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "(header + key[:i] for i in range(1, len(key)))" ], [ "STORE_FAST", "i" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SLICE", "key[:i]" ], [ "BINARY_OP", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "CALL", "parse_key(src, pos)" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "CALL", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "CALL", "parse_key_part(src, pos)" ], [ "BINARY_OP", "key += (key_part,)" ], [ "STORE_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CONTAINS_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "STORE_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "CALL_KW", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "array" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "array" ], [ "LOAD_ATTR", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "CALL", "skip_comments_and_array_ws(src, pos)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL", "NestedDict()" ], [ "STORE_FAST", "nested_dict" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL", "Flags()" ], [ "STORE_FAST", "flags" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_key_value_pair(src, pos, parse_float)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "key" ], [ "BINARY_SLICE", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "key" ], [ "BUILD_STRING", "f\"Cannot mutate immutable namespace {key}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL_KW", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "STORE_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "key_stem" ], [ "BUILD_STRING", "f\"Duplicate inline table key {key_stem!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "src[pos : pos + 1]" ], [ "STORE_FAST", "c" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_KW", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "src[pos : pos + 2]" ], [ "STORE_FAST", "escape_id" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "CONTAINS_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL", "skip_chars(src, pos, TOML_WS)" ], [ "STORE_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "CALL", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "CALL", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "CALL_KW", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "BINARY_OP", "pos + hex_len" ], [ "BINARY_SLICE", "src[pos : pos + hex_len]" ], [ "STORE_FAST", "hex_str" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_ATTR", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "BINARY_OP", "pos += hex_len" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL", "int(hex_str, 16)" ], [ "STORE_FAST", "hex_int" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL_KW", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 3" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "literal" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL_KW", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "STORE_FAST", "end_pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SLICE", "src[pos:end_pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_OP", "end_pos + 3" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "delim" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "CALL_KW", "parse_basic_str(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "CALL", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "delim" ], [ "BINARY_OP", "delim * 2" ], [ "BINARY_OP", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "STORE_FAST", "parse_escapes" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "STORE_FAST", "error_on" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "STORE_FAST", "parse_escapes" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "BINARY_SLICE", "src[start_pos:pos]" ], [ "BINARY_OP", "result += src[start_pos:pos]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "parse_escapes" ], [ "CALL", "parse_escapes(src, pos)" ], [ "BINARY_OP", "result += parsed_escape" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "pos" ], [ "STORE_FAST", "start_pos" ], [ "CONTAINS_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "char" ], [ "BUILD_STRING", "f\"Illegal character {char!r}\"" ], [ "CALL", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "STORE_FAST", "char" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "CALL_KW", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "CALL", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "CALL_KW", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "CALL", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "parse_float" ], [ "CALL", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_ATTR", "RE_DATETIME.match" ], [ "CALL", "RE_DATETIME.match(src, pos)" ], [ "STORE_FAST", "datetime_match" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL", "match_to_datetime(datetime_match)" ], [ "STORE_FAST", "datetime_obj" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_ATTR", "datetime_match.end" ], [ "CALL", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_ATTR", "RE_LOCALTIME.match" ], [ "CALL", "RE_LOCALTIME.match(src, pos)" ], [ "STORE_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_ATTR", "localtime_match.end" ], [ "CALL", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_ATTR", "RE_NUMBER.match" ], [ "CALL", "RE_NUMBER.match(src, pos)" ], [ "STORE_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_ATTR", "number_match.end" ], [ "CALL", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "CALL", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "BINARY_SLICE", "src[pos : pos + 3]" ], [ "STORE_FAST", "first_three" ], [ "LOAD_FAST", "first_three" ], [ "CONTAINS_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL", "parse_float(first_three)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "BINARY_SLICE", "src[pos : pos + 4]" ], [ "STORE_FAST", "first_four" ], [ "LOAD_FAST", "first_four" ], [ "CONTAINS_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Invalid value\")" ], [ "LOAD_GLOBAL", "IndexError" ], [ "STORE_FAST", "char" ], [ "LOAD_GLOBAL", "ValueError" ], [ "STORE_FAST", " except ValueError as e:\n raise suffixed_err(src, pos, \"Invalid date or datetime\") from e" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "CALL", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "STORE_FAST", " def coord_repr(src: str, pos: Pos) -> str:\n if pos >= len(src):\n return \"end of document\"\n line = src.count(\"\\n\", 0, pos) + 1\n if line == 1:\n column = pos + 1\n else:\n column = pos - src.rindex(\"\\n\", 0, pos)\n return f\"line {line}, column {column}\"" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "msg" ], [ "LOAD_FAST", "coord_repr" ], [ "CALL", "coord_repr(src, pos)" ], [ "BUILD_STRING", "f\"{msg} (at {coord_repr(src, pos)})\"" ], [ "CALL", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_ATTR", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_OP", "src.count(\"\\n\", 0, pos) + 1" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "STORE_FAST", "column" ], [ "LOAD_ATTR", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_OP", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "STORE_FAST", "column" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "column" ], [ "BUILD_STRING", "f\"line {line}, column {column}\"" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "COMPARE_OP", "0 <= codepoint <= 55295" ], [ "LOAD_FAST", "codepoint" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "COMPARE_OP", "57344 <= codepoint <= 1114111" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "IS_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_FAST", " def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value" ], [ "STORE_FAST", " def safe_parse_float(float_str: str) -> Any:\n float_value = parse_float(float_str)\n if isinstance(float_value, (dict, list)):\n raise ValueError(\"parse_float must not return dicts or lists\")\n return float_value" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL", "parse_float(float_str)" ], [ "STORE_FAST", "float_value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-py-3.5.json000066400000000000000000000000041474076367500245250ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-py-3.6.json000066400000000000000000000000041474076367500245260ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-py-3.7.json000066400000000000000000000000041474076367500245270ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-py-3.8.json000066400000000000000000002135351474076367500245470ustar00rootroot00000000000000[ [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL_FUNCTION", "range(32)" ], [ "CALL_FUNCTION", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL_FUNCTION", "chr(127)" ], [ "CALL_FUNCTION", "frozenset(chr(127))" ], [ "BINARY_OR", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\\n\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\" \\t\")" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\n\")" ], [ "BINARY_OR", "TOML_WS | frozenset(\"\\n\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL_FUNCTION", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\\"'\")" ], [ "BINARY_OR", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL_FUNCTION", "frozenset(string.hexdigits)" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL_FUNCTION", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "chr(i)" ], [ "LOAD_FAST", "fp" ], [ "LOAD_METHOD", "fp.read" ], [ "CALL_METHOD", "fp.read()" ], [ "LOAD_FAST", "b" ], [ "LOAD_METHOD", "b.decode" ], [ "CALL_METHOD", "b.decode()" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_GLOBAL", "loads" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION_KW", "loads(s, parse_float=parse_float)" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "CALL_FUNCTION", "Output(NestedDict(), Flags())" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "make_safe_parse_float(parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "COMPARE_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "header" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "key_value_rule(src, pos, out, header, parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.finalize_pending" ], [ "CALL_METHOD", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_list_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_dict_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.add" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_FUNCTION_KW", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.clear" ], [ "CALL_METHOD", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_METHOD", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL_METHOD", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_parent" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "COMPARE_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "key_stem in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "COMPARE_OP", "flag in cont[\"flags\"]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "COMPARE_OP", "flag in cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "CALL_METHOD", "self.get_or_create_nest(key[:-1])" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "last_key" ], [ "LOAD_FAST", "cont" ], [ "COMPARE_OP", "last_key in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_METHOD", "list_.append" ], [ "CALL_METHOD", "list_.append({})" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "COMPARE_OP", "src[pos] in chars" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.index" ], [ "LOAD_FAST", "expect" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.index(expect, pos)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_METHOD", "error_on.isdisjoint" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SUBSCR", "src[pos:new_pos]" ], [ "CALL_METHOD", "error_on.isdisjoint(src[pos:new_pos])" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "COMPARE_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "BINARY_SUBSCR", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos_before_skip" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.get_or_create_nest(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.append_nest_to_list(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_ADD", "header + key_parent" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL_FUNCTION", "len(key)" ], [ "CALL_FUNCTION", "range(1, len(key))" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL_METHOD", "out.data.get_or_create_nest(abs_key_parent)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "COMPARE_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_ADD", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "key[:i]" ], [ "BINARY_ADD", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "COMPARE_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "array" ], [ "LOAD_METHOD", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL_METHOD", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "flags" ], [ "LOAD_METHOD", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL_FUNCTION_KW", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "COMPARE_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "src[pos : pos + 2]" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_ADD", "pos + hex_len" ], [ "BINARY_SUBSCR", "src[pos : pos + hex_len]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_METHOD", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_METHOD", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "LOAD_FAST", "hex_len" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "int(hex_str, 16)" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "literal" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SUBSCR", "src[pos:end_pos]" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_ADD", "end_pos + 3" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_ADD", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_MULTIPLY", "delim * 2" ], [ "BINARY_ADD", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "parse_escapes" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_escapes(src, pos)" ], [ "LOAD_FAST", "parsed_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_FAST", "error_on" ], [ "COMPARE_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_METHOD", "RE_DATETIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_DATETIME.match(src, pos)" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL_FUNCTION", "match_to_datetime(datetime_match)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_METHOD", "datetime_match.end" ], [ "CALL_METHOD", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_METHOD", "RE_LOCALTIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_LOCALTIME.match(src, pos)" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_METHOD", "localtime_match.end" ], [ "CALL_METHOD", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL_FUNCTION", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_METHOD", "RE_NUMBER.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_NUMBER.match(src, pos)" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_METHOD", "number_match.end" ], [ "CALL_METHOD", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "BINARY_SUBSCR", "src[pos : pos + 3]" ], [ "LOAD_FAST", "first_three" ], [ "COMPARE_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL_FUNCTION", "parse_float(first_three)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "BINARY_SUBSCR", "src[pos : pos + 4]" ], [ "LOAD_FAST", "first_four" ], [ "COMPARE_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL_FUNCTION", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid value\")" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "" ], [ "CALL_FUNCTION", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_ADD", "src.count(\"\\n\", 0, pos) + 1" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_SUBTRACT", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "COMPARE_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL_FUNCTION", "parse_float(float_str)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-py-3.9.json000066400000000000000000002137341474076367500245510ustar00rootroot00000000000000[ [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "range" ], [ "CALL_FUNCTION", "range(32)" ], [ "CALL_FUNCTION", "frozenset(chr(i) for i in range(32))" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "chr" ], [ "CALL_FUNCTION", "chr(127)" ], [ "CALL_FUNCTION", "frozenset(chr(127))" ], [ "BINARY_OR", "frozenset(chr(i) for i in range(32)) | frozenset(chr(127))" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\")" ], [ "LOAD_NAME", "ASCII_CTRL" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\t\\n\")" ], [ "BINARY_SUBTRACT", "ASCII_CTRL - frozenset(\"\\t\\n\")" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_NAME", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\" \\t\")" ], [ "LOAD_NAME", "TOML_WS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\n\")" ], [ "BINARY_OR", "TOML_WS | frozenset(\"\\n\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.ascii_letters" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits" ], [ "BINARY_ADD", "string.ascii_letters + string.digits + \"-_\"" ], [ "CALL_FUNCTION", "frozenset(string.ascii_letters + string.digits + \"-_\")" ], [ "LOAD_NAME", "BARE_KEY_CHARS" ], [ "LOAD_NAME", "frozenset" ], [ "CALL_FUNCTION", "frozenset(\"\\\"'\")" ], [ "BINARY_OR", "BARE_KEY_CHARS | frozenset(\"\\\"'\")" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "string" ], [ "LOAD_ATTR", "string.hexdigits" ], [ "CALL_FUNCTION", "frozenset(string.hexdigits)" ], [ "LOAD_NAME", "MappingProxyType" ], [ "CALL_FUNCTION", "MappingProxyType(\n {\n \"\\\\b\": \"\\u0008\", # backspace\n \"\\\\t\": \"\\u0009\", # tab\n \"\\\\n\": \"\\u000A\", # linefeed\n \"\\\\f\": \"\\u000C\", # form feed\n \"\\\\r\": \"\\u000D\", # carriage return\n '\\\\\"': \"\\u0022\", # quote\n \"\\\\\\\\\": \"\\u005C\", # backslash\n }\n)" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "chr(i)" ], [ "LOAD_FAST", "fp" ], [ "LOAD_METHOD", "fp.read" ], [ "CALL_METHOD", "fp.read()" ], [ "LOAD_FAST", "b" ], [ "LOAD_METHOD", "b.decode" ], [ "CALL_METHOD", "b.decode()" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\n \"File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`\"\n )" ], [ "LOAD_GLOBAL", "loads" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION_KW", "loads(s, parse_float=parse_float)" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace(\"\\r\\n\", \"\\n\")" ], [ "LOAD_GLOBAL", "Output" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "CALL_FUNCTION", "Output(NestedDict(), Flags())" ], [ "LOAD_GLOBAL", "make_safe_parse_float" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "make_safe_parse_float(parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\n\"" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "KEY_INITIAL_CHARS" ], [ "CONTAINS_OP", "char in KEY_INITIAL_CHARS" ], [ "LOAD_GLOBAL", "key_value_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "header" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "key_value_rule(src, pos, out, header, parse_float)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos + 1]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.finalize_pending" ], [ "CALL_METHOD", "out.flags.finalize_pending()" ], [ "LOAD_FAST", "second_char" ], [ "COMPARE_OP", "second_char == \"[\"" ], [ "LOAD_GLOBAL", "create_list_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_list_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "create_dict_rule" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "out" ], [ "CALL_FUNCTION", "create_dict_rule(src, pos, out)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"#\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid statement\")" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, \"Expected newline or end of document after a statement\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_ATTR", "out.data.dict" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._flags" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.add" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "self._pending_flags.add((key, flag))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "flag" ], [ "CALL_FUNCTION_KW", "self.set(key, flag, recursive=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pending_flags" ], [ "LOAD_METHOD", "self._pending_flags.clear" ], [ "CALL_METHOD", "self._pending_flags.clear()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_METHOD", "cont.pop" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "CALL_METHOD", "cont.pop(key[-1], None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_parent" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "BINARY_SUBSCR", "cont[k][\"nested\"]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem not in cont" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "recursive" ], [ "BINARY_SUBSCR", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"]" ], [ "LOAD_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add" ], [ "LOAD_FAST", "flag" ], [ "CALL_METHOD", "cont[key_stem][\"recursive_flags\" if recursive else \"flags\"].add(flag)" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._flags" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in inner_cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "inner_cont" ], [ "BINARY_SUBSCR", "inner_cont[\"nested\"]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "key_stem in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "key_stem" ], [ "BINARY_SUBSCR", "cont[key_stem]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"flags\"]" ], [ "LOAD_FAST", "flag" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[\"recursive_flags\"]" ], [ "CONTAINS_OP", "flag in cont[\"recursive_flags\"]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dict" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "k not in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "STORE_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "cont[k]" ], [ "LOAD_FAST", "access_lists" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(cont, list)" ], [ "LOAD_FAST", "cont" ], [ "BINARY_SUBSCR", "cont[-1]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "cont" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "isinstance(cont, dict)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"There is no nest behind this key\")" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "CALL_METHOD", "self.get_or_create_nest(key[:-1])" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "last_key" ], [ "LOAD_FAST", "cont" ], [ "CONTAINS_OP", "last_key in cont" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "BINARY_SUBSCR", "cont[last_key]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "list_" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(list_, list)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "CALL_FUNCTION", "KeyError(\"An object other than list found behind this key\")" ], [ "LOAD_FAST", "list_" ], [ "LOAD_METHOD", "list_.append" ], [ "CALL_METHOD", "list_.append({})" ], [ "LOAD_FAST", "cont" ], [ "LOAD_FAST", "last_key" ], [ "STORE_SUBSCR", "cont[last_key]" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "chars" ], [ "CONTAINS_OP", "src[pos] in chars" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.index" ], [ "LOAD_FAST", "expect" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.index(expect, pos)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "LOAD_FAST", "error_on_eof" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "expect" ], [ "CALL_FUNCTION", "suffixed_err(src, new_pos, f\"Expected {expect!r}\")" ], [ "LOAD_FAST", "error_on" ], [ "LOAD_METHOD", "error_on.isdisjoint" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "new_pos" ], [ "BINARY_SUBSCR", "src[pos:new_pos]" ], [ "CALL_METHOD", "error_on.isdisjoint(src[pos:new_pos])" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "src[pos] not in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Found invalid character {src[pos]!r}\")" ], [ "LOAD_FAST", "new_pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"#\"" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_GLOBAL", "ILLEGAL_COMMENT_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos + 1, \"\\n\", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False\n )" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_GLOBAL", "skip_comment" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comment(src, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos_before_skip" ], [ "COMPARE_OP", "pos == pos_before_skip" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot declare {key} twice\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.get_or_create_nest(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']' at the end of a table declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.unset_all" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.flags.unset_all(key)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_FUNCTION_KW", "out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.append_nest_to_list" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "out.data.append_nest_to_list(key)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]]\", pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected ']]' at the end of an array declaration\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_DEREF", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_DEREF", "header" ], [ "LOAD_FAST", "key_parent" ], [ "BINARY_ADD", "header + key_parent" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "key" ], [ "CALL_FUNCTION", "len(key)" ], [ "CALL_FUNCTION", "range(1, len(key))" ], [ "LOAD_FAST", "relative_path_cont_keys" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.is_(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "cont_key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot redefine namespace {cont_key}\")" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.add_pending" ], [ "LOAD_FAST", "cont_key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.EXPLICIT_NEST" ], [ "CALL_METHOD", "out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST)" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_METHOD", "out.flags.is_" ], [ "LOAD_FAST", "abs_key_parent" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "out.flags.is_(abs_key_parent, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL_FUNCTION", "suffixed_err(\n src, pos, f\"Cannot mutate immutable namespace {abs_key_parent}\"\n )" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.data" ], [ "LOAD_METHOD", "out.data.get_or_create_nest" ], [ "LOAD_FAST", "abs_key_parent" ], [ "CALL_METHOD", "out.data.get_or_create_nest(abs_key_parent)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "out" ], [ "LOAD_ATTR", "out.flags" ], [ "LOAD_ATTR", "out.flags.set" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "BINARY_ADD", "header + key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "out.flags.set(header + key, Flags.FROZEN, recursive=True)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_FAST", "pos" ], [ "LOAD_DEREF", "header" ], [ "LOAD_DEREF", "key" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "key[:i]" ], [ "BINARY_ADD", "header + key[:i]" ], [ "LOAD_GLOBAL", "parse_key" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"=\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Expected '=' after a key in a key/value pair\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \".\"" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_GLOBAL", "parse_key_part" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_key_part(src, pos)" ], [ "LOAD_FAST", "key_part" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CONTAINS_OP", "char in BARE_KEY_CHARS" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BARE_KEY_CHARS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, BARE_KEY_CHARS)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid initial character for a key part\")" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=False)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "parse_value" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_value(src, pos, parse_float)" ], [ "LOAD_FAST", "array" ], [ "LOAD_METHOD", "array.append" ], [ "LOAD_FAST", "val" ], [ "CALL_METHOD", "array.append(val)" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"]\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed array\")" ], [ "LOAD_GLOBAL", "skip_comments_and_array_ws" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "skip_comments_and_array_ws(src, pos)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"]\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "array" ], [ "LOAD_GLOBAL", "NestedDict" ], [ "CALL_FUNCTION", "NestedDict()" ], [ "LOAD_GLOBAL", "Flags" ], [ "CALL_FUNCTION", "Flags()" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"}\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_GLOBAL", "parse_key_value_pair" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_key_value_pair(src, pos, parse_float)" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[:-1]" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "key[-1]" ], [ "LOAD_FAST", "flags" ], [ "LOAD_METHOD", "flags.is_" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_METHOD", "flags.is_(key, Flags.FROZEN)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Cannot mutate immutable namespace {key}\")" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.get_or_create_nest" ], [ "LOAD_FAST", "key_parent" ], [ "CALL_FUNCTION_KW", "nested_dict.get_or_create_nest(key_parent, access_lists=False)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Cannot overwrite a value\")" ], [ "LOAD_FAST", "key_stem" ], [ "LOAD_FAST", "nest" ], [ "CONTAINS_OP", "key_stem in nest" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "key_stem" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Duplicate inline table key {key_stem!r}\")" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "nest" ], [ "LOAD_FAST", "key_stem" ], [ "STORE_SUBSCR", "nest[key_stem]" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "src[pos : pos + 1]" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c == \"}\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "nested_dict" ], [ "LOAD_ATTR", "nested_dict.dict" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c != \",\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unclosed inline table\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(value, (dict, list))" ], [ "LOAD_FAST", "flags" ], [ "LOAD_ATTR", "flags.set" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "Flags" ], [ "LOAD_ATTR", "Flags.FROZEN" ], [ "CALL_FUNCTION_KW", "flags.set(key, Flags.FROZEN, recursive=True)" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "src[pos : pos + 2]" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "escape_id" ], [ "CONTAINS_OP", "escape_id in {\"\\\\ \", \"\\\\\\t\", \"\\\\\\n\"}" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id != \"\\\\\\n\"" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char != \"\\n\"" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "skip_chars" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "TOML_WS_AND_NEWLINE" ], [ "CALL_FUNCTION", "skip_chars(src, pos, TOML_WS_AND_NEWLINE)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\u\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 4)" ], [ "LOAD_FAST", "escape_id" ], [ "COMPARE_OP", "escape_id == \"\\\\U\"" ], [ "LOAD_GLOBAL", "parse_hex_char" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_hex_char(src, pos, 8)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "BASIC_STR_ESCAPE_REPLACEMENTS" ], [ "LOAD_FAST", "escape_id" ], [ "BINARY_SUBSCR", "BASIC_STR_ESCAPE_REPLACEMENTS[escape_id]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unescaped '\\\\' in a string\")" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str_escape(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "hex_len" ], [ "BINARY_ADD", "pos + hex_len" ], [ "BINARY_SUBSCR", "src[pos : pos + hex_len]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "len(hex_str)" ], [ "LOAD_FAST", "hex_len" ], [ "COMPARE_OP", "len(hex_str) != hex_len" ], [ "LOAD_GLOBAL", "HEXDIGIT_CHARS" ], [ "LOAD_METHOD", "HEXDIGIT_CHARS.issuperset" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_METHOD", "HEXDIGIT_CHARS.issuperset(hex_str)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid hex value\")" ], [ "LOAD_FAST", "hex_len" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "hex_str" ], [ "CALL_FUNCTION", "int(hex_str, 16)" ], [ "LOAD_GLOBAL", "is_unicode_scalar_value" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "is_unicode_scalar_value(hex_int)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Escaped character is not a Unicode scalar value\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "chr" ], [ "LOAD_FAST", "hex_int" ], [ "CALL_FUNCTION", "chr(hex_int)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src, pos, \"'\", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True\n )" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"\\n\", pos)" ], [ "LOAD_FAST", "literal" ], [ "LOAD_GLOBAL", "skip_until" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_LITERAL_STR_CHARS" ], [ "CALL_FUNCTION_KW", "skip_until(\n src,\n pos,\n \"'''\",\n error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS,\n error_on_eof=True,\n )" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_SUBSCR", "src[pos:end_pos]" ], [ "LOAD_FAST", "end_pos" ], [ "BINARY_ADD", "end_pos + 3" ], [ "LOAD_GLOBAL", "parse_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_basic_str(src, pos, multiline=True)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "delim" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(delim, pos)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_ADD", "result + delim" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "delim" ], [ "BINARY_MULTIPLY", "delim * 2" ], [ "BINARY_ADD", "result + (delim * 2)" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_MULTILINE_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape_multiline" ], [ "LOAD_GLOBAL", "ILLEGAL_BASIC_STR_CHARS" ], [ "LOAD_GLOBAL", "parse_basic_str_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Unterminated string\")" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "multiline" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "BINARY_ADD", "result + src[start_pos:pos]" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"\\\\\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "start_pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[start_pos:pos]" ], [ "LOAD_FAST", "parse_escapes" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_escapes(src, pos)" ], [ "LOAD_FAST", "parsed_escape" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "LOAD_FAST", "error_on" ], [ "CONTAINS_OP", "char in error_on" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "char" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, f\"Illegal character {char!r}\")" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "src[pos]" ], [ "LOAD_GLOBAL", "IndexError" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == '\"'" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith('\"\"\"', pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=False)" ], [ "LOAD_GLOBAL", "parse_one_line_basic_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_one_line_basic_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"'\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"'''\", pos)" ], [ "LOAD_GLOBAL", "parse_multiline_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION_KW", "parse_multiline_str(src, pos, literal=True)" ], [ "LOAD_GLOBAL", "parse_literal_str" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "parse_literal_str(src, pos)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"t\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"true\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"f\"" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.startswith" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.startswith(\"false\", pos)" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 5" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"[\"" ], [ "LOAD_GLOBAL", "parse_array" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_array(src, pos, parse_float)" ], [ "LOAD_FAST", "char" ], [ "COMPARE_OP", "char == \"{\"" ], [ "LOAD_GLOBAL", "parse_inline_table" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "parse_inline_table(src, pos, parse_float)" ], [ "LOAD_GLOBAL", "RE_DATETIME" ], [ "LOAD_METHOD", "RE_DATETIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_DATETIME.match(src, pos)" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_GLOBAL", "match_to_datetime" ], [ "LOAD_FAST", "datetime_match" ], [ "CALL_FUNCTION", "match_to_datetime(datetime_match)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid date or datetime\")" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "datetime_match" ], [ "LOAD_METHOD", "datetime_match.end" ], [ "CALL_METHOD", "datetime_match.end()" ], [ "LOAD_FAST", "datetime_obj" ], [ "LOAD_GLOBAL", "RE_LOCALTIME" ], [ "LOAD_METHOD", "RE_LOCALTIME.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_LOCALTIME.match(src, pos)" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_FAST", "localtime_match" ], [ "LOAD_METHOD", "localtime_match.end" ], [ "CALL_METHOD", "localtime_match.end()" ], [ "LOAD_GLOBAL", "match_to_localtime" ], [ "LOAD_FAST", "localtime_match" ], [ "CALL_FUNCTION", "match_to_localtime(localtime_match)" ], [ "LOAD_GLOBAL", "RE_NUMBER" ], [ "LOAD_METHOD", "RE_NUMBER.match" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "RE_NUMBER.match(src, pos)" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_METHOD", "number_match.end" ], [ "CALL_METHOD", "number_match.end()" ], [ "LOAD_GLOBAL", "match_to_number" ], [ "LOAD_FAST", "number_match" ], [ "LOAD_FAST", "parse_float" ], [ "CALL_FUNCTION", "match_to_number(number_match, parse_float)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "BINARY_SUBSCR", "src[pos : pos + 3]" ], [ "LOAD_FAST", "first_three" ], [ "CONTAINS_OP", "first_three in {\"inf\", \"nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 3" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_three" ], [ "CALL_FUNCTION", "parse_float(first_three)" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "BINARY_SUBSCR", "src[pos : pos + 4]" ], [ "LOAD_FAST", "first_four" ], [ "CONTAINS_OP", "first_four in {\"-inf\", \"+inf\", \"-nan\", \"+nan\"}" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 4" ], [ "LOAD_FAST", "parse_float" ], [ "LOAD_FAST", "first_four" ], [ "CALL_FUNCTION", "parse_float(first_four)" ], [ "LOAD_GLOBAL", "suffixed_err" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "suffixed_err(src, pos, \"Invalid value\")" ], [ "LOAD_GLOBAL", "TOMLDecodeError" ], [ "LOAD_FAST", "msg" ], [ "LOAD_FAST", "coord_repr" ], [ "LOAD_FAST", "src" ], [ "LOAD_FAST", "pos" ], [ "CALL_FUNCTION", "coord_repr(src, pos)" ], [ "CALL_FUNCTION", "TOMLDecodeError(f\"{msg} (at {coord_repr(src, pos)})\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "src" ], [ "CALL_FUNCTION", "len(src)" ], [ "COMPARE_OP", "pos >= len(src)" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.count" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.count(\"\\n\", 0, pos)" ], [ "BINARY_ADD", "src.count(\"\\n\", 0, pos) + 1" ], [ "LOAD_FAST", "line" ], [ "COMPARE_OP", "line == 1" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "src" ], [ "LOAD_METHOD", "src.rindex" ], [ "LOAD_FAST", "pos" ], [ "CALL_METHOD", "src.rindex(\"\\n\", 0, pos)" ], [ "BINARY_SUBTRACT", "pos - src.rindex(\"\\n\", 0, pos)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "column" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_FAST", "codepoint" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_GLOBAL", "float" ], [ "IS_OP", "parse_float is float" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_FAST", "safe_parse_float" ], [ "LOAD_DEREF", "parse_float" ], [ "LOAD_FAST", "float_str" ], [ "CALL_FUNCTION", "parse_float(float_str)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "float_value" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(float_value, (dict, list))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"parse_float must not return dicts or lists\")" ], [ "LOAD_FAST", "float_value" ] ]python-executing-2.2.0/tests/sample_results/_parser-pypy-2.7.json000066400000000000000000000000041474076367500250770ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-pypy-3.5.json000066400000000000000000000000041474076367500250760ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/_parser-pypy-3.6.json000066400000000000000000000000041474076367500250770ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/bird-py-2.7.json000066400000000000000000004037361474076367500240360ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).__init__" ], [ "CALL_FUNCTION", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_FUNCTION", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_FUNCTION", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "CALL_FUNCTION", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_ATTR", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_ATTR", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_FUNCTION", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.copy" ], [ "CALL_FUNCTION", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "f_locals" ], [ "LOAD_ATTR", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "f_locals.pop(name)" ], [ "LOAD_FAST", "f_locals" ], [ "LOAD_ATTR", "f_locals.items" ], [ "CALL_FUNCTION", "f_locals.items()" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "CALL_FUNCTION", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._call_id" ], [ "CALL_FUNCTION", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_FUNCTION", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_ATTR", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_FUNCTION", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_FUNCTION", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_FUNCTION", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_ATTR", "top_iteration.extract_iterations" ], [ "CALL_FUNCTION", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.names" ], [ "CALL_FUNCTION", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_ATTR", "iteration.vals.items" ], [ "CALL_FUNCTION", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "SLICE+2", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_ATTR", "iteration.loops.values" ], [ "CALL_FUNCTION", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_ATTR", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_FUNCTION", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_ATTR", "source_file.startswith" ], [ "CALL_FUNCTION", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_ATTR", "frame.f_globals.get" ], [ "CALL_FUNCTION", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_ATTR", "read_source_file(filename).splitlines" ], [ "CALL_FUNCTION", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SLICE+2", "lines[:frame.f_lineno]" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_FUNCTION", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_ATTR", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_NAME", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "inspect.iscode(code)" ], [ "UNARY_NOT", "not inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "code.co_name.startswith" ], [ "CALL_FUNCTION", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_ATTR", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_FUNCTION", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.splitlines" ], [ "CALL_FUNCTION", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_FUNCTION", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_FUNCTION", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.encode" ], [ "CALL_FUNCTION", "s.encode('utf8')" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_ATTR", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_ATTR", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_FUNCTION", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.sort" ], [ "CALL_FUNCTION", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "SLICE+3", "traced_file.source[start:position.index]" ], [ "CALL_FUNCTION", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_FUNCTION", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_FUNCTION", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_FUNCTION", "''.join(html_parts)" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.split" ], [ "CALL_FUNCTION", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "SLICE+3", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_FUNCTION", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.strip" ], [ "CALL_FUNCTION", "html_body.strip('\\n')" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_ATTR", "comprehensions.values" ], [ "CALL_FUNCTION", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_ATTR", "self.loops.items" ], [ "CALL_FUNCTION", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.extract_iterations" ], [ "CALL_FUNCTION", "iteration.extract_iterations()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_FUNCTION", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_ATTR", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.last" ], [ "CALL_FUNCTION", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_ATTR", "self.data.items" ], [ "CALL_FUNCTION", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_ATTR", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "NodeValue.expression(samples, value, level)" ], [ "CALL_FUNCTION", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_FUNCTION", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_ATTR", "attrs.append" ], [ "CALL_FUNCTION", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_FUNCTION", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.10.json000066400000000000000000003734171474076367500241130ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "IS_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "IS_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "IS_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "IS_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "IS_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "IS_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "IS_OP", "filename is not None" ], [ "LOAD_FAST", "context" ], [ "COMPARE_OP", "context >= 0" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CONTAINS_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "CONTAINS_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "IS_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "IS_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "IS_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "CONTAINS_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "CONTAINS_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "IS_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "IS_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "CONTAINS_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "IS_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.11.json000066400000000000000000010367301474076367500241070ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "from future.utils import iteritems" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "import typing" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import html" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import traceback" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from threading import Lock" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "import hashlib" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from asttokens import ASTTokens" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from outdated import warn_if_outdated" ], [ "STORE_NAME", "from cached_property import cached_property" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye import tracer" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye import __version__" ], [ "STORE_NAME", "from numpy import ndarray" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class ndarray(object):\n pass" ], [ "STORE_NAME", " class ndarray(object):\n pass" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class DataFrame(object):\n pass" ], [ "STORE_NAME", " class DataFrame(object):\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class Series(object):\n pass" ], [ "STORE_NAME", " class Series(object):\n pass" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "STORE_NAME", "CodeInfo" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "CALL", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "STORE_NAME", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL", "BirdsEye()" ], [ "STORE_NAME", "eye" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "STORE_NAME", "HTMLPosition" ], [ "STORE_NAME", "def _deep_dict():\n return defaultdict(_deep_dict)" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "STORE_NAME", "_bad_codes" ], [ "STORE_NAME", "def _tracing_recursively(frame):\n while frame:\n if frame.f_code in _bad_codes:\n return True\n frame = frame.f_back" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "STORE_NAME", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "CALL", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "STORE_NAME", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_NAME", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL", "TypeRegistry()" ], [ "STORE_NAME", "type_registry" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "def _safe_iter(val, f=lambda x: x):\n try:\n for x in f(val):\n yield x\n except:\n pass" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "STORE_NAME", "def is_interesting_expression(node):\n # type: (ast.AST) -> bool\n \"\"\"\n If this expression has a value that may not be exactly what it looks like,\n return True. Put differently, return False if this is just a literal.\n \"\"\"\n return (isinstance(node, ast.expr) and\n not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node)))))" ], [ "STORE_NAME", "def is_obvious_builtin(node, value):\n # type: (ast.expr, Any) -> bool\n \"\"\"\n Return True if this node looks like a builtin and it really is\n (i.e. hasn't been shadowed).\n \"\"\"\n # noinspection PyUnresolvedReferences\n builtins = cast(dict, __builtins__)\n return ((isinstance(node, ast.Name) and\n node.id in builtins and\n builtins[node.id] is value) or\n isinstance(node, getattr(ast, 'NameConstant', ())))" ], [ "STORE_NAME", "\"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_NAME", "cached_property" ], [ "CALL", "cached_property" ], [ "STORE_NAME", " @cached_property\n def db(self):\n return Database(self._db_uri)" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())" ], [ "STORE_NAME", " def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)" ], [ "STORE_NAME", " def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True" ], [ "STORE_NAME", " def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value" ], [ "STORE_NAME", " def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "STORE_NAME", " def _call_id(self):\n # type: () -> Text\n return uuid4().hex" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id" ], [ "STORE_NAME", " def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)" ], [ "STORE_NAME", " def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)" ], [ "STORE_NAME", " def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)" ], [ "STORE_NAME", " def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "STORE_NAME", " def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_NAME", "retry_db" ], [ "CALL", "retry_db" ], [ "STORE_NAME", " @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "STORE_NAME", " def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)" ], [ "STORE_NAME", " def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')" ], [ "STORE_NAME", " def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL", "ast.walk(root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "IS_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "IS_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL", "enumerate(loops)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL", "len(loops)" ], [ "BINARY_OP", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "CALL", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "IS_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "node_value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_OP", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_OP", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "STORE_FAST", "node_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "IS_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "STORE_FAST", "is_special_comprehension_iter" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "CALL", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_OP", "node._loops + (node.parent,)" ], [ "STORE_DEREF", "loops" ], [ "STORE_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL", "comprehension_iter_proxy()" ], [ "CALL", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "STORE_FAST", "item" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.inner_calls.pop(node, None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "NodeValue.exception(exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "IS_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "STORE_FAST", "code_info" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "STORE_FAST", "arguments" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.copy" ], [ "CALL", "frame.f_locals.copy()" ], [ "STORE_DEREF", "f_locals" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "CALL", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.items" ], [ "CALL", "f_locals.items()" ], [ "CALL", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "BINARY_OP", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "arguments" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "CALL", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._call_id" ], [ "CALL", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL", "self.stack.get(enter_info.caller_frame)" ], [ "STORE_FAST", "prev" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL", "getattr(prev, 'inner_calls', None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL", "f_locals.pop(name)" ], [ "LOAD_FAST", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "it" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_DEREF", "frame_info" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "STORE_DEREF", "top_iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "_deep_dict()" ], [ "STORE_DEREF", "node_values" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "STORE_DEREF", "db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "STORE_FAST", "exc" ], [ "LOAD_FAST", "exc" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "STORE_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL", "exception_string(exc)" ], [ "STORE_DEREF", "exception" ], [ "STORE_DEREF", "traceback_str" ], [ "STORE_DEREF", "exception" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL", "retry_db" ], [ "STORE_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "add_call" ], [ "CALL", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "STORE_FAST", "Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_METHOD", "top_iteration.extract_iterations" ], [ "CALL", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_METHOD", "type_registry.names" ], [ "CALL", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "STORE_FAST", "call" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL", "session.add(call)" ], [ "CALL", " with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_METHOD", "iteration.vals.items" ], [ "CALL", "iteration.vals.items()" ], [ "STORE_FAST", "tree_index" ], [ "STORE_FAST", "node_value" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_OP", "(tree_index,) + path" ], [ "STORE_FAST", "full_path" ], [ "LOAD_FAST", "node_values" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "STORE_FAST", "path_k" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_METHOD", "iteration.loops.values" ], [ "CALL", "iteration.loops.values()" ], [ "STORE_FAST", "loop" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL", "enumerate(loop)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "super(BirdsEye, self).trace_function(func)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL", "self._code_infos.get(new_func.__code__)" ], [ "STORE_FAST", "code_info" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcelines(func)" ], [ "STORE_FAST", "lines" ], [ "STORE_FAST", "start_lineno" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL", "len(lines)" ], [ "BINARY_OP", "start_lineno + len(lines)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL", "safe_qualname(func)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "source_file" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_METHOD", "source_file.startswith" ], [ "CALL", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL", "inspect.getsourcefile(frame)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context -= 1" ], [ "STORE_FAST", "context" ], [ "LOAD_FAST", "context" ], [ "COMPARE_OP", "context >= 0" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL", "os.path.abspath(filename)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_METHOD", "frame.f_globals.get" ], [ "CALL", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CONTAINS_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "LOAD_METHOD", "read_source_file(filename).splitlines" ], [ "CALL", "read_source_file(filename).splitlines()" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_OP", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "'\\n'.join(lines)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "STORE_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "STORE_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL", "self.compile(source, filename)" ], [ "STORE_DEREF", "traced_file" ], [ "LOAD_FAST", "globs" ], [ "LOAD_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "CALL", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_DEREF", "nodes_by_lineno" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL", "exec(traced_file.code, globs, locs)" ], [ "LOAD_FAST", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_METHOD", "code.co_name.startswith" ], [ "CALL", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "STORE_FAST", "lineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL", "nodes_by_lineno.get(lineno)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_OP", "node.last_token.end[0] + 1" ], [ "CALL", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.splitlines" ], [ "CALL", "source.splitlines()" ], [ "CALL", "len(source.splitlines())" ], [ "BINARY_OP", "start_lineno + len(source.splitlines())" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "STORE_FAST", "nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "CALL", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "STORE_FAST", "data_dict" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "STORE_FAST", "tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "CALL", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "STORE_FAST", "func_node" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL", "source_without_decorators(tokens, func_node)" ], [ "STORE_FAST", "func_startpos" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_METHOD", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL", "json.dumps(data_dict, sort_keys=True)" ], [ "STORE_FAST", "data" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "_" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL", "[n._tree_index for n in node._loops]" ], [ "LOAD_FAST", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_FAST", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "classes" ], [ "CONTAINS_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "STORE_FAST", "target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "STORE_FAST", "target" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL", "tokens.get_text_range(target)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "tokens.get_text_range(node)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "STORE_FAST", " def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_OP", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_OP", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_OP", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL", "str(start_lineno)" ], [ "BINARY_OP", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL", "h(filename + name + html_body + data + str(start_lineno))" ], [ "STORE_FAST", "function_hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "STORE_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "CALL", " with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.encode" ], [ "CALL", "s.encode('utf8')" ], [ "CALL", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "traced_file.tokens.get_text_range(node)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "start == end == 0" ], [ "COMPARE_OP", "start == end == 0" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL", "ast.walk(traced_file.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_OP", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "STORE_FAST", "positions" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL", "' '.join(classes)" ], [ "BUILD_STRING", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "[n[0] for n in nodes]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL", "len(traced_file.source)" ], [ "CALL", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.sort" ], [ "CALL", "positions.sort()" ], [ "STORE_FAST", "html_parts" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "positions" ], [ "STORE_FAST", "position" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL", "html.escape(traced_file.source[start:position.index])" ], [ "CALL", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "STORE_FAST", "start" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL", "''.join(html_parts)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.split" ], [ "CALL", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_OP", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "STORE_FAST", "html_body" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.strip" ], [ "CALL", "html_body.strip('\\n')" ], [ "LOAD_FAST", "[n[0] for n in nodes]" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "STORE_FAST", "comprehensions" ], [ "STORE_FAST", " def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_METHOD", "comprehensions.values" ], [ "CALL", "comprehensions.values()" ], [ "STORE_FAST", "comp_list" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "STORE_FAST", "comp" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "IS_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL", "get_start(comp.parent)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno += 1" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "start" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "CONTAINS_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "STORE_NAME", "\"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False" ], [ "STORE_NAME", " def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_METHOD", "self.loops.items" ], [ "CALL", "self.loops.items()" ], [ "CALL", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "tree_index" ], [ "STORE_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "CALL", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "LOAD_FAST", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_METHOD", "iteration.extract_iterations" ], [ "CALL", "iteration.extract_iterations()" ], [ "STORE_NAME", "\"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"" ], [ "STORE_NAME", "side_len" ], [ "STORE_NAME", " def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()" ], [ "STORE_NAME", " def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1" ], [ "STORE_NAME", " def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)" ], [ "STORE_NAME", " def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]" ], [ "STORE_NAME", " def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "BINARY_OP", "self.length += 1" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.last" ], [ "CALL", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "BINARY_OP", "self.recorded[node] += 1" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "long" ], [ "BINARY_OP", "basic_types += (long,)" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_OP", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "BINARY_OP", "special_types += (unicode if PY2 else bytes,)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL", "len(special_types)" ], [ "STORE_NAME", "num_special_types" ], [ "STORE_NAME", " def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]" ], [ "STORE_NAME", " def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]" ], [ "STORE_NAME", " def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "STORE_FAST", "t" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL", "correct_type(item)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "CALL", " with self.lock:\n return self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_METHOD", "self.data.items" ], [ "CALL", "self.data.items()" ], [ "CALL", "((v, k) for k, v in self.data.items())" ], [ "CALL", "dict((v, k) for k, v in self.data.items())" ], [ "STORE_DEREF", "rev" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL", "len(rev)" ], [ "CALL", "range(len(rev))" ], [ "CALL", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_FAST", "((v, k) for k, v in self.data.items())" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL", "safe_qualname(rev[i])" ], [ "STORE_NAME", "\"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None" ], [ "STORE_NAME", " def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value" ], [ "STORE_NAME", " def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "STORE_NAME", " def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL", "NodeValue.expression(samples, value, level)" ], [ "CALL", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "exception_string(exc_value)" ], [ "CALL", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL", "cls(cheap_repr(val), type_registry[val])" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL", "len(val)" ], [ "STORE_FAST", "length" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL", "min(level, 2)" ], [ "STORE_FAST", "level" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_OP", "level - 1" ], [ "CALL", "partial(result.add_child, samples, level - 1)" ], [ "STORE_FAST", "add_child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Series, ndarray))" ], [ "STORE_FAST", "attrs" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_METHOD", "attrs.append" ], [ "CALL", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL", "getattr(val, name)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL", "add_child(name, attr)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "STORE_FAST", "sample_type" ], [ "STORE_FAST", "sample_type" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "STORE_FAST", "samples" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL", "isinstance(val, DataFrame)" ], [ "STORE_FAST", "meta" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "STORE_FAST", "max_rows" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "STORE_FAST", "max_cols" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_OP", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_OP", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "STORE_FAST", "columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL", "len(columns)" ], [ "STORE_FAST", "num_cols" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_OP", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_OP", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL", "_sample_indices(num_cols, max_cols)" ], [ "CALL", "set(_sample_indices(num_cols, max_cols))" ], [ "STORE_FAST", "indices" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_METHOD", "val.columns.format" ], [ "CALL", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "formatted_name" ], [ "STORE_FAST", "label" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "CONTAINS_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL", "_sample_indices(length, samples['pandas_rows'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_METHOD", "val.index[i:i + 1].format" ], [ "CALL", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL", "_sample_indices(length, samples['list'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL", "_safe_iter(val)" ], [ "STORE_FAST", "vals" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "STORE_FAST", "num_items" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_OP", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL", "islice(vals, num_items)" ], [ "STORE_FAST", "vals" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL", "enumerate(vals)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL", "getattr(val, '__dict__', None)" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL", "type(val)" ], [ "CALL", "getattr(type(val), '__slots__', None)" ], [ "CALL", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL", "getattr(val, s)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL", "add_child(str(s), attr)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL", "f(val)" ], [ "STORE_FAST", "x" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_METHOD", "x.index[i:i + 1].format" ], [ "CALL", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "CALL", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "CALL", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_FAST", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL", "cast(dict, __builtins__)" ], [ "STORE_FAST", "builtins" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "CONTAINS_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "IS_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.12.json000066400000000000000000010477161474076367500241160ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "from future.utils import iteritems" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "import typing" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import html" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import traceback" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from threading import Lock" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "import hashlib" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from asttokens import ASTTokens" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from outdated import warn_if_outdated" ], [ "STORE_NAME", "from cached_property import cached_property" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye import tracer" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye import __version__" ], [ "STORE_NAME", "from numpy import ndarray" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "STORE_NAME", "CodeInfo" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "CALL", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "STORE_NAME", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL", "BirdsEye()" ], [ "STORE_NAME", "eye" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "STORE_NAME", "HTMLPosition" ], [ "STORE_NAME", "def _deep_dict():\n return defaultdict(_deep_dict)" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "STORE_NAME", "_bad_codes" ], [ "STORE_NAME", "def _tracing_recursively(frame):\n while frame:\n if frame.f_code in _bad_codes:\n return True\n frame = frame.f_back" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "STORE_NAME", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "CALL", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "STORE_NAME", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_NAME", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL", "TypeRegistry()" ], [ "STORE_NAME", "type_registry" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "def _safe_iter(val, f=lambda x: x):\n try:\n for x in f(val):\n yield x\n except:\n pass" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "STORE_NAME", "def is_interesting_expression(node):\n # type: (ast.AST) -> bool\n \"\"\"\n If this expression has a value that may not be exactly what it looks like,\n return True. Put differently, return False if this is just a literal.\n \"\"\"\n return (isinstance(node, ast.expr) and\n not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node)))))" ], [ "STORE_NAME", "def is_obvious_builtin(node, value):\n # type: (ast.expr, Any) -> bool\n \"\"\"\n Return True if this node looks like a builtin and it really is\n (i.e. hasn't been shadowed).\n \"\"\"\n # noinspection PyUnresolvedReferences\n builtins = cast(dict, __builtins__)\n return ((isinstance(node, ast.Name) and\n node.id in builtins and\n builtins[node.id] is value) or\n isinstance(node, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class ndarray(object):\n pass" ], [ "STORE_NAME", " class ndarray(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class DataFrame(object):\n pass" ], [ "STORE_NAME", " class DataFrame(object):\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class Series(object):\n pass" ], [ "STORE_NAME", " class Series(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "STORE_NAME", "\"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_NAME", "cached_property" ], [ "CALL", "cached_property" ], [ "STORE_NAME", " @cached_property\n def db(self):\n return Database(self._db_uri)" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())" ], [ "STORE_NAME", " def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)" ], [ "STORE_NAME", " def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True" ], [ "STORE_NAME", " def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value" ], [ "STORE_NAME", " def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "STORE_NAME", " def _call_id(self):\n # type: () -> Text\n return uuid4().hex" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id" ], [ "STORE_NAME", " def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)" ], [ "STORE_NAME", " def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)" ], [ "STORE_NAME", " def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)" ], [ "STORE_NAME", " def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "STORE_NAME", " def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_NAME", "retry_db" ], [ "CALL", "retry_db" ], [ "STORE_NAME", " @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "STORE_NAME", " def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)" ], [ "STORE_NAME", " def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')" ], [ "STORE_NAME", " def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).__init__" ], [ "CALL", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL", "ast.walk(root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "IS_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "IS_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL", "enumerate(loops)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL", "len(loops)" ], [ "BINARY_OP", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "CALL", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "IS_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "node_value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_OP", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_OP", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "STORE_FAST", "node_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "IS_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "STORE_FAST", "is_special_comprehension_iter" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "CALL", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_OP", "node._loops + (node.parent,)" ], [ "STORE_DEREF", "loops" ], [ "STORE_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL", "comprehension_iter_proxy()" ], [ "CALL", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "STORE_FAST", "item" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_ATTR", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.inner_calls.pop(node, None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_ATTR", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "NodeValue.exception(exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "IS_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "STORE_FAST", "code_info" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "STORE_FAST", "arguments" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.copy" ], [ "CALL", "frame.f_locals.copy()" ], [ "STORE_FAST", "f_locals" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_FAST_AND_CLEAR", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "f_locals" ], [ "LOAD_ATTR", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL", "f_locals.pop(name)" ], [ "STORE_FAST", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "LOAD_FAST", "f_locals" ], [ "LOAD_ATTR", "f_locals.items" ], [ "CALL", "f_locals.items()" ], [ "LOAD_FAST_AND_CLEAR", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "it" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "STORE_FAST", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "BINARY_OP", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "arguments" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "LOAD_FAST_AND_CLEAR", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "LOAD_FAST_AND_CLEAR", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL", "cheap_repr(v)" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "CALL", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._call_id" ], [ "CALL", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL", "self.stack.get(enter_info.caller_frame)" ], [ "STORE_FAST", "prev" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL", "getattr(prev, 'inner_calls', None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_ATTR", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "STORE_FAST", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "STORE_FAST", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_DEREF", "frame_info" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "STORE_DEREF", "top_iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "_deep_dict()" ], [ "STORE_DEREF", "node_values" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "STORE_DEREF", "db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "STORE_FAST", "exc" ], [ "LOAD_FAST", "exc" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "STORE_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL", "exception_string(exc)" ], [ "STORE_DEREF", "exception" ], [ "STORE_DEREF", "traceback_str" ], [ "STORE_DEREF", "exception" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL", "retry_db" ], [ "STORE_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "add_call" ], [ "CALL", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "STORE_FAST", "Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_ATTR", "top_iteration.extract_iterations" ], [ "CALL", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.names" ], [ "CALL", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "STORE_FAST", "call" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL", "session.add(call)" ], [ "CALL", " with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_ATTR", "iteration.vals.items" ], [ "CALL", "iteration.vals.items()" ], [ "STORE_FAST", "tree_index" ], [ "STORE_FAST", "node_value" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_OP", "(tree_index,) + path" ], [ "STORE_FAST", "full_path" ], [ "LOAD_FAST", "node_values" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SLICE", "full_path[:-1]" ], [ "STORE_FAST", "path_k" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_ATTR", "iteration.loops.values" ], [ "CALL", "iteration.loops.values()" ], [ "STORE_FAST", "loop" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL", "enumerate(loop)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "super(BirdsEye, self).trace_function(func)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_ATTR", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL", "self._code_infos.get(new_func.__code__)" ], [ "STORE_FAST", "code_info" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcelines(func)" ], [ "STORE_FAST", "lines" ], [ "STORE_FAST", "start_lineno" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL", "len(lines)" ], [ "BINARY_OP", "start_lineno + len(lines)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL", "safe_qualname(func)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "source_file" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_ATTR", "source_file.startswith" ], [ "CALL", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL", "inspect.getsourcefile(frame)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context -= 1" ], [ "STORE_FAST", "context" ], [ "LOAD_FAST", "context" ], [ "COMPARE_OP", "context >= 0" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL", "os.path.abspath(filename)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_ATTR", "frame.f_globals.get" ], [ "CALL", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CONTAINS_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "LOAD_ATTR", "read_source_file(filename).splitlines" ], [ "CALL", "read_source_file(filename).splitlines()" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_OP", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SLICE", "lines[:frame.f_lineno]" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "'\\n'.join(lines)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "STORE_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "STORE_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL", "self.compile(source, filename)" ], [ "STORE_DEREF", "traced_file" ], [ "LOAD_FAST", "globs" ], [ "LOAD_ATTR", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST_AND_CLEAR", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_DEREF", "nodes_by_lineno" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL", "exec(traced_file.code, globs, locs)" ], [ "STORE_FAST", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "code.co_name.startswith" ], [ "CALL", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "STORE_FAST", "lineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_ATTR", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL", "nodes_by_lineno.get(lineno)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_OP", "node.last_token.end[0] + 1" ], [ "CALL", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.splitlines" ], [ "CALL", "source.splitlines()" ], [ "CALL", "len(source.splitlines())" ], [ "BINARY_OP", "start_lineno + len(source.splitlines())" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "STORE_FAST", "nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "_" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST_AND_CLEAR", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "STORE_FAST", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "CALL", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "STORE_FAST", "data_dict" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "STORE_FAST", "tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "CALL", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "STORE_FAST", "func_node" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL", "source_without_decorators(tokens, func_node)" ], [ "STORE_FAST", "func_startpos" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL", "json.dumps(data_dict, sort_keys=True)" ], [ "STORE_FAST", "data" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "STORE_FAST", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "classes" ], [ "CONTAINS_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "STORE_FAST", "target" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL", "tokens.get_text_range(target)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "STORE_FAST", "target" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "tokens.get_text_range(node)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "func_start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "STORE_FAST", " def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_OP", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_OP", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_OP", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL", "str(start_lineno)" ], [ "BINARY_OP", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL", "h(filename + name + html_body + data + str(start_lineno))" ], [ "STORE_FAST", "function_hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "STORE_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "CALL", " with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.encode" ], [ "CALL", "s.encode('utf8')" ], [ "CALL", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_ATTR", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "traced_file.tokens.get_text_range(node)" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "start == end == 0" ], [ "COMPARE_OP", "start == end == 0" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL", "ast.walk(traced_file.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_OP", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "STORE_FAST", "positions" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_ATTR", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL", "' '.join(classes)" ], [ "BUILD_STRING", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST_AND_CLEAR", "[n[0] for n in nodes]" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "STORE_FAST", "[n[0] for n in nodes]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL", "len(traced_file.source)" ], [ "CALL", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.sort" ], [ "CALL", "positions.sort()" ], [ "STORE_FAST", "html_parts" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "positions" ], [ "STORE_FAST", "position" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SLICE", "traced_file.source[start:position.index]" ], [ "CALL", "html.escape(traced_file.source[start:position.index])" ], [ "CALL", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "STORE_FAST", "start" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL", "''.join(html_parts)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.split" ], [ "CALL", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_OP", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno - 1" ], [ "BINARY_SLICE", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "STORE_FAST", "html_body" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.strip" ], [ "CALL", "html_body.strip('\\n')" ], [ "STORE_FAST", "[n[0] for n in nodes]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "STORE_FAST", "comprehensions" ], [ "STORE_FAST", " def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_ATTR", "comprehensions.values" ], [ "CALL", "comprehensions.values()" ], [ "STORE_FAST", "comp_list" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "STORE_FAST", "comp" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "IS_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL", "get_start(comp.parent)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno += 1" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "start" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "CONTAINS_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "STORE_NAME", "\"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False" ], [ "STORE_NAME", " def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_ATTR", "self.loops.items" ], [ "CALL", "self.loops.items()" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "tree_index" ], [ "STORE_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST_AND_CLEAR", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.extract_iterations" ], [ "CALL", "iteration.extract_iterations()" ], [ "STORE_FAST", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_NAME", "\"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"" ], [ "STORE_NAME", "side_len" ], [ "STORE_NAME", " def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()" ], [ "STORE_NAME", " def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1" ], [ "STORE_NAME", " def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)" ], [ "STORE_NAME", " def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]" ], [ "STORE_NAME", " def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_ATTR", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "BINARY_OP", "self.length += 1" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.last" ], [ "CALL", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "BINARY_OP", "self.recorded[node] += 1" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "long" ], [ "BINARY_OP", "basic_types += (long,)" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_OP", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "BINARY_OP", "special_types += (unicode if PY2 else bytes,)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL", "len(special_types)" ], [ "STORE_NAME", "num_special_types" ], [ "STORE_NAME", " def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]" ], [ "STORE_NAME", " def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]" ], [ "STORE_NAME", " def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "STORE_FAST", "t" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL", "correct_type(item)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "CALL", " with self.lock:\n return self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_ATTR", "self.data.items" ], [ "CALL", "self.data.items()" ], [ "CALL", "((v, k) for k, v in self.data.items())" ], [ "CALL", "dict((v, k) for k, v in self.data.items())" ], [ "STORE_FAST", "rev" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "rev" ], [ "CALL", "len(rev)" ], [ "CALL", "range(len(rev))" ], [ "LOAD_FAST_AND_CLEAR", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL", "safe_qualname(rev[i])" ], [ "STORE_FAST", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_FAST", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_FAST", "((v, k) for k, v in self.data.items())" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "STORE_NAME", "\"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None" ], [ "STORE_NAME", " def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value" ], [ "STORE_NAME", " def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "STORE_NAME", " def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_ATTR", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL", "NodeValue.expression(samples, value, level)" ], [ "CALL", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "exception_string(exc_value)" ], [ "CALL", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL", "cls(cheap_repr(val), type_registry[val])" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL", "len(val)" ], [ "STORE_FAST", "length" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL", "min(level, 2)" ], [ "STORE_FAST", "level" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_OP", "level - 1" ], [ "CALL", "partial(result.add_child, samples, level - 1)" ], [ "STORE_FAST", "add_child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Series, ndarray))" ], [ "STORE_FAST", "attrs" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_ATTR", "attrs.append" ], [ "CALL", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL", "getattr(val, name)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "STORE_FAST", "sample_type" ], [ "STORE_FAST", "sample_type" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "STORE_FAST", "samples" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL", "isinstance(val, DataFrame)" ], [ "STORE_FAST", "meta" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "STORE_FAST", "max_rows" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "STORE_FAST", "max_cols" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_OP", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_OP", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "STORE_FAST", "columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL", "len(columns)" ], [ "STORE_FAST", "num_cols" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_OP", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_OP", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL", "_sample_indices(num_cols, max_cols)" ], [ "CALL", "set(_sample_indices(num_cols, max_cols))" ], [ "STORE_FAST", "indices" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "formatted_name" ], [ "STORE_FAST", "label" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "CONTAINS_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL", "_sample_indices(length, samples['pandas_rows'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL", "_sample_indices(length, samples['list'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL", "_safe_iter(val)" ], [ "STORE_FAST", "vals" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "STORE_FAST", "num_items" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_OP", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL", "islice(vals, num_items)" ], [ "STORE_FAST", "vals" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL", "enumerate(vals)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL", "getattr(val, '__dict__', None)" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(k), v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL", "type(val)" ], [ "CALL", "getattr(type(val), '__slots__', None)" ], [ "CALL", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL", "getattr(val, s)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL", "f(val)" ], [ "STORE_FAST", "x" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "CALL", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "CALL", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_FAST", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL", "cast(dict, __builtins__)" ], [ "STORE_FAST", "builtins" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "CONTAINS_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "IS_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.13.json000066400000000000000000011040421474076367500241010ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from __future__ import absolute_import, division, print_function" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "from future.utils import iteritems" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType" ], [ "STORE_NAME", "import typing" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import html" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import traceback" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from itertools import chain, islice" ], [ "STORE_NAME", "from threading import Lock" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "import hashlib" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from asttokens import ASTTokens" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from littleutils import group_by_key_func, only" ], [ "STORE_NAME", "from outdated import warn_if_outdated" ], [ "STORE_NAME", "from cached_property import cached_property" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from cheap_repr.utils import safe_qualname, exception_string" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.db import Database, retry_db" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop" ], [ "STORE_NAME", "from birdseye import tracer" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye.utils import correct_type, PY3, PY2, one_or_none, \\\n of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \\\n is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file" ], [ "STORE_NAME", "from birdseye import __version__" ], [ "STORE_NAME", "from numpy import ndarray" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "STORE_NAME", "from pandas import DataFrame, Series" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "STORE_NAME", "CodeInfo" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "CALL", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "STORE_NAME", "class BirdsEye(TreeTracerBase):\n \"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"\n\n def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )\n\n @cached_property\n def db(self):\n return Database(self._db_uri)\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)\n\n def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)\n\n def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())\n\n def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)\n\n def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True\n\n def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value\n\n def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)\n\n def _call_id(self):\n # type: () -> Text\n return uuid4().hex\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id\n\n def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)\n\n def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)\n\n def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)\n\n def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )\n\n def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )\n\n @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id\n\n def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)\n\n def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')\n\n def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL", "BirdsEye()" ], [ "STORE_NAME", "eye" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "STORE_NAME", "HTMLPosition" ], [ "STORE_NAME", "def _deep_dict():\n return defaultdict(_deep_dict)" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "STORE_NAME", "_bad_codes" ], [ "STORE_NAME", "def _tracing_recursively(frame):\n while frame:\n if frame.f_code in _bad_codes:\n return True\n frame = frame.f_back" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "STORE_NAME", "class Iteration(object):\n \"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"\n\n def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False\n\n def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "CALL", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "STORE_NAME", "class IterationList(Iterable[Iteration]):\n \"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"\n side_len = 3\n\n def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()\n\n def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1\n\n def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)\n\n def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]\n\n def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_NAME", "class TypeRegistry(object):\n basic_types = (type(None), bool, int, float, complex)\n if PY2:\n basic_types += (long,)\n special_types = basic_types + (list, dict, tuple, set, frozenset, str)\n if PY2:\n special_types += (unicode if PY2 else bytes,)\n\n num_special_types = len(special_types)\n\n def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]\n\n def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]\n\n def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL", "TypeRegistry()" ], [ "STORE_NAME", "type_registry" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "class NodeValue(object):\n \"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"\n __slots__ = ('val_repr', 'type_index', 'meta', 'children')\n\n def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None # type: Optional[List[Tuple[str, NodeValue]]]\n\n def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value\n\n def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))\n\n def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result\n\n @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)\n\n @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)\n\n @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", "def _safe_iter(val, f=lambda x: x):\n try:\n for x in f(val):\n yield x\n except:\n pass" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "STORE_NAME", "def is_interesting_expression(node):\n # type: (ast.AST) -> bool\n \"\"\"\n If this expression has a value that may not be exactly what it looks like,\n return True. Put differently, return False if this is just a literal.\n \"\"\"\n return (isinstance(node, ast.expr) and\n not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node)))))" ], [ "STORE_NAME", "def is_obvious_builtin(node, value):\n # type: (ast.expr, Any) -> bool\n \"\"\"\n Return True if this node looks like a builtin and it really is\n (i.e. hasn't been shadowed).\n \"\"\"\n # noinspection PyUnresolvedReferences\n builtins = cast(dict, __builtins__)\n return ((isinstance(node, ast.Name) and\n node.id in builtins and\n builtins[node.id] is value) or\n isinstance(node, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class ndarray(object):\n pass" ], [ "STORE_NAME", " class ndarray(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class DataFrame(object):\n pass" ], [ "STORE_NAME", " class DataFrame(object):\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class Series(object):\n pass" ], [ "STORE_NAME", " class Series(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "STORE_NAME", "\"\"\"\n Decorate functions with an instance of this class to debug them,\n or just use the existing instance `eye`.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, db_uri=None, num_samples=None):\n \"\"\"\n Set db_uri to specify where the database lives, as an alternative to\n the environment variable BIRDSEYE_DB.\n \"\"\"\n super(BirdsEye, self).__init__()\n self._db_uri = db_uri\n self._code_infos = {} # type: Dict[CodeType, CodeInfo]\n self._last_call_id = None\n self._ipython_cell_value = None\n self.num_samples = num_samples or dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_NAME", "cached_property" ], [ "CALL", "cached_property" ], [ "STORE_NAME", " @cached_property\n def db(self):\n return Database(self._db_uri)" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> None\n for node in ast.walk(root): # type: ast.AST\n node._loops = tracer.loops(node)\n if isinstance(node, ast.expr):\n node._is_interesting_expression = is_interesting_expression(node)" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n traced_file = super(BirdsEye, self).compile(source, filename, flags)\n traced_file.tokens = ASTTokens(source, tree=traced_file.root)\n return traced_file" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n if frame.f_code not in self._code_infos:\n return\n if isinstance(node.parent, ast.For) and node is node.parent.body[0]:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n if isinstance(node.parent, ast.While) and node is node.parent.test:\n self._add_iteration(node._loops, frame)" ], [ "STORE_NAME", " def _add_iteration(self, loops, frame):\n # type: (typing.Sequence[Loop], FrameType) -> None\n \"\"\"\n Given one or more nested loops, add an iteration for the innermost\n loop (the last in the sequence).\n \"\"\"\n iteration = self.stack[frame].iteration # type: Iteration\n for i, loop_node in enumerate(loops):\n loop = iteration.loops[loop_node._tree_index]\n if i == len(loops) - 1:\n loop.append(Iteration())\n else:\n iteration = loop.last()" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n\n if _tracing_recursively(frame):\n return None\n\n if frame.f_code not in self._code_infos:\n return None\n\n if node._is_interesting_expression:\n # If this is an expression statement and the last statement\n # in the body, the value is returned from the cell magic\n # to be displayed as usual\n if (self._code_infos[frame.f_code].traced_file.is_ipython_cell\n and isinstance(node.parent, ast.Expr)\n and node.parent is node.parent.parent.body[-1]):\n self._ipython_cell_value = value\n\n if is_obvious_builtin(node, self.stack[frame].expression_values[node]):\n return None\n\n frame_info = self.stack[frame]\n if exc_value:\n node_value = self._exception_value(node, frame, exc_value)\n else:\n node_value = NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )\n self._set_node_value(node, frame, node_value)\n self._check_inner_call(frame_info, node, node_value)\n\n # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y`\n is_special_comprehension_iter = (\n isinstance(node.parent, ast.comprehension) and\n node is node.parent.iter and\n\n # Generators execute in their own time and aren't directly attached to the parent frame\n not isinstance(node.parent.parent, ast.GeneratorExp))\n\n if not is_special_comprehension_iter:\n return None\n\n # Mark `for x in y` as a bit that executed, so it doesn't show as grey\n self._set_node_value(node.parent, frame, NodeValue.covered())\n\n if exc_value:\n return None\n\n # Track each iteration over `y` so that the 'loop' can be stepped through\n loops = node._loops + (node.parent,) # type: Tuple[Loop, ...]\n\n def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item\n\n # This effectively changes to code to `for x in comprehension_iter_proxy()`\n return ChangeValue(comprehension_iter_proxy())" ], [ "STORE_NAME", " def _check_inner_call(self, frame_info, node, node_value):\n # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None\n inner_calls = frame_info.inner_calls.pop(node, None)\n if inner_calls:\n node_value.set_meta('inner_calls', inner_calls)" ], [ "STORE_NAME", " def _is_first_loop_iteration(self, node, frame):\n # type: (ast.AST, FrameType) -> bool\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n iteration = loop.last()\n if iteration.index > 0:\n return False\n return True" ], [ "STORE_NAME", " def _set_node_value(self, node, frame, value):\n # type: (ast.AST, FrameType, NodeValue) -> None\n iteration = self.stack[frame].iteration # type: Iteration\n for loop_node in node._loops: # type: ast.AST\n loop = iteration.loops[loop_node._tree_index]\n loop.recorded_node(node)\n iteration = loop.last()\n iteration.vals[node._tree_index] = value" ], [ "STORE_NAME", " def _exception_value(self, node, frame, exc_value):\n # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue\n value = NodeValue.exception(exc_value)\n self._set_node_value(node, frame, value)\n return value" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return None\n if exc_value and node is exc_node:\n value = self._exception_value(node, frame, exc_value)\n else:\n value = NodeValue.covered()\n self._set_node_value(node, frame, value)\n self._check_inner_call(self.stack[frame], node, value)\n return None" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n frame = enter_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n frame_info.start_time = get_unfrozen_datetime()\n frame_info.iteration = Iteration()\n\n code_info = self._code_infos[frame.f_code]\n if isinstance(enter_info.enter_node.parent, ast.Module):\n arguments = []\n else:\n f_locals = frame.f_locals.copy() # type: Dict[str, Any]\n arguments = [(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]\n frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments])\n frame_info.call_id = self._call_id()\n frame_info.inner_calls = defaultdict(list)\n prev = self.stack.get(enter_info.caller_frame)\n if prev:\n inner_calls = getattr(prev, 'inner_calls', None)\n if inner_calls is not None:\n inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "STORE_NAME", " def _call_id(self):\n # type: () -> Text\n return uuid4().hex" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n This is where all the data collected during the call is gathered up\n and sent to the database.\n \"\"\"\n frame = exit_info.current_frame # type: FrameType\n if frame.f_code not in self._code_infos or _tracing_recursively(frame):\n return\n frame_info = self.stack[frame]\n\n top_iteration = frame_info.iteration # type: Iteration\n node_values = _deep_dict()\n self._extract_node_values(top_iteration, (), node_values)\n\n db_func = self._code_infos[frame.f_code].db_func\n exc = exit_info.exc_value # type: Optional[Exception]\n if exc:\n traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))\n exception = exception_string(exc)\n else:\n traceback_str = exception = None\n\n @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)\n\n add_call()\n\n self._last_call_id = frame_info.call_id" ], [ "STORE_NAME", " def _extract_node_values(self, iteration, path, node_values):\n # type: (Iteration, Tuple[int, ...], dict) -> None\n \"\"\"\n Populates node_values with values inside iteration.\n \"\"\"\n # Each element of `path` is an index of a loop iteration\n # e.g. given the nested loops:\n #\n # for i in [0, 1, 2]:\n # for j in [0, 1, 2, 3]:\n #\n # path may be (i, j) for each of the iterations\n for tree_index, node_value in iteration.vals.items():\n\n # So this `full_path` is a tuple of ints, but the first\n # int has a different meaning from the others\n full_path = (tree_index,) + path\n\n # Given a path (a, b, c) we're making node_values 'contain'\n # this structure:\n # {a: {b: {c: node_value}}}\n d = node_values\n for path_k in full_path[:-1]:\n d = d[path_k]\n d[full_path[-1]] = node_value\n\n for loop in iteration.loops.values():\n for i, iteration in enumerate(loop):\n self._extract_node_values(iteration, path + (i,), node_values)" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n new_func = super(BirdsEye, self).trace_function(func)\n code_info = self._code_infos.get(new_func.__code__)\n if code_info:\n return new_func\n\n lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int\n end_lineno = start_lineno + len(lines)\n name = safe_qualname(func)\n source_file = inspect.getsourcefile(func)\n if source_file.startswith('= 0:\n frame = frame.f_back\n filename = inspect.getsourcefile(frame)\n if filename is not None:\n context -= 1\n filename = os.path.abspath(filename)\n\n if frame.f_globals.get('__name__') != '__main__':\n if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals:\n raise RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')\n return\n\n lines = read_source_file(filename).splitlines()\n lines[:frame.f_lineno] = [''] * frame.f_lineno\n source = '\\n'.join(lines)\n self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)\n sys.exit(0)" ], [ "STORE_NAME", " def exec_string(self, source, filename, globs=None, locs=None, deep=False):\n globs = globs or {}\n locs = locs or {}\n\n traced_file = self.compile(source, filename)\n\n globs.update(self._trace_methods_dict(traced_file))\n\n self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)\n\n if deep:\n nodes_by_lineno = {\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )\n\n find_code(traced_file.code)\n\n exec(traced_file.code, globs, locs)" ], [ "STORE_NAME", " def _trace(\n self,\n name,\n filename,\n traced_file,\n code,\n typ,\n source='',\n start_lineno=1,\n end_lineno=None,\n arg_names=(),\n ):\n if not end_lineno:\n end_lineno = start_lineno + len(source.splitlines())\n nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))\n html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file)\n\n data_dict = dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )\n if typ == 'function':\n tokens = traced_file.tokens\n func_node = only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)\n func_startpos, source = source_without_decorators(tokens, func_node)\n # These are for the PyCharm plugin\n data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )\n\n data = json.dumps(data_dict, sort_keys=True)\n db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ)\n self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names)" ], [ "STORE_NAME", " def _loop_ranges(self, nodes, tokens, func_start):\n # For a for loop, e.g.\n #\n # for x in y:\n #\n # this yields the range of the target 'x'.\n #\n # For a while loop, e.g.\n #\n # while x < 10:\n #\n # this yields the range of the condition 'x < 10'.\n for node, (classes, _, __) in nodes:\n if 'loop' not in classes:\n continue\n\n try:\n target = node.target # for loop\n except AttributeError:\n target = node.test # while loop\n\n start, end = tokens.get_text_range(target)\n start -= func_start\n end -= func_start\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "STORE_NAME", " def _node_ranges(self, nodes, tokens, func_start):\n for node, (classes, _, __) in nodes:\n start, end = tokens.get_text_range(node)\n start -= func_start\n end -= func_start\n\n if start < 0:\n assert (end < 0 # nodes before the def, i.e. decorators\n or isinstance(node, ast.FunctionDef))\n continue\n\n yield dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_NAME", "retry_db" ], [ "CALL", "retry_db" ], [ "STORE_NAME", " @retry_db\n def _db_func(self, data, filename, html_body, name, start_lineno, source, typ):\n \"\"\"\n Retrieve the Function object from the database if one exists, or create one.\n \"\"\"\n\n def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()\n\n function_hash = h(filename + name + html_body + data + str(start_lineno))\n\n Function = self.db.Function\n\n with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "STORE_NAME", " def _nodes_of_interest(self, traced_file, start_lineno, end_lineno):\n # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]]\n \"\"\"\n Nodes that may have a value, show up as a box in the UI, and lie within the\n given line range.\n \"\"\"\n for node in traced_file.nodes:\n classes = []\n\n if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and\n not isinstance(node.parent, ast.GeneratorExp)):\n classes.append('loop')\n if isinstance(node, ast.stmt):\n classes.append('stmt')\n\n if isinstance(node, ast.expr):\n if not node._is_interesting_expression:\n continue\n elif not classes:\n continue\n\n assert isinstance(node, ast.AST)\n\n # In particular FormattedValue is missing this\n if not hasattr(node, 'first_token'):\n continue\n\n if not start_lineno <= node.first_token.start[0] <= end_lineno:\n continue\n\n start, end = traced_file.tokens.get_text_range(node) # type: int, int\n if start == end == 0:\n continue\n\n yield node, (classes, start, end)" ], [ "STORE_NAME", " def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file):\n # type: (list, int, int, TracedFile) -> str\n \"\"\"\n The algorithm for generating the HTML works as follows. We generate a list\n of HTMLPositions, which are essentially places to insert HTML into the source plus some\n metadata. The order of the fields of HTMLPosition ensure that when the list is sorted,\n the resulting HTML is valid and correct. Specifically, the fields are:\n \n 1. index: the index in the source string where the HTML would be inserted\n 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end.\n Ends should appear first, so that the resulting HTML looks like:\n ... ... \n rather than:\n ... ... \n (I think this might actually be unnecessary, since I can't think of any cases of two\n expressions right next to each other with nothing in between)\n 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from\n a node to appear before the start of a tag nested within, e.g. `foo()` should become:\n foo()\n rather than: \n foo()\n 4. html: the actual HTML to insert. Not important for ordering.\n \n Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the\n start and one for the end.\n \n After the list is sorted, the HTML generated is essentially:\n \n source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ...\n \"\"\"\n\n traced_file.root._depth = 0\n for node in ast.walk(traced_file.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child._depth = node._depth + 1\n\n positions = [] # type: List[HTMLPosition]\n\n for node, (classes, start, end) in nodes:\n # noinspection PyArgumentList\n positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))\n\n end_lineno = self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)\n\n # This just makes the loop below simpler\n positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))\n\n positions.sort()\n\n html_parts = []\n start = 0\n for position in positions:\n html_parts.append(html.escape(traced_file.source[start:position.index]))\n html_parts.append(position.html)\n start = position.index\n html_body = ''.join(html_parts)\n html_body = '\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])\n\n return html_body.strip('\\n')" ], [ "STORE_NAME", " def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "STORE_NAME", " def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file):\n # type: (list, int, List[HTMLPosition], TracedFile) -> int\n \"\"\"\n Comprehensions (e.g. list comprehensions) are troublesome because they can\n be navigated like loops, and the buttons for these need to be on separate lines.\n This function inserts newlines to turn:\n\n [x + y for x in range(3) for y in range(5)] and\n [[x + y for x in range(3)] for y in range(5)]\n\n into\n\n [x + y for x in range(3)\n for y in range(5)] and\n [[x + y for x in range(3)]\n for y in range(5)]\n \"\"\"\n\n comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n ) # type: Dict[Any, Iterable[ast.comprehension]]\n\n def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]\n\n for comp_list in comprehensions.values():\n prev_start = None # type: Optional[int]\n for comp in sorted(comp_list, key=lambda c: c.first_token.startpos):\n if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]:\n start = get_start(comp.parent)\n if prev_start is not None and start < prev_start:\n start = get_start(comp)\n else:\n start = get_start(comp)\n if prev_start is not None:\n positions.append(HTMLPosition(start, True, 0, '\\n '))\n end_lineno += 1\n prev_start = start\n\n return end_lineno" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).__init__" ], [ "CALL", "super(BirdsEye, self).__init__()" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL", "ast.walk(root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "flags" ], [ "CALL", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(node.parent, ast.For)" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "IS_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(node.parent, ast.While)" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "IS_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL", "len(loops)" ], [ "BINARY_OP", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "CALL", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "IS_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "node_value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_OP", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_OP", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "STORE_FAST", "node_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "node_value" ], [ "CALL", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "IS_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "STORE_FAST", "is_special_comprehension_iter" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "CALL", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_OP", "node._loops + (node.parent,)" ], [ "STORE_DEREF", "loops" ], [ "LOAD_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "STORE_FAST", " def comprehension_iter_proxy():\n for item in value:\n self._add_iteration(loops, frame)\n yield item" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL", "comprehension_iter_proxy()" ], [ "CALL", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "STORE_FAST", "item" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_ATTR", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.inner_calls.pop(node, None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_ATTR", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "STORE_FAST", "loop_node" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "STORE_FAST", "loop" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL", "loop.last()" ], [ "STORE_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "NodeValue.exception(exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "IS_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "self._exception_value(node, frame, exc_value)" ], [ "STORE_FAST", "value" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL", "NodeValue.covered()" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "CALL", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "STORE_FAST", "code_info" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "STORE_FAST", "arguments" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.copy" ], [ "CALL", "frame.f_locals.copy()" ], [ "STORE_FAST", "f_locals" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_FAST_AND_CLEAR", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL", "f_locals.pop(name)" ], [ "STORE_FAST", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "LOAD_FAST", "f_locals" ], [ "LOAD_ATTR", "f_locals.items" ], [ "CALL", "f_locals.items()" ], [ "LOAD_FAST_AND_CLEAR", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "it" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "STORE_FAST", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "BINARY_OP", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "arguments" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "LOAD_FAST_AND_CLEAR", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "LOAD_FAST_AND_CLEAR", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL", "cheap_repr(v)" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "CALL", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._call_id" ], [ "CALL", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL", "self.stack.get(enter_info.caller_frame)" ], [ "STORE_FAST", "prev" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL", "getattr(prev, 'inner_calls', None)" ], [ "STORE_FAST", "inner_calls" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_ATTR", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "STORE_FAST", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name]" ], [ "STORE_FAST", "[\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "STORE_FAST", "[[k, cheap_repr(v)] for k, v in arguments]" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_DEREF", "frame_info" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "STORE_DEREF", "top_iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "_deep_dict()" ], [ "STORE_DEREF", "node_values" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "STORE_DEREF", "db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "STORE_FAST", "exc" ], [ "LOAD_FAST", "exc" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "STORE_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL", "exception_string(exc)" ], [ "STORE_DEREF", "exception" ], [ "STORE_DEREF", "traceback_str" ], [ "STORE_DEREF", "exception" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "CALL", "retry_db" ], [ "STORE_FAST", " @retry_db\n def add_call():\n Call = self.db.Call\n call = Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)\n with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "add_call" ], [ "CALL", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "STORE_FAST", "Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_ATTR", "top_iteration.extract_iterations" ], [ "CALL", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.names" ], [ "CALL", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "STORE_FAST", "call" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL", "session.add(call)" ], [ "CALL", " with self.db.session_scope() as session:\n session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_ATTR", "iteration.vals.items" ], [ "CALL", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_OP", "(tree_index,) + path" ], [ "STORE_FAST", "full_path" ], [ "LOAD_FAST", "node_values" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SLICE", "full_path[:-1]" ], [ "STORE_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_ATTR", "iteration.loops.values" ], [ "CALL", "iteration.loops.values()" ], [ "STORE_FAST", "loop" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "super(BirdsEye, self).trace_function(func)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_ATTR", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL", "self._code_infos.get(new_func.__code__)" ], [ "STORE_FAST", "code_info" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL", "len(lines)" ], [ "BINARY_OP", "start_lineno + len(lines)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL", "safe_qualname(func)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "source_file" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_ATTR", "source_file.startswith" ], [ "CALL", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL", "inspect.getsourcefile(frame)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context -= 1" ], [ "STORE_FAST", "context" ], [ "LOAD_FAST", "context" ], [ "COMPARE_OP", "context >= 0" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL", "os.path.abspath(filename)" ], [ "STORE_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_ATTR", "frame.f_globals.get" ], [ "CALL", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CONTAINS_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "LOAD_ATTR", "read_source_file(filename).splitlines" ], [ "CALL", "read_source_file(filename).splitlines()" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_OP", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SLICE", "lines[:frame.f_lineno]" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "'\\n'.join(lines)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exec_string" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "STORE_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "STORE_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL", "self.compile(source, filename)" ], [ "STORE_DEREF", "traced_file" ], [ "LOAD_FAST", "globs" ], [ "LOAD_ATTR", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST_AND_CLEAR", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "STORE_DEREF", "nodes_by_lineno" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for code in root_code.co_consts: # type: CodeType\n if not inspect.iscode(code) or code.co_name.startswith('<'):\n continue\n\n find_code(code)\n\n lineno = code.co_firstlineno\n node = nodes_by_lineno.get(lineno)\n if not node:\n continue\n\n self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "exec(traced_file.code, globs, locs)" ], [ "STORE_FAST", "{\n node.lineno: node\n for node in traced_file.nodes\n if isinstance(node, ast.FunctionDef)\n }" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "code.co_name.startswith" ], [ "CALL", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "STORE_FAST", "lineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_ATTR", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL", "nodes_by_lineno.get(lineno)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_OP", "node.last_token.end[0] + 1" ], [ "CALL_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.splitlines" ], [ "CALL", "source.splitlines()" ], [ "CALL", "len(source.splitlines())" ], [ "BINARY_OP", "start_lineno + len(source.splitlines())" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "STORE_FAST", "nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "CALL", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST_AND_CLEAR", "[n._tree_index for n in node._loops]" ], [ "LOAD_ATTR", "n._tree_index" ], [ "STORE_FAST", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "CALL_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "STORE_FAST", "data_dict" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "STORE_FAST", "tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "CALL", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "STORE_FAST", "func_node" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL", "source_without_decorators(tokens, func_node)" ], [ "STORE_FAST", "func_startpos" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "STORE_FAST", "data" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "CALL", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "CALL", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "STORE_FAST", "[n._tree_index for n in node._loops]" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "STORE_FAST", "{\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n }" ], [ "LOAD_FAST", "(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "classes" ], [ "CONTAINS_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "STORE_FAST", "target" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL", "tokens.get_text_range(target)" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "STORE_FAST", "target" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "__" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "tokens.get_text_range(node)" ], [ "BINARY_OP", "start -= func_start" ], [ "STORE_FAST", "start" ], [ "BINARY_OP", "end -= func_start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "STORE_FAST", " def h(s):\n return hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_OP", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_OP", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL", "str(start_lineno)" ], [ "BINARY_OP", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL", "h(filename + name + html_body + data + str(start_lineno))" ], [ "STORE_FAST", "function_hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "STORE_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL", "self.db.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "STORE_FAST", "db_func" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "CALL", " with self.db.session_scope() as session:\n db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function]\n if not db_func:\n db_func = Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)\n session.add(db_func)\n session.commit() # ensure .id exists\n assert isinstance(db_func.id, int)\n return db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.encode" ], [ "CALL", "s.encode('utf8')" ], [ "CALL", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_ATTR", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'first_token')" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "COMPARE_OP", "start_lineno <= node.first_token.start[0] <= end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL", "traced_file.tokens.get_text_range(node)" ], [ "COMPARE_OP", "start == end == 0" ], [ "COMPARE_OP", "start == end == 0" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL", "ast.walk(traced_file.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_OP", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "STORE_FAST", "positions" ], [ "LOAD_FAST", "nodes" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_ATTR", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL", "' '.join(classes)" ], [ "BUILD_STRING", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST_AND_CLEAR", "[n[0] for n in nodes]" ], [ "BINARY_SUBSCR", "n[0]" ], [ "STORE_FAST", "[n[0] for n in nodes]" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL", "len(traced_file.source)" ], [ "CALL", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.sort" ], [ "CALL", "positions.sort()" ], [ "STORE_FAST", "html_parts" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "positions" ], [ "STORE_FAST", "position" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SLICE", "traced_file.source[start:position.index]" ], [ "CALL", "html.escape(traced_file.source[start:position.index])" ], [ "CALL", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "STORE_FAST", "start" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL", "''.join(html_parts)" ], [ "STORE_FAST", "html_body" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.split" ], [ "CALL", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_OP", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno - 1" ], [ "BINARY_SLICE", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "STORE_FAST", "html_body" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.strip" ], [ "CALL", "html_body.strip('\\n')" ], [ "STORE_FAST", "[n[0] for n in nodes]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "STORE_FAST", "comprehensions" ], [ "LOAD_FAST", " def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]" ], [ "STORE_FAST", " def get_start(n):\n # type: (ast.AST) -> int\n return traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_ATTR", "comprehensions.values" ], [ "CALL", "comprehensions.values()" ], [ "STORE_FAST", "comp_list" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "STORE_FAST", "comp" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(comp, ast.comprehension)" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "IS_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL", "get_start(comp.parent)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL", "get_start(comp)" ], [ "STORE_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_OP", "end_lineno += 1" ], [ "STORE_FAST", "end_lineno" ], [ "LOAD_FAST", "start" ], [ "STORE_FAST", "prev_start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "CONTAINS_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "STORE_NAME", "\"\"\"\n Corresponds to an iteration of a loop during a call, OR\n the call itself (FrameInfo.iteration).\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping of nodes (via node._tree_index) to the value of that\n # node in this iteration. Only contains nodes within the corresponding\n # loop or at the top of the function, but not in loops further within\n # (those will be somewhere within self.loops)\n # Therefore those nodes have at most one value.\n self.vals = {} # type: Dict[int, NodeValue]\n\n # Mapping of loop nodes (via node._tree_index) to IterationLists\n # for loops that happened during this iteration\n self.loops = defaultdict(IterationList) # type: Dict[int, IterationList]\n\n # 0-based index of this iteration\n self.index = None # type: int\n self.keep = False" ], [ "STORE_NAME", " def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "STORE_NAME", " def extract_iterations(self):\n # type: () -> Dict[str, Union[int, Dict]]\n return {\n 'index': self.index,\n 'loops': {\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }\n }" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_ATTR", "self.loops.items" ], [ "CALL", "self.loops.items()" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST_AND_CLEAR", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "iteration" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.extract_iterations" ], [ "CALL", "iteration.extract_iterations()" ], [ "STORE_FAST", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "[iteration.extract_iterations()\n for iteration in iteration_list]" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_FAST", "{\n tree_index: [iteration.extract_iterations()\n for iteration in iteration_list]\n for tree_index, iteration_list in self.loops.items()\n }" ], [ "STORE_NAME", "\"\"\"\n A list of Iterations, corresponding to a run of a loop.\n If the loop has many iterations, only contains the first and last few\n and any in the middle where unique nodes had values, so that\n any node which appeared during this loop exists in at least some iterations.\n \"\"\"" ], [ "STORE_NAME", "side_len" ], [ "STORE_NAME", " def __init__(self):\n # Contains the first few iterations\n # and any after that have unique nodes in them\n self.start = [] # type: List[Iteration]\n\n # Contains the last few iterations\n self.end = deque(maxlen=self.side_len) # type: Deque[Iteration]\n\n # Total number of iterations in the loop, not all of which\n # are kept\n self.length = 0 # type: int\n\n # Number of times each node has been recorded in this loop\n self.recorded = Counter()" ], [ "STORE_NAME", " def append(self, iteration):\n # type: (Iteration) -> None\n if self.length < self.side_len:\n self.start.append(iteration)\n else:\n # If self.end is too long, the first element self.end[0]\n # is about to be dropped by the deque. If that iteration\n # should be kept because of some node that was recorded,\n # add it to self.start\n if len(self.end) >= self.side_len and self.end[0].keep:\n self.start.append(self.end[0])\n\n self.end.append(iteration)\n iteration.index = self.length\n self.length += 1" ], [ "STORE_NAME", " def __iter__(self):\n # type: () -> Iterator[Iteration]\n return chain(self.start, self.end)" ], [ "STORE_NAME", " def last(self):\n # type: () -> Iteration\n if self.end:\n return self.end[-1]\n else:\n return self.start[-1]" ], [ "STORE_NAME", " def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "STORE_NAME", " def recorded_node(self, node):\n # type: (ast.AST) -> None\n if self.recorded[node] >= 2:\n # We've already seen this node enough\n return\n\n # This node is new(ish), make sure we keep this iteration\n self.last().keep = True\n self.recorded[node] += 1" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_ATTR", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "BINARY_OP", "self.length += 1" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.last" ], [ "CALL", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "BINARY_OP", "self.recorded[node] += 1" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "long" ], [ "BINARY_OP", "basic_types += (long,)" ], [ "STORE_NAME", "basic_types" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_OP", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "special_types" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "BINARY_OP", "special_types += (unicode if PY2 else bytes,)" ], [ "STORE_NAME", "special_types" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL", "len(special_types)" ], [ "STORE_NAME", "num_special_types" ], [ "STORE_NAME", " def __init__(self):\n self.lock = Lock()\n self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int]\n\n for t in self.special_types:\n _ = self.data[t]" ], [ "STORE_NAME", " def __getitem__(self, item):\n t = correct_type(item)\n with self.lock:\n return self.data[t]" ], [ "STORE_NAME", " def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_NAME", " def names(self):\n # type: () -> List[str]\n rev = dict((v, k) for k, v in self.data.items())\n return [safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_FAST", "lambda: len(self.data)" ], [ "CALL", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "STORE_FAST", "t" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL", "correct_type(item)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "CALL", " with self.lock:\n return self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_ATTR", "self.data.items" ], [ "CALL", "self.data.items()" ], [ "CALL", "((v, k) for k, v in self.data.items())" ], [ "CALL", "dict((v, k) for k, v in self.data.items())" ], [ "STORE_FAST", "rev" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "rev" ], [ "CALL", "len(rev)" ], [ "CALL", "range(len(rev))" ], [ "LOAD_FAST_AND_CLEAR", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL", "safe_qualname(rev[i])" ], [ "STORE_FAST", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "STORE_FAST", "[safe_qualname(rev[i]) for i in range(len(rev))]" ], [ "LOAD_FAST", "((v, k) for k, v in self.data.items())" ], [ "STORE_NAME", "\"\"\"\n The 'value' of a node during a particular iteration.\n This can mean different things, see the classmethods.\n Can also contain some metadata, including links to other calls.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, val_repr, type_index):\n self.val_repr = val_repr # type: str\n self.type_index = type_index # type: int\n self.meta = None # type: Optional[Dict[str, Any]]\n self.children = None" ], [ "STORE_NAME", " def set_meta(self, key, value):\n # type: (str, Any) -> None\n self.meta = self.meta or {}\n self.meta[key] = value" ], [ "STORE_NAME", " def add_child(self, samples, level, key, value):\n # type: (dict, int, str, Any) -> None\n self.children = self.children or []\n self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "STORE_NAME", " def as_json(self):\n result = [self.val_repr, self.type_index, self.meta or {}] # type: list\n if self.children:\n result.extend(self.children)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def covered(cls):\n \"\"\"\n Represents a bit of code, usually a statement, that executed successfully but\n doesn't have an actual value.\n \"\"\"\n return cls('', -2)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def exception(cls, exc_value):\n \"\"\"\n Means that exc_value was raised by a node when executing, and not any inner node.\n \"\"\"\n return cls(exception_string(exc_value), -1)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_NAME", " @classmethod\n def expression(cls, samples, val, level):\n # type: (dict, Any, int) -> NodeValue\n \"\"\"\n The value of an expression or one of its children, with attributes,\n dictionary items, etc as children. Has a max depth of `level` levels.\n \"\"\"\n result = cls(cheap_repr(val), type_registry[val])\n if isinstance(val, (TypeRegistry.basic_types, BirdsEye)):\n return result\n\n length = None\n if not isinstance(val, QuerySet): # len triggers a database query\n try:\n length = len(val)\n except:\n pass\n else:\n result.set_meta('len', length)\n\n if isinstance(val, ModuleType):\n level = min(level, 2)\n\n add_child = partial(result.add_child, samples, level - 1)\n\n if isinstance(val, (Series, ndarray)):\n attrs = ['dtype']\n if isinstance(val, ndarray):\n attrs.append('shape')\n for name in attrs:\n try:\n attr = getattr(val, name)\n except AttributeError:\n pass\n else:\n add_child(name, attr)\n\n if level >= 3 or level >= 2 and isinstance(val, Series):\n sample_type = 'big'\n else:\n sample_type = 'small'\n\n samples = samples[sample_type]\n\n # Always expand DataFrames and Series regardless of level to\n # make the table view of DataFrames work\n\n if isinstance(val, DataFrame):\n meta = {}\n result.set_meta('dataframe', meta)\n\n max_rows = samples['pandas_rows']\n max_cols = samples['pandas_cols']\n\n if length > max_rows + 2:\n meta['row_break'] = max_rows // 2\n\n columns = val.columns\n num_cols = len(columns)\n if num_cols > max_cols + 2:\n meta['col_break'] = max_cols // 2\n\n indices = set(_sample_indices(num_cols, max_cols))\n for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False),\n val.columns)):\n if i in indices:\n add_child(formatted_name, val[label])\n\n return result\n\n if isinstance(val, Series):\n for i in _sample_indices(length, samples['pandas_rows']):\n try:\n k = val.index[i:i + 1].format(sparsify=False)[0]\n v = val.iloc[i]\n except:\n pass\n else:\n add_child(k, v)\n return result\n\n if (level <= 0 or\n isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))):\n return result\n\n if isinstance(val, (Sequence, ndarray)) and length is not None:\n for i in _sample_indices(length, samples['list']):\n try:\n v = val[i]\n except:\n pass\n else:\n add_child(str(i), v)\n\n if isinstance(val, Mapping):\n for k, v in islice(_safe_iter(val, iteritems), samples['dict']):\n add_child(cheap_repr(k), v)\n\n if isinstance(val, Set):\n vals = _safe_iter(val)\n num_items = samples['set']\n if length is None or length > num_items + 2:\n vals = islice(vals, num_items)\n for i, v in enumerate(vals):\n add_child('<%s>' % i, v)\n\n d = getattr(val, '__dict__', None)\n if d:\n for k in sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str):\n v = d[k]\n if isinstance(v, TracedFile):\n continue\n add_child(str(k), v)\n else:\n for s in sorted(getattr(type(val), '__slots__', None) or ()):\n try:\n attr = getattr(val, s)\n except AttributeError:\n pass\n else:\n add_child(str(s), attr)\n return result" ], [ "STORE_ATTR", "self.val_repr" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_ATTR", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_FAST", "level" ], [ "CALL", "NodeValue.expression(samples, value, level)" ], [ "CALL", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL", "exception_string(exc_value)" ], [ "CALL", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL", "cls(cheap_repr(val), type_registry[val])" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL", "len(val)" ], [ "STORE_FAST", "length" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL", "min(level, 2)" ], [ "STORE_FAST", "level" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "BINARY_OP", "level - 1" ], [ "CALL", "partial(result.add_child, samples, level - 1)" ], [ "STORE_FAST", "add_child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Series, ndarray))" ], [ "STORE_FAST", "attrs" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_ATTR", "attrs.append" ], [ "CALL", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "getattr" ], [ "CALL", "getattr(val, name)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "CALL", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "STORE_FAST", "sample_type" ], [ "STORE_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "STORE_FAST", "samples" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL", "isinstance(val, DataFrame)" ], [ "STORE_FAST", "meta" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "STORE_FAST", "max_rows" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "STORE_FAST", "max_cols" ], [ "BINARY_OP", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_OP", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "STORE_FAST", "columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL", "len(columns)" ], [ "STORE_FAST", "num_cols" ], [ "BINARY_OP", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_OP", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "CALL", "_sample_indices(num_cols, max_cols)" ], [ "CALL", "set(_sample_indices(num_cols, max_cols))" ], [ "STORE_FAST", "indices" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "formatted_name" ], [ "STORE_FAST", "label" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "CONTAINS_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL", "_sample_indices(length, samples['pandas_rows'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL", "_sample_indices(length, samples['list'])" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "STORE_FAST", "k" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL", "_safe_iter(val)" ], [ "STORE_FAST", "vals" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "STORE_FAST", "num_items" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_OP", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL", "islice(vals, num_items)" ], [ "STORE_FAST", "vals" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL", "enumerate(vals)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL", "getattr(val, '__dict__', None)" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL", "add_child(str(k), v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL", "type(val)" ], [ "CALL", "getattr(type(val), '__slots__', None)" ], [ "CALL", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL", "getattr(val, s)" ], [ "STORE_FAST", "attr" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL", "f(val)" ], [ "STORE_FAST", "x" ], [ "LOAD_FAST", "x" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "CALL", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "CALL", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_FAST", "(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL", "cast(dict, __builtins__)" ], [ "STORE_FAST", "builtins" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "CONTAINS_OP", "node.id in builtins" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "IS_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'NameConstant', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'NameConstant', ()))" ], [ "STORE_NAME", "pass" ], [ "STORE_NAME", "pass" ], [ "STORE_NAME", "pass" ], [ "STORE_NAME", "pass" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.5.json000066400000000000000000003725441474076367500240370ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).__init__" ], [ "CALL_FUNCTION", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_FUNCTION", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_FUNCTION", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "CALL_FUNCTION", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_ATTR", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_ATTR", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_FUNCTION", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.copy" ], [ "CALL_FUNCTION", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_ATTR", "f_locals.items" ], [ "CALL_FUNCTION", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_FUNCTION", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._call_id" ], [ "CALL_FUNCTION", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_FUNCTION", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_ATTR", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_FUNCTION", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_ATTR", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_FUNCTION", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_FUNCTION", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_ATTR", "top_iteration.extract_iterations" ], [ "CALL_FUNCTION", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.names" ], [ "CALL_FUNCTION", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_ATTR", "iteration.vals.items" ], [ "CALL_FUNCTION", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_ATTR", "iteration.loops.values" ], [ "CALL_FUNCTION", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_ATTR", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_FUNCTION", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_ATTR", "source_file.startswith" ], [ "CALL_FUNCTION", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_ATTR", "frame.f_globals.get" ], [ "CALL_FUNCTION", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_ATTR", "read_source_file(filename).splitlines" ], [ "CALL_FUNCTION", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_FUNCTION", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_ATTR", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "inspect.iscode(code)" ], [ "UNARY_NOT", "not inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "code.co_name.startswith" ], [ "CALL_FUNCTION", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_ATTR", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_FUNCTION", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.splitlines" ], [ "CALL_FUNCTION", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_FUNCTION", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_FUNCTION", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.encode" ], [ "CALL_FUNCTION", "s.encode('utf8')" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_ATTR", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_ATTR", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_FUNCTION", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.sort" ], [ "CALL_FUNCTION", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_FUNCTION", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_FUNCTION", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_FUNCTION", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_FUNCTION", "''.join(html_parts)" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.split" ], [ "CALL_FUNCTION", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_FUNCTION", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.strip" ], [ "CALL_FUNCTION", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_ATTR", "comprehensions.values" ], [ "CALL_FUNCTION", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_ATTR", "self.loops.items" ], [ "CALL_FUNCTION", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.extract_iterations" ], [ "CALL_FUNCTION", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_FUNCTION", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_ATTR", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.last" ], [ "CALL_FUNCTION", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_ATTR", "self.data.items" ], [ "CALL_FUNCTION", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_ATTR", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "NodeValue.expression(samples, value, level)" ], [ "CALL_FUNCTION", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_FUNCTION", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_ATTR", "attrs.append" ], [ "CALL_FUNCTION", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_FUNCTION", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.6.json000066400000000000000000003726511474076367500240370ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).__init__" ], [ "CALL_FUNCTION", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_FUNCTION", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_ATTR", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_FUNCTION", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_FUNCTION", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "CALL_FUNCTION", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_ATTR", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_ATTR", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_FUNCTION", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_ATTR", "loop.last" ], [ "CALL_FUNCTION", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.covered" ], [ "CALL_FUNCTION", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.copy" ], [ "CALL_FUNCTION", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_ATTR", "f_locals.items" ], [ "CALL_FUNCTION", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_FUNCTION", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._call_id" ], [ "CALL_FUNCTION", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_FUNCTION", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_ATTR", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_FUNCTION", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_ATTR", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_ATTR", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_FUNCTION", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_FUNCTION", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_ATTR", "top_iteration.extract_iterations" ], [ "CALL_FUNCTION", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.names" ], [ "CALL_FUNCTION", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_ATTR", "iteration.vals.items" ], [ "CALL_FUNCTION", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_ATTR", "iteration.loops.values" ], [ "CALL_FUNCTION", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_FUNCTION", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_ATTR", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_ATTR", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_FUNCTION", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_ATTR", "source_file.startswith" ], [ "CALL_FUNCTION", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_ATTR", "frame.f_globals.get" ], [ "CALL_FUNCTION", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_ATTR", "read_source_file(filename).splitlines" ], [ "CALL_FUNCTION", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_FUNCTION", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_ATTR", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "inspect.iscode(code)" ], [ "UNARY_NOT", "not inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "code.co_name.startswith" ], [ "CALL_FUNCTION", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_ATTR", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_FUNCTION", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.splitlines" ], [ "CALL_FUNCTION", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_FUNCTION", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_FUNCTION", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.session_scope" ], [ "CALL_FUNCTION", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_FUNCTION", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_ATTR", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.encode" ], [ "CALL_FUNCTION", "s.encode('utf8')" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_ATTR", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_FUNCTION", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_ATTR", "classes.append" ], [ "CALL_FUNCTION", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_ATTR", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_FUNCTION", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.sort" ], [ "CALL_FUNCTION", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_ATTR", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_FUNCTION", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_FUNCTION", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_ATTR", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_FUNCTION", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_FUNCTION", "''.join(html_parts)" ], [ "LOAD_ATTR", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.split" ], [ "CALL_FUNCTION", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_FUNCTION", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_ATTR", "html_body.strip" ], [ "CALL_FUNCTION", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_ATTR", "comprehensions.values" ], [ "CALL_FUNCTION", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_ATTR", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_FUNCTION", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_ATTR", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_ATTR", "self.loops.items" ], [ "CALL_FUNCTION", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.extract_iterations" ], [ "CALL_FUNCTION", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_ATTR", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_FUNCTION", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_ATTR", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_FUNCTION", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.last" ], [ "CALL_FUNCTION", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_ATTR", "self.data.items" ], [ "CALL_FUNCTION", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_ATTR", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "NodeValue.expression(samples, value, level)" ], [ "CALL_FUNCTION", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_FUNCTION", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_ATTR", "attrs.append" ], [ "CALL_FUNCTION", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_FUNCTION", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.7.json000066400000000000000000003724121474076367500240330ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.8.json000066400000000000000000003724121474076367500240340ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-py-3.9.json000066400000000000000000003730741474076367500240420ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION_KW", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOAD_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION_KW", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "IS_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "IS_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "IS_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_ATTR", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_FUNCTION_KW", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "IS_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOAD_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOAD_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "IS_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "IS_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOAD_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOAD_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "CONTAINS_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOAD_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION_KW", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_FUNCTION_KW", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION_KW", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOAD_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOAD_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "IS_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CONTAINS_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOAD_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_FUNCTION_KW", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION_KW", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_ATTR", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_FUNCTION_KW", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_FUNCTION_KW", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "CONTAINS_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION_KW", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION_KW", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOAD_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOAD_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOAD_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOAD_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOAD_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOAD_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOAD_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION_KW", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "IS_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "IS_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "IS_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOAD_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "CONTAINS_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOAD_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION_KW", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOAD_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_ATTR", "val.columns.format" ], [ "CALL_FUNCTION_KW", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "CONTAINS_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOAD_ATTR", "val.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "IS_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "IS_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION_KW", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "CONTAINS_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "IS_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-pypy-2.7.json000066400000000000000000004041071474076367500244000ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOOKUP_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_METHOD", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOOKUP_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOOKUP_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOOKUP_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOOKUP_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOOKUP_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOOKUP_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_METHOD", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOOKUP_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "SLICE+2", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOOKUP_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOOKUP_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOOKUP_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOOKUP_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOOKUP_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SLICE+2", "lines[:frame.f_lineno]" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOOKUP_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_NAME", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOOKUP_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOOKUP_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_METHOD", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOOKUP_METHOD", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_METHOD", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_METHOD", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_METHOD", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOOKUP_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOOKUP_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOOKUP_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOOKUP_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "SLICE+3", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "SLICE+3", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOOKUP_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOOKUP_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "iteration" ], [ "LOOKUP_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOOKUP_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOOKUP_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOOKUP_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOOKUP_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOOKUP_METHOD", "val.columns.format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "val.index[i:i + 1]" ], [ "LOOKUP_METHOD", "val.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-pypy-3.5.json000066400000000000000000003727211474076367500244050ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOOKUP_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_METHOD", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOOKUP_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOOKUP_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOOKUP_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOOKUP_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOOKUP_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOOKUP_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_METHOD", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOOKUP_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOOKUP_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOOKUP_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOOKUP_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOOKUP_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOOKUP_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOOKUP_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOOKUP_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOOKUP_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_METHOD", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOOKUP_METHOD", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_METHOD", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_METHOD", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_METHOD", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOOKUP_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOOKUP_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOOKUP_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOOKUP_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOOKUP_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOOKUP_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration" ], [ "LOOKUP_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOOKUP_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOOKUP_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOOKUP_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOOKUP_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOOKUP_METHOD", "val.columns.format" ], [ "CALL_METHOD", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOOKUP_METHOD", "val.index[i:i + 1].format" ], [ "CALL_METHOD", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/bird-pypy-3.6.json000066400000000000000000003727211474076367500244060ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "warn_if_outdated" ], [ "LOAD_NAME", "__version__" ], [ "CALL_FUNCTION", "warn_if_outdated('birdseye', __version__)" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('CodeInfo', 'db_func traced_file arg_names')" ], [ "LOAD_NAME", "TreeTracerBase" ], [ "LOAD_NAME", "BirdsEye" ], [ "CALL_FUNCTION", "BirdsEye()" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "str" ], [ "CALL_FUNCTION", "NamedTuple('HTMLPosition', [\n ('index', int),\n ('is_start', bool),\n ('depth', int),\n ('html', str),\n])" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.enter_call" ], [ "LOAD_ATTR", "eye.enter_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.exit_call" ], [ "LOAD_ATTR", "eye.exit_call.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_expr" ], [ "LOAD_ATTR", "eye.after_expr.__code__" ], [ "LOAD_NAME", "eye" ], [ "LOAD_ATTR", "eye.after_stmt" ], [ "LOAD_ATTR", "eye.after_stmt.__code__" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Iterable" ], [ "LOAD_NAME", "Iteration" ], [ "BINARY_SUBSCR", "Iterable[Iteration]" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TypeRegistry" ], [ "CALL_FUNCTION", "TypeRegistry()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_NAME", "cached_property" ], [ "CALL_FUNCTION", "cached_property" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).__init__" ], [ "CALL_METHOD", "super(BirdsEye, self).__init__()" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._db_uri" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._code_infos" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_FAST", "num_samples" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n )" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n )" ], [ "CALL_FUNCTION", "dict(\n big=dict(\n attributes=50,\n dict=50,\n list=30,\n set=30,\n pandas_rows=20,\n pandas_cols=100,\n ),\n small=dict(\n attributes=50,\n dict=10,\n list=6,\n set=6,\n pandas_rows=6,\n pandas_cols=10,\n ),\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.num_samples" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._db_uri" ], [ "CALL_FUNCTION", "Database(self._db_uri)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "root" ], [ "CALL_METHOD", "ast.walk(root)" ], [ "LOAD_GLOBAL", "tracer" ], [ "LOOKUP_METHOD", "tracer.loops" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tracer.loops(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._loops" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "is_interesting_expression(node)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._is_interesting_expression" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "super(BirdsEye, self).compile(source, filename, flags)" ], [ "LOAD_GLOBAL", "ASTTokens" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_FUNCTION", "ASTTokens(source, tree=traced_file.root)" ], [ "LOAD_FAST", "traced_file" ], [ "STORE_ATTR", "traced_file.tokens" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.For)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.body" ], [ "BINARY_SUBSCR", "node.parent.body[0]" ], [ "COMPARE_OP", "node is node.parent.body[0]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.While)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.test" ], [ "COMPARE_OP", "node is node.parent.test" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._add_iteration(node._loops, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "enumerate(loops)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "loops" ], [ "CALL_FUNCTION", "len(loops)" ], [ "BINARY_SUBTRACT", "len(loops) - 1" ], [ "COMPARE_OP", "i == len(loops) - 1" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.append" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "CALL_METHOD", "loop.append(Iteration())" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_DEREF", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].traced_file.is_ipython_cell" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expr" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.Expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_ATTR", "node.parent.parent.body" ], [ "BINARY_SUBSCR", "node.parent.parent.body[-1]" ], [ "COMPARE_OP", "node.parent is node.parent.parent.body[-1]" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._ipython_cell_value" ], [ "LOAD_GLOBAL", "is_obvious_builtin" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].expression_values" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.stack[frame].expression_values[node]" ], [ "CALL_FUNCTION", "is_obvious_builtin(node, self.stack[frame].expression_values[node])" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_DEREF", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.num_samples" ], [ "LOAD_DEREF", "value" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "CALL_FUNCTION", "len(node._loops)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._is_first_loop_iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._is_first_loop_iteration(node, frame)" ], [ "UNARY_NOT", "not self._is_first_loop_iteration(node, frame)" ], [ "BINARY_MULTIPLY", "len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "BINARY_SUBTRACT", "3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))" ], [ "CALL_FUNCTION", "max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame)))" ], [ "CALL_METHOD", "NodeValue.expression(\n self.num_samples,\n value,\n level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))),\n )" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, node_value)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node_value" ], [ "CALL_METHOD", "self._check_inner_call(frame_info, node, node_value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.comprehension)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.iter" ], [ "COMPARE_OP", "node is node.parent.iter" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_ATTR", "node.parent.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "UNARY_NOT", "not isinstance(node.parent.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "is_special_comprehension_iter" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_DEREF", "frame" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "CALL_METHOD", "self._set_node_value(node.parent, frame, NodeValue.covered())" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "BINARY_ADD", "node._loops + (node.parent,)" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "LOAD_FAST", "comprehension_iter_proxy" ], [ "CALL_FUNCTION", "comprehension_iter_proxy()" ], [ "CALL_FUNCTION", "ChangeValue(comprehension_iter_proxy())" ], [ "LOAD_DEREF", "value" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._add_iteration" ], [ "LOAD_DEREF", "loops" ], [ "LOAD_DEREF", "frame" ], [ "CALL_METHOD", "self._add_iteration(loops, frame)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.inner_calls" ], [ "LOOKUP_METHOD", "frame_info.inner_calls.pop" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.inner_calls.pop(node, None)" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "node_value" ], [ "LOOKUP_METHOD", "node_value.set_meta" ], [ "LOAD_FAST", "inner_calls" ], [ "CALL_METHOD", "node_value.set_meta('inner_calls', inner_calls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.index" ], [ "COMPARE_OP", "iteration.index > 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_ATTR", "self.stack[frame].iteration" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOAD_FAST", "loop_node" ], [ "LOAD_ATTR", "loop_node._tree_index" ], [ "BINARY_SUBSCR", "iteration.loops[loop_node._tree_index]" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.recorded_node" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "loop.recorded_node(node)" ], [ "LOAD_FAST", "loop" ], [ "LOOKUP_METHOD", "loop.last" ], [ "CALL_METHOD", "loop.last()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "STORE_SUBSCR", "iteration.vals[node._tree_index]" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.exception" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "NodeValue.exception(exc_value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_node" ], [ "COMPARE_OP", "node is exc_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._exception_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_METHOD", "self._exception_value(node, frame, exc_value)" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.covered" ], [ "CALL_METHOD", "NodeValue.covered()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._set_node_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._set_node_value(node, frame, value)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._check_inner_call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._check_inner_call(self.stack[frame], node, value)" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_GLOBAL", "get_unfrozen_datetime" ], [ "CALL_FUNCTION", "get_unfrozen_datetime()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.start_time" ], [ "LOAD_GLOBAL", "Iteration" ], [ "CALL_FUNCTION", "Iteration()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.iteration" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.enter_node" ], [ "LOAD_ATTR", "enter_info.enter_node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(enter_info.enter_node.parent, ast.Module)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.copy" ], [ "CALL_METHOD", "frame.f_locals.copy()" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_ATTR", "code_info.arg_names" ], [ "LOAD_DEREF", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.items" ], [ "CALL_METHOD", "f_locals.items()" ], [ "BINARY_ADD", "[(name, f_locals.pop(name))\n for name in code_info.arg_names\n if name] + [\n\n # Local variables other than actual arguments. These are variables from\n # the enclosing scope. It's handy to treat them like arguments in the UI\n it for it in f_locals.items()\n if it[0][0] != '.' # Appears when using nested tuple arguments\n ]" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "arguments" ], [ "CALL_METHOD", "json.dumps([[k, cheap_repr(v)] for k, v in arguments])" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._call_id" ], [ "CALL_METHOD", "self._call_id()" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.call_id" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.inner_calls" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.get" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.caller_frame" ], [ "CALL_METHOD", "self.stack.get(enter_info.caller_frame)" ], [ "LOAD_FAST", "prev" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "prev" ], [ "CALL_FUNCTION", "getattr(prev, 'inner_calls', None)" ], [ "LOAD_FAST", "inner_calls" ], [ "COMPARE_OP", "inner_calls is not None" ], [ "LOAD_FAST", "inner_calls" ], [ "LOAD_FAST", "enter_info" ], [ "LOAD_ATTR", "enter_info.call_node" ], [ "BINARY_SUBSCR", "inner_calls[enter_info.call_node]" ], [ "LOOKUP_METHOD", "inner_calls[enter_info.call_node].append" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "CALL_METHOD", "inner_calls[enter_info.call_node].append(frame_info.call_id)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "f_locals" ], [ "LOOKUP_METHOD", "f_locals.pop" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "f_locals.pop(name)" ], [ "LOAD_FAST", "it" ], [ "BINARY_SUBSCR", "it[0]" ], [ "BINARY_SUBSCR", "it[0][0]" ], [ "COMPARE_OP", "it[0][0] != '.'" ], [ "LOAD_FAST", "it" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "cheap_repr(v)" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.current_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "COMPARE_OP", "frame.f_code not in self._code_infos" ], [ "LOAD_GLOBAL", "_tracing_recursively" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_tracing_recursively(frame)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.iteration" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "_deep_dict()" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOAD_DEREF", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(top_iteration, (), node_values)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "BINARY_SUBSCR", "self._code_infos[frame.f_code]" ], [ "LOAD_ATTR", "self._code_infos[frame.f_code].db_func" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_value" ], [ "LOAD_FAST", "exc" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "traceback" ], [ "LOOKUP_METHOD", "traceback.format_exception" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "type(exc)" ], [ "LOAD_FAST", "exc" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.exc_tb" ], [ "CALL_METHOD", "traceback.format_exception(type(exc), exc, exit_info.exc_tb)" ], [ "CALL_METHOD", "''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb))" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc" ], [ "CALL_FUNCTION", "exception_string(exc)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "CALL_FUNCTION", "retry_db" ], [ "LOAD_FAST", "add_call" ], [ "CALL_FUNCTION", "add_call()" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self._last_call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Call" ], [ "LOAD_FAST", "Call" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.call_id" ], [ "LOAD_DEREF", "db_func" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.arguments" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_DEREF", "exit_info" ], [ "LOAD_ATTR", "exit_info.return_value" ], [ "CALL_FUNCTION", "cheap_repr(exit_info.return_value)" ], [ "LOAD_DEREF", "exception" ], [ "LOAD_DEREF", "traceback_str" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_DEREF", "node_values" ], [ "LOAD_DEREF", "top_iteration" ], [ "LOOKUP_METHOD", "top_iteration.extract_iterations" ], [ "CALL_METHOD", "top_iteration.extract_iterations()" ], [ "BINARY_SUBSCR", "top_iteration.extract_iterations()['loops']" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOOKUP_METHOD", "type_registry.names" ], [ "CALL_METHOD", "type_registry.names()" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_ATTR", "type_registry.num_special_types" ], [ "CALL_FUNCTION", "dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n )" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "CALL_METHOD", "json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n )" ], [ "LOAD_DEREF", "frame_info" ], [ "LOAD_ATTR", "frame_info.start_time" ], [ "CALL_FUNCTION", "Call(id=frame_info.call_id,\n function_id=db_func,\n arguments=frame_info.arguments,\n return_value=cheap_repr(exit_info.return_value),\n exception=exception,\n traceback=traceback_str,\n data=json.dumps(\n dict(\n node_values=node_values,\n loop_iterations=top_iteration.extract_iterations()['loops'],\n type_names=type_registry.names(),\n num_special_types=type_registry.num_special_types,\n ),\n cls=ProtocolEncoder,\n separators=(',', ':')\n ),\n start_time=frame_info.start_time)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "session.add(call)" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.vals" ], [ "LOOKUP_METHOD", "iteration.vals.items" ], [ "CALL_METHOD", "iteration.vals.items()" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "(tree_index,) + path" ], [ "LOAD_FAST", "node_values" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[:-1]" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "path_k" ], [ "BINARY_SUBSCR", "d[path_k]" ], [ "LOAD_FAST", "node_value" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "full_path" ], [ "BINARY_SUBSCR", "full_path[-1]" ], [ "STORE_SUBSCR", "d[full_path[-1]]" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_ATTR", "iteration.loops" ], [ "LOOKUP_METHOD", "iteration.loops.values" ], [ "CALL_METHOD", "iteration.loops.values()" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "loop" ], [ "CALL_FUNCTION", "enumerate(loop)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._extract_node_values" ], [ "LOAD_FAST", "iteration" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "path + (i,)" ], [ "LOAD_FAST", "node_values" ], [ "CALL_METHOD", "self._extract_node_values(iteration, path + (i,), node_values)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(BirdsEye, self)" ], [ "LOOKUP_METHOD", "super(BirdsEye, self).trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "super(BirdsEye, self).trace_function(func)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOOKUP_METHOD", "self._code_infos.get" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_ATTR", "new_func.__code__" ], [ "CALL_METHOD", "self._code_infos.get(new_func.__code__)" ], [ "LOAD_FAST", "code_info" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcelines" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcelines(func)" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "len(lines)" ], [ "BINARY_ADD", "start_lineno + len(lines)" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "safe_qualname(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_FAST", "source_file" ], [ "LOOKUP_METHOD", "source_file.startswith" ], [ "CALL_METHOD", "source_file.startswith('= 0" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "inspect.getsourcefile(frame)" ], [ "LOAD_FAST", "filename" ], [ "COMPARE_OP", "filename is not None" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.abspath" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "os.path.abspath(filename)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOOKUP_METHOD", "frame.f_globals.get" ], [ "CALL_METHOD", "frame.f_globals.get('__name__')" ], [ "COMPARE_OP", "frame.f_globals.get('__name__') != '__main__'" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt.__name__" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "COMPARE_OP", "self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError(\n 'To trace an imported module, you must import birdseye before '\n 'importing that module.')" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOOKUP_METHOD", "read_source_file(filename).splitlines" ], [ "CALL_METHOD", "read_source_file(filename).splitlines()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "BINARY_MULTIPLY", "[''] * frame.f_lineno" ], [ "LOAD_FAST", "lines" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "STORE_SUBSCR", "lines[:frame.f_lineno]" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "'\\n'.join(lines)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.exec_string" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_FAST", "deep" ], [ "CALL_METHOD", "self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit(0)" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_DEREF", "source" ], [ "LOAD_DEREF", "filename" ], [ "CALL_METHOD", "self.compile(source, filename)" ], [ "LOAD_FAST", "globs" ], [ "LOOKUP_METHOD", "globs.update" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "globs.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_GLOBAL", "FILE_SENTINEL_NAME" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source)" ], [ "LOAD_FAST", "deep" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "LOAD_FAST", "globs" ], [ "LOAD_FAST", "locs" ], [ "CALL_FUNCTION", "exec(traced_file.code, globs, locs)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "code" ], [ "CALL_METHOD", "inspect.iscode(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOOKUP_METHOD", "code.co_name.startswith" ], [ "CALL_METHOD", "code.co_name.startswith('<')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "find_code(code)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_DEREF", "nodes_by_lineno" ], [ "LOOKUP_METHOD", "nodes_by_lineno.get" ], [ "LOAD_FAST", "lineno" ], [ "CALL_METHOD", "nodes_by_lineno.get(lineno)" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_DEREF", "filename" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_FAST", "code" ], [ "LOAD_DEREF", "source" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.last_token" ], [ "LOAD_ATTR", "node.last_token.end" ], [ "BINARY_SUBSCR", "node.last_token.end[0]" ], [ "BINARY_ADD", "node.last_token.end[0] + 1" ], [ "CALL_METHOD", "self._trace(\n code.co_name, filename, traced_file, code,\n typ='function',\n source=source,\n start_lineno=lineno,\n end_lineno=node.last_token.end[0] + 1,\n )" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.splitlines" ], [ "CALL_METHOD", "source.splitlines()" ], [ "CALL_FUNCTION", "len(source.splitlines())" ], [ "BINARY_ADD", "start_lineno + len(source.splitlines())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_of_interest" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "CALL_METHOD", "self._nodes_of_interest(traced_file, start_lineno, end_lineno)" ], [ "CALL_FUNCTION", "list(self._nodes_of_interest(traced_file, start_lineno, end_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._nodes_html" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._nodes_html(nodes, start_lineno, end_lineno, traced_file)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "dict(\n # This maps each node to the loops enclosing that node\n node_loops={\n node._tree_index: [n._tree_index for n in node._loops]\n for node, _ in nodes\n if node._loops\n },\n )" ], [ "LOAD_FAST", "typ" ], [ "COMPARE_OP", "typ == 'function'" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "only(node\n for node, _ in nodes\n if isinstance(node, ast.FunctionDef)\n and node.first_token.start[0] == start_lineno)" ], [ "LOAD_GLOBAL", "source_without_decorators" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_node" ], [ "CALL_FUNCTION", "source_without_decorators(tokens, func_node)" ], [ "LOAD_FAST", "data_dict" ], [ "LOOKUP_METHOD", "data_dict.update" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._node_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._node_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._node_ranges(nodes, tokens, func_startpos))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._loop_ranges" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_FAST", "func_startpos" ], [ "CALL_METHOD", "self._loop_ranges(nodes, tokens, func_startpos)" ], [ "CALL_FUNCTION", "list(self._loop_ranges(nodes, tokens, func_startpos))" ], [ "CALL_METHOD", "data_dict.update(\n node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)),\n loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)),\n )" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.dumps" ], [ "LOAD_FAST", "data_dict" ], [ "CALL_METHOD", "json.dumps(data_dict, sort_keys=True)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._db_func" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "name" ], [ "LOAD_DEREF", "start_lineno" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "typ" ], [ "CALL_METHOD", "self._db_func(data, filename, html_body, name, start_lineno, source, typ)" ], [ "LOAD_GLOBAL", "CodeInfo" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "arg_names" ], [ "CALL_FUNCTION", "CodeInfo(db_func, traced_file, arg_names)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._code_infos" ], [ "LOAD_FAST", "code" ], [ "STORE_SUBSCR", "self._code_infos[code]" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._loops" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "n" ], [ "LOAD_ATTR", "n._tree_index" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_DEREF", "start_lineno" ], [ "COMPARE_OP", "node.first_token.start[0] == start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "classes" ], [ "COMPARE_OP", "'loop' not in classes" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.target" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.test" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "tokens.get_text_range(target)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end\n )" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "tokens" ], [ "LOOKUP_METHOD", "tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "tokens.get_text_range(node)" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "func_start" ], [ "LOAD_FAST", "start" ], [ "COMPARE_OP", "start < 0" ], [ "LOAD_FAST", "end" ], [ "COMPARE_OP", "end < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "classes" ], [ "CALL_FUNCTION", "dict(\n tree_index=node._tree_index,\n start=start,\n end=end,\n depth=node._depth,\n classes=classes,\n )" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "BINARY_ADD", "filename + name" ], [ "LOAD_FAST", "html_body" ], [ "BINARY_ADD", "filename + name + html_body" ], [ "LOAD_FAST", "data" ], [ "BINARY_ADD", "filename + name + html_body + data" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "start_lineno" ], [ "CALL_FUNCTION", "str(start_lineno)" ], [ "BINARY_ADD", "filename + name + html_body + data + str(start_lineno)" ], [ "CALL_FUNCTION", "h(filename + name + html_body + data + str(start_lineno))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOAD_ATTR", "self.db.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.db" ], [ "LOOKUP_METHOD", "self.db.session_scope" ], [ "CALL_METHOD", "self.db.session_scope()" ], [ "LOAD_GLOBAL", "one_or_none" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_METHOD", "session.query(Function).filter_by(hash=function_hash)" ], [ "CALL_FUNCTION", "one_or_none(session.query(Function).filter_by(hash=function_hash))" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "html_body" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "data" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "h(source)" ], [ "LOAD_FAST", "function_hash" ], [ "CALL_FUNCTION", "Function(file=filename,\n name=name,\n type=typ,\n html_body=html_body,\n lineno=start_lineno,\n data=data,\n body_hash=h(source),\n hash=function_hash)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_FAST", "db_func" ], [ "CALL_METHOD", "session.add(db_func)" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(db_func.id, int)" ], [ "LOAD_FAST", "db_func" ], [ "LOAD_ATTR", "db_func.id" ], [ "LOAD_GLOBAL", "hashlib" ], [ "LOOKUP_METHOD", "hashlib.sha256" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.encode" ], [ "CALL_METHOD", "s.encode('utf8')" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8'))" ], [ "LOOKUP_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest" ], [ "CALL_METHOD", "hashlib.sha256(s.encode('utf8')).hexdigest()" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(node, (ast.While, ast.For, ast.comprehension))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "CALL_FUNCTION", "isinstance(node.parent, ast.GeneratorExp)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('loop')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "classes" ], [ "LOOKUP_METHOD", "classes.append" ], [ "CALL_METHOD", "classes.append('stmt')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._is_interesting_expression" ], [ "LOAD_FAST", "classes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(node, ast.AST)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'first_token')" ], [ "LOAD_FAST", "start_lineno" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.first_token" ], [ "LOAD_ATTR", "node.first_token.start" ], [ "BINARY_SUBSCR", "node.first_token.start[0]" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(node)" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "classes" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "STORE_ATTR", "traced_file.root._depth" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.root" ], [ "CALL_METHOD", "ast.walk(traced_file.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "BINARY_ADD", "node._depth + 1" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child._depth" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.extend" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._depth" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "LOOKUP_METHOD", "' '.join" ], [ "LOAD_FAST", "classes" ], [ "CALL_METHOD", "' '.join(classes)" ], [ "BINARY_MODULO", "'' % (node._tree_index, ' '.join(classes))" ], [ "CALL_FUNCTION", "map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n ''])" ], [ "CALL_METHOD", "positions.extend(map(\n HTMLPosition,\n [start, end],\n [True, False], # is_start\n [node._depth, node._depth],\n ['' % (node._tree_index, ' '.join(classes)),\n '']))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._separate_comprehensions" ], [ "LOAD_FAST", "nodes" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._separate_comprehensions(\n [n[0] for n in nodes],\n end_lineno, positions, traced_file)" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "CALL_FUNCTION", "len(traced_file.source)" ], [ "CALL_FUNCTION", "HTMLPosition(len(traced_file.source), False, 0, '')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(len(traced_file.source), False, 0, ''))" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.sort" ], [ "CALL_METHOD", "positions.sort()" ], [ "LOAD_FAST", "positions" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_GLOBAL", "html" ], [ "LOOKUP_METHOD", "html.escape" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.source" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "BINARY_SUBSCR", "traced_file.source[start:position.index]" ], [ "CALL_METHOD", "html.escape(traced_file.source[start:position.index])" ], [ "CALL_METHOD", "html_parts.append(html.escape(traced_file.source[start:position.index]))" ], [ "LOAD_FAST", "html_parts" ], [ "LOOKUP_METHOD", "html_parts.append" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.html" ], [ "CALL_METHOD", "html_parts.append(position.html)" ], [ "LOAD_FAST", "position" ], [ "LOAD_ATTR", "position.index" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "html_parts" ], [ "CALL_METHOD", "''.join(html_parts)" ], [ "LOOKUP_METHOD", "'\\n'.join" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.split" ], [ "CALL_METHOD", "html_body.split('\\n')" ], [ "LOAD_FAST", "start_lineno" ], [ "BINARY_SUBTRACT", "start_lineno - 1" ], [ "LOAD_FAST", "end_lineno" ], [ "BINARY_SUBTRACT", "end_lineno - 1" ], [ "BINARY_SUBSCR", "html_body.split('\\n')[start_lineno - 1:end_lineno - 1]" ], [ "CALL_METHOD", "'\\n'.join(html_body.split('\\n')[start_lineno - 1:end_lineno - 1])" ], [ "LOAD_FAST", "html_body" ], [ "LOOKUP_METHOD", "html_body.strip" ], [ "CALL_METHOD", "html_body.strip('\\n')" ], [ "LOAD_FAST", "n" ], [ "BINARY_SUBSCR", "n[0]" ], [ "LOAD_GLOBAL", "group_by_key_func" ], [ "LOAD_GLOBAL", "of_type" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_FAST", "nodes" ], [ "CALL_FUNCTION", "of_type((ast.comprehension, ast.While, ast.For), nodes)" ], [ "CALL_FUNCTION", "group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes),\n lambda c: c.first_token.start[0]\n )" ], [ "LOAD_FAST", "comprehensions" ], [ "LOOKUP_METHOD", "comprehensions.values" ], [ "CALL_METHOD", "comprehensions.values()" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "comp_list" ], [ "CALL_FUNCTION", "sorted(comp_list, key=lambda c: c.first_token.startpos)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "comp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(comp, ast.comprehension)" ], [ "LOAD_FAST", "comp" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "LOAD_ATTR", "comp.parent.generators" ], [ "BINARY_SUBSCR", "comp.parent.generators[0]" ], [ "COMPARE_OP", "comp is comp.parent.generators[0]" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "LOAD_ATTR", "comp.parent" ], [ "CALL_FUNCTION", "get_start(comp.parent)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "start < prev_start" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "get_start" ], [ "LOAD_FAST", "comp" ], [ "CALL_FUNCTION", "get_start(comp)" ], [ "LOAD_FAST", "prev_start" ], [ "COMPARE_OP", "prev_start is not None" ], [ "LOAD_FAST", "positions" ], [ "LOOKUP_METHOD", "positions.append" ], [ "LOAD_GLOBAL", "HTMLPosition" ], [ "LOAD_FAST", "start" ], [ "CALL_FUNCTION", "HTMLPosition(start, True, 0, '\\n ')" ], [ "CALL_METHOD", "positions.append(HTMLPosition(start, True, 0, '\\n '))" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end_lineno" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.start" ], [ "BINARY_SUBSCR", "c.first_token.start[0]" ], [ "LOAD_DEREF", "traced_file" ], [ "LOAD_ATTR", "traced_file.tokens" ], [ "LOOKUP_METHOD", "traced_file.tokens.get_text_range" ], [ "LOAD_FAST", "n" ], [ "CALL_METHOD", "traced_file.tokens.get_text_range(n)" ], [ "BINARY_SUBSCR", "traced_file.tokens.get_text_range(n)[0]" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.first_token" ], [ "LOAD_ATTR", "c.first_token.startpos" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "_deep_dict" ], [ "CALL_FUNCTION", "defaultdict(_deep_dict)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "_bad_codes" ], [ "COMPARE_OP", "frame.f_code in _bad_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.vals" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "IterationList" ], [ "CALL_FUNCTION", "defaultdict(IterationList)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.loops" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.loops" ], [ "LOOKUP_METHOD", "self.loops.items" ], [ "CALL_METHOD", "self.loops.items()" ], [ "LOAD_FAST", "iteration_list" ], [ "LOAD_FAST", "tree_index" ], [ "LOAD_FAST", "iteration" ], [ "LOOKUP_METHOD", "iteration.extract_iterations" ], [ "CALL_METHOD", "iteration.extract_iterations()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.start" ], [ "LOAD_GLOBAL", "deque" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "CALL_FUNCTION", "deque(maxlen=self.side_len)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "Counter" ], [ "CALL_FUNCTION", "Counter()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.recorded" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "self.length < self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.start.append(iteration)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "len(self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.side_len" ], [ "COMPARE_OP", "len(self.end) >= self.side_len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "LOAD_ATTR", "self.end[0].keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOOKUP_METHOD", "self.start.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[0]" ], [ "CALL_METHOD", "self.start.append(self.end[0])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOOKUP_METHOD", "self.end.append" ], [ "LOAD_FAST", "iteration" ], [ "CALL_METHOD", "self.end.append(iteration)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.length" ], [ "LOAD_FAST", "iteration" ], [ "STORE_ATTR", "iteration.index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.length" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "CALL_FUNCTION", "chain(self.start, self.end)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.end" ], [ "BINARY_SUBSCR", "self.end[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start" ], [ "BINARY_SUBSCR", "self.start[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "self.recorded[node]" ], [ "COMPARE_OP", "self.recorded[node] >= 2" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.last" ], [ "CALL_METHOD", "self.last()" ], [ "STORE_ATTR", "self.last().keep" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.recorded" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "self.recorded[node]" ], [ "LOAD_NAME", "type" ], [ "CALL_FUNCTION", "type(None)" ], [ "LOAD_NAME", "bool" ], [ "LOAD_NAME", "int" ], [ "LOAD_NAME", "float" ], [ "LOAD_NAME", "complex" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "long" ], [ "LOAD_NAME", "basic_types" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "set" ], [ "LOAD_NAME", "frozenset" ], [ "LOAD_NAME", "str" ], [ "BINARY_ADD", "basic_types + (list, dict, tuple, set, frozenset, str)" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "bytes" ], [ "LOAD_NAME", "len" ], [ "LOAD_NAME", "special_types" ], [ "CALL_FUNCTION", "len(special_types)" ], [ "LOAD_GLOBAL", "Lock" ], [ "CALL_FUNCTION", "Lock()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.lock" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "CALL_FUNCTION", "defaultdict(lambda: len(self.data))" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.data" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.special_types" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "len(self.data)" ], [ "LOAD_GLOBAL", "correct_type" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "correct_type(item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.lock" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBSCR", "self.data[t]" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "LOOKUP_METHOD", "self.data.items" ], [ "CALL_METHOD", "self.data.items()" ], [ "CALL_FUNCTION", "dict((v, k) for k, v in self.data.items())" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "rev" ], [ "CALL_FUNCTION", "len(rev)" ], [ "CALL_FUNCTION", "range(len(rev))" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "safe_qualname" ], [ "LOAD_DEREF", "rev" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "rev[i]" ], [ "CALL_FUNCTION", "safe_qualname(rev[i])" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_FAST", "val_repr" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.val_repr" ], [ "LOAD_FAST", "type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.meta" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self.meta[key]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOOKUP_METHOD", "self.children.append" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "NodeValue" ], [ "LOOKUP_METHOD", "NodeValue.expression" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "level" ], [ "CALL_METHOD", "NodeValue.expression(samples, value, level)" ], [ "CALL_METHOD", "self.children.append((key, NodeValue.expression(samples, value, level)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.val_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.type_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.meta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.children" ], [ "CALL_METHOD", "result.extend(self.children)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "cls('', -2)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "exception_string" ], [ "LOAD_FAST", "exc_value" ], [ "CALL_FUNCTION", "exception_string(exc_value)" ], [ "CALL_FUNCTION", "cls(exception_string(exc_value), -1)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "cheap_repr(val)" ], [ "LOAD_GLOBAL", "type_registry" ], [ "LOAD_FAST", "val" ], [ "BINARY_SUBSCR", "type_registry[val]" ], [ "CALL_FUNCTION", "cls(cheap_repr(val), type_registry[val])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "TypeRegistry" ], [ "LOAD_ATTR", "TypeRegistry.basic_types" ], [ "LOAD_GLOBAL", "BirdsEye" ], [ "CALL_FUNCTION", "isinstance(val, (TypeRegistry.basic_types, BirdsEye))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(val, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "len(val)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "length" ], [ "CALL_METHOD", "result.set_meta('len', length)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ModuleType" ], [ "CALL_FUNCTION", "isinstance(val, ModuleType)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "level" ], [ "CALL_FUNCTION", "min(level, 2)" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.add_child" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "level" ], [ "BINARY_SUBTRACT", "level - 1" ], [ "CALL_FUNCTION", "partial(result.add_child, samples, level - 1)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Series, ndarray))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, ndarray)" ], [ "LOAD_FAST", "attrs" ], [ "LOOKUP_METHOD", "attrs.append" ], [ "CALL_METHOD", "attrs.append('shape')" ], [ "LOAD_FAST", "attrs" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "getattr(val, name)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(name, attr)" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 3" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level >= 2" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_FAST", "samples" ], [ "LOAD_FAST", "sample_type" ], [ "BINARY_SUBSCR", "samples[sample_type]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "DataFrame" ], [ "CALL_FUNCTION", "isinstance(val, DataFrame)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.set_meta" ], [ "LOAD_FAST", "meta" ], [ "CALL_METHOD", "result.set_meta('dataframe', meta)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_cols']" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_ADD", "max_rows + 2" ], [ "COMPARE_OP", "length > max_rows + 2" ], [ "LOAD_FAST", "max_rows" ], [ "BINARY_FLOOR_DIVIDE", "max_rows // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['row_break']" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "columns" ], [ "CALL_FUNCTION", "len(columns)" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_ADD", "max_cols + 2" ], [ "COMPARE_OP", "num_cols > max_cols + 2" ], [ "LOAD_FAST", "max_cols" ], [ "BINARY_FLOOR_DIVIDE", "max_cols // 2" ], [ "LOAD_FAST", "meta" ], [ "STORE_SUBSCR", "meta['col_break']" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "num_cols" ], [ "LOAD_FAST", "max_cols" ], [ "CALL_FUNCTION", "_sample_indices(num_cols, max_cols)" ], [ "CALL_FUNCTION", "set(_sample_indices(num_cols, max_cols))" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_GLOBAL", "zip" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "LOOKUP_METHOD", "val.columns.format" ], [ "CALL_METHOD", "val.columns.format(sparsify=False)" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.columns" ], [ "CALL_FUNCTION", "zip(val.columns.format(sparsify=False),\n val.columns)" ], [ "CALL_FUNCTION", "enumerate(zip(val.columns.format(sparsify=False),\n val.columns))" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "COMPARE_OP", "i in indices" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "formatted_name" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "label" ], [ "BINARY_SUBSCR", "val[label]" ], [ "CALL_FUNCTION", "add_child(formatted_name, val[label])" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Series" ], [ "CALL_FUNCTION", "isinstance(val, Series)" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['pandas_rows']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['pandas_rows'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "val.index[i:i + 1]" ], [ "LOOKUP_METHOD", "val.index[i:i + 1].format" ], [ "CALL_METHOD", "val.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "val.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "val" ], [ "LOAD_ATTR", "val.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val.iloc[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "k" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(k, v)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "level" ], [ "COMPARE_OP", "level <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "unicode" ], [ "LOAD_GLOBAL", "xrange" ], [ "CALL_FUNCTION", "isinstance(val,\n (str, bytes, range)\n if PY3 else\n (str, unicode, xrange))" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Sequence" ], [ "LOAD_GLOBAL", "ndarray" ], [ "CALL_FUNCTION", "isinstance(val, (Sequence, ndarray))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is not None" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['list']" ], [ "CALL_FUNCTION", "_sample_indices(length, samples['list'])" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "val[i]" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "str(i)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(i), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Mapping" ], [ "CALL_FUNCTION", "isinstance(val, Mapping)" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "iteritems" ], [ "CALL_FUNCTION", "_safe_iter(val, iteritems)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['dict']" ], [ "CALL_FUNCTION", "islice(_safe_iter(val, iteritems), samples['dict'])" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "cheap_repr(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(cheap_repr(k), v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "val" ], [ "LOAD_GLOBAL", "Set" ], [ "CALL_FUNCTION", "isinstance(val, Set)" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "_safe_iter(val)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['set']" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length is None" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "num_items" ], [ "BINARY_ADD", "num_items + 2" ], [ "COMPARE_OP", "length > num_items + 2" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "vals" ], [ "LOAD_FAST", "num_items" ], [ "CALL_FUNCTION", "islice(vals, num_items)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "vals" ], [ "CALL_FUNCTION", "enumerate(vals)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_FAST", "i" ], [ "BINARY_MODULO", "'<%s>' % i" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child('<%s>' % i, v)" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "getattr(val, '__dict__', None)" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_GLOBAL", "_safe_iter" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_safe_iter(d)" ], [ "LOAD_FAST", "samples" ], [ "BINARY_SUBSCR", "samples['attributes']" ], [ "CALL_FUNCTION", "islice(_safe_iter(d),\n samples['attributes'])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "sorted(islice(_safe_iter(d),\n samples['attributes']),\n key=str)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "k" ], [ "BINARY_SUBSCR", "d[k]" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL_FUNCTION", "isinstance(v, TracedFile)" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "k" ], [ "CALL_FUNCTION", "str(k)" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "add_child(str(k), v)" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "type(val)" ], [ "CALL_FUNCTION", "getattr(type(val), '__slots__', None)" ], [ "CALL_FUNCTION", "sorted(getattr(type(val), '__slots__', None) or ())" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "val" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "getattr(val, s)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "add_child" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "str(s)" ], [ "LOAD_FAST", "attr" ], [ "CALL_FUNCTION", "add_child(str(s), attr)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "val" ], [ "CALL_FUNCTION", "f(val)" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ())))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, 'ctx', None)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Store" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Del" ], [ "CALL_FUNCTION", "isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "isinstance(node, ast.UnaryOp)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.op" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UAdd" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.USub" ], [ "CALL_FUNCTION", "isinstance(node.op, (ast.UAdd, ast.USub))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "CALL_FUNCTION", "isinstance(node.operand, ast.Num)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.List" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Tuple" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Dict" ], [ "CALL_FUNCTION", "isinstance(node, (ast.List, ast.Tuple, ast.Dict))" ], [ "LOAD_GLOBAL", "any" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "CALL_FUNCTION", "any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))" ], [ "UNARY_NOT", "not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or\n isinstance(getattr(node, 'ctx', None),\n (ast.Store, ast.Del)) or\n (isinstance(node, ast.UnaryOp) and\n isinstance(node.op, (ast.UAdd, ast.USub)) and\n isinstance(node.operand, ast.Num)) or\n (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and\n not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))" ], [ "LOAD_GLOBAL", "is_interesting_expression" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "is_interesting_expression(n)" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "__builtins__" ], [ "CALL_FUNCTION", "cast(dict, __builtins__)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "CALL_FUNCTION", "isinstance(node, ast.Name)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "LOAD_FAST", "builtins" ], [ "COMPARE_OP", "node.id in builtins" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.id" ], [ "BINARY_SUBSCR", "builtins[node.id]" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "builtins[node.id] is value" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'NameConstant', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'NameConstant', ()))" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-2.7.json000066400000000000000000000341061474076367500257540ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.GetStdHandle" ], [ "CALL_FUNCTION", "kernel32.GetStdHandle(-11)" ], [ "CALL_FUNCTION", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_FUNCTION", "inspect.ismethod(shape)" ], [ "LOAD_ATTR", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_ATTR", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_FUNCTION", "inspect.ismethod(dtype)" ], [ "LOAD_ATTR", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_FUNCTION", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "f.write(s)" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.10.json000066400000000000000000000323311474076367500260250ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "IS_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "IS_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOAD_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOAD_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "IS_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.11.json000066400000000000000000000665351474076367500260430ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from io import open" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "import snoop as package" ], [ "STORE_NAME", "from snoop.formatting import DefaultFormatter" ], [ "STORE_NAME", "from snoop.pp_module import PP" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "import ctypes" ], [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "STORE_NAME", "kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.GetStdHandle" ], [ "CALL", "kernel32.GetStdHandle(-11)" ], [ "CALL", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "STORE_NAME", "can_color" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "STORE_NAME", "can_color" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", "def install(\n builtins=True,\n snoop=\"snoop\",\n pp=\"pp\",\n spy=\"spy\",\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n):\n \"\"\"\n Configure output, enable or disable, and add names to builtins. Parameters:\n \n - builtins: set to False to not add any names to builtins,\n so importing will still be required.\n - snoop, pp, and spy: set to other strings \n to choose the names of these functions in builtins\n - `out`: determines the output destination. By default this is stderr. You can also pass:\n - A string or a `Path` object to write to a file at that location. By default this always will append to the file. Pass `overwrite=True` to clear the file initially.\n - Anything with a `write` method, e.g. `sys.stdout` or a file object.\n - Any callable with a single string argument, e.g. `logger.info`.\n - `color`: determines whether the output includes escape characters to display colored text in the console. If you see weird characters in your output, your console doesn't support colors, so pass `color=False`.\n - Code is syntax highlighted using [Pygments](http://pygments.org/), and this argument is passed as the style. You can choose a different color scheme by passing a string naming a style (see [this gallery](https://help.farbox.com/pygments.html)) or a style class. The default style is monokai. \n - By default this parameter is set to `out.isatty()`, which is usually true for stdout and stderr but will be false if they are redirected or piped. Pass `True` or a style if you want to force coloring.\n - To see colors in the PyCharm Run window, edit the Run Configuration and tick \"Emulate terminal in output console\".\n - `prefix`: Pass a string to start all snoop lines with that string so you can grep for them easily.\n - `columns`: This specifies the columns at the start of each output line. You can pass a string with the names of built in columns separated by spaces or commas. These are the available columns:\n - `time`: The current time. This is the only column by default.\n - `thread`: The name of the current thread. \n - `thread_ident`: The [identifier](https://docs.python.org/3/library/threading.html#threading.Thread.ident) of the current thread, in case thread names are not unique.\n - `file`: The filename (not the full path) of the current function.\n - `full_file`: The full path to the file (also shown anyway when the function is called).\n - `function`: The name of the current function.\n - `function_qualname`: The qualified name of the current function.\n \n If you want a custom column, please open an issue to tell me what you're interested in! In the meantime, you can pass a list, where the elements are either strings or callables. The callables should take one argument, which will be an `Event` object. It has attributes `frame`, `event`, and `arg`, as specified in [`sys.settrace()`](https://docs.python.org/3/library/sys.html#sys.settrace), and other attributes which may change. \n \"\"\"\n \n if builtins:\n setattr(builtins_module, snoop, package.snoop)\n setattr(builtins_module, pp, package.pp)\n setattr(builtins_module, spy, package.spy)\n config = Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )\n package.snoop.config = config\n package.pp.config = config\n package.spy.config = config" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "def len_shape_watch(source, value):\n try:\n shape = value.shape\n except Exception:\n pass\n else:\n if not inspect.ismethod(shape):\n return '{}.shape'.format(source), shape\n\n if isinstance(value, QuerySet):\n # Getting the length of a Django queryset evaluates it\n return None\n\n length = len(value)\n if (\n (isinstance(value, six.string_types)\n and length < 50) or\n (isinstance(value, (Mapping, Set, Sequence))\n and length == 0)\n ):\n return None\n\n return 'len({})'.format(source), length" ], [ "STORE_NAME", "def dtype_watch(source, value):\n dtype = value.dtype\n if not inspect.ismethod(dtype):\n return '{}.dtype'.format(source), dtype" ], [ "STORE_NAME", "def get_write_function(output, overwrite):\n is_path = (\n isinstance(output, six.string_types)\n or is_pathlike(output)\n )\n if is_path:\n return FileWriter(output, overwrite).write\n elif callable(output):\n write = output\n else:\n def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))\n return write" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "STORE_NAME", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "STORE_FAST", "config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "STORE_NAME", "\"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", " def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "STORE_FAST", "isatty" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL", "isatty()" ], [ "CALL", "bool(isatty())" ], [ "STORE_FAST", "color" ], [ "STORE_FAST", "color" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "CALL", " class ConfiguredTracer(Tracer):\n config = self" ], [ "STORE_FAST", " class ConfiguredTracer(Tracer):\n config = self" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL", "ensure_tuple(watch_extras)" ], [ "BINARY_OP", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "STORE_NAME", "config" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "STORE_FAST", "shape" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL", "inspect.ismethod(shape)" ], [ "LOAD_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL", "len(value)" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "STORE_FAST", "dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL", "inspect.ismethod(dtype)" ], [ "LOAD_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL", "is_pathlike(output)" ], [ "STORE_FAST", "is_path" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "write" ], [ "STORE_FAST", " def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL", "shitcode(s)" ], [ "CALL", "stream.write(shitcode(s))" ], [ "STORE_NAME", " def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite" ], [ "STORE_NAME", " def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "f.write(s)" ], [ "CALL", " with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.12.json000066400000000000000000000667641474076367500260500ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from io import open" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "import snoop as package" ], [ "STORE_NAME", "from snoop.formatting import DefaultFormatter" ], [ "STORE_NAME", "from snoop.pp_module import PP" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "import ctypes" ], [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "STORE_NAME", "kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.GetStdHandle" ], [ "CALL", "kernel32.GetStdHandle(-11)" ], [ "CALL", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "STORE_NAME", "can_color" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", "def install(\n builtins=True,\n snoop=\"snoop\",\n pp=\"pp\",\n spy=\"spy\",\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n):\n \"\"\"\n Configure output, enable or disable, and add names to builtins. Parameters:\n \n - builtins: set to False to not add any names to builtins,\n so importing will still be required.\n - snoop, pp, and spy: set to other strings \n to choose the names of these functions in builtins\n - `out`: determines the output destination. By default this is stderr. You can also pass:\n - A string or a `Path` object to write to a file at that location. By default this always will append to the file. Pass `overwrite=True` to clear the file initially.\n - Anything with a `write` method, e.g. `sys.stdout` or a file object.\n - Any callable with a single string argument, e.g. `logger.info`.\n - `color`: determines whether the output includes escape characters to display colored text in the console. If you see weird characters in your output, your console doesn't support colors, so pass `color=False`.\n - Code is syntax highlighted using [Pygments](http://pygments.org/), and this argument is passed as the style. You can choose a different color scheme by passing a string naming a style (see [this gallery](https://help.farbox.com/pygments.html)) or a style class. The default style is monokai. \n - By default this parameter is set to `out.isatty()`, which is usually true for stdout and stderr but will be false if they are redirected or piped. Pass `True` or a style if you want to force coloring.\n - To see colors in the PyCharm Run window, edit the Run Configuration and tick \"Emulate terminal in output console\".\n - `prefix`: Pass a string to start all snoop lines with that string so you can grep for them easily.\n - `columns`: This specifies the columns at the start of each output line. You can pass a string with the names of built in columns separated by spaces or commas. These are the available columns:\n - `time`: The current time. This is the only column by default.\n - `thread`: The name of the current thread. \n - `thread_ident`: The [identifier](https://docs.python.org/3/library/threading.html#threading.Thread.ident) of the current thread, in case thread names are not unique.\n - `file`: The filename (not the full path) of the current function.\n - `full_file`: The full path to the file (also shown anyway when the function is called).\n - `function`: The name of the current function.\n - `function_qualname`: The qualified name of the current function.\n \n If you want a custom column, please open an issue to tell me what you're interested in! In the meantime, you can pass a list, where the elements are either strings or callables. The callables should take one argument, which will be an `Event` object. It has attributes `frame`, `event`, and `arg`, as specified in [`sys.settrace()`](https://docs.python.org/3/library/sys.html#sys.settrace), and other attributes which may change. \n \"\"\"\n \n if builtins:\n setattr(builtins_module, snoop, package.snoop)\n setattr(builtins_module, pp, package.pp)\n setattr(builtins_module, spy, package.spy)\n config = Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )\n package.snoop.config = config\n package.pp.config = config\n package.spy.config = config" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "def len_shape_watch(source, value):\n try:\n shape = value.shape\n except Exception:\n pass\n else:\n if not inspect.ismethod(shape):\n return '{}.shape'.format(source), shape\n\n if isinstance(value, QuerySet):\n # Getting the length of a Django queryset evaluates it\n return None\n\n length = len(value)\n if (\n (isinstance(value, six.string_types)\n and length < 50) or\n (isinstance(value, (Mapping, Set, Sequence))\n and length == 0)\n ):\n return None\n\n return 'len({})'.format(source), length" ], [ "STORE_NAME", "def dtype_watch(source, value):\n dtype = value.dtype\n if not inspect.ismethod(dtype):\n return '{}.dtype'.format(source), dtype" ], [ "STORE_NAME", "def get_write_function(output, overwrite):\n is_path = (\n isinstance(output, six.string_types)\n or is_pathlike(output)\n )\n if is_path:\n return FileWriter(output, overwrite).write\n elif callable(output):\n write = output\n else:\n def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))\n return write" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "STORE_NAME", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "STORE_NAME", "can_color" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "STORE_FAST", "config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "STORE_NAME", "\"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", " def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "STORE_FAST", "isatty" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL", "isatty()" ], [ "CALL", "bool(isatty())" ], [ "STORE_FAST", "color" ], [ "STORE_FAST", "color" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "CALL", " class ConfiguredTracer(Tracer):\n config = self" ], [ "STORE_FAST", " class ConfiguredTracer(Tracer):\n config = self" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL", "ensure_tuple(watch_extras)" ], [ "BINARY_OP", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_FROM_DICT_OR_DEREF", "self" ], [ "STORE_NAME", "config" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "STORE_FAST", "shape" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL", "inspect.ismethod(shape)" ], [ "LOAD_ATTR", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL", "len(value)" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_ATTR", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "STORE_FAST", "dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL", "inspect.ismethod(dtype)" ], [ "LOAD_ATTR", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL", "is_pathlike(output)" ], [ "STORE_FAST", "is_path" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "write" ], [ "LOAD_FAST", "write" ], [ "STORE_FAST", " def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL", "shitcode(s)" ], [ "CALL", "stream.write(shitcode(s))" ], [ "STORE_NAME", " def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite" ], [ "STORE_NAME", " def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "f.write(s)" ], [ "CALL", " with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.13.json000066400000000000000000000717341474076367500260420ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from collections import Set, Mapping, Sequence" ], [ "STORE_NAME", "from io import open" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "import snoop as package" ], [ "STORE_NAME", "from snoop.formatting import DefaultFormatter" ], [ "STORE_NAME", "from snoop.pp_module import PP" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.tracer import Spy, Tracer" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet" ], [ "STORE_NAME", "import ctypes" ], [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "STORE_NAME", "kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.GetStdHandle" ], [ "CALL", "kernel32.GetStdHandle(-11)" ], [ "CALL", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "STORE_NAME", "can_color" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", "def install(\n builtins=True,\n snoop=\"snoop\",\n pp=\"pp\",\n spy=\"spy\",\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n):\n \"\"\"\n Configure output, enable or disable, and add names to builtins. Parameters:\n \n - builtins: set to False to not add any names to builtins,\n so importing will still be required.\n - snoop, pp, and spy: set to other strings \n to choose the names of these functions in builtins\n - `out`: determines the output destination. By default this is stderr. You can also pass:\n - A string or a `Path` object to write to a file at that location. By default this always will append to the file. Pass `overwrite=True` to clear the file initially.\n - Anything with a `write` method, e.g. `sys.stdout` or a file object.\n - Any callable with a single string argument, e.g. `logger.info`.\n - `color`: determines whether the output includes escape characters to display colored text in the console. If you see weird characters in your output, your console doesn't support colors, so pass `color=False`.\n - Code is syntax highlighted using [Pygments](http://pygments.org/), and this argument is passed as the style. You can choose a different color scheme by passing a string naming a style (see [this gallery](https://help.farbox.com/pygments.html)) or a style class. The default style is monokai. \n - By default this parameter is set to `out.isatty()`, which is usually true for stdout and stderr but will be false if they are redirected or piped. Pass `True` or a style if you want to force coloring.\n - To see colors in the PyCharm Run window, edit the Run Configuration and tick \"Emulate terminal in output console\".\n - `prefix`: Pass a string to start all snoop lines with that string so you can grep for them easily.\n - `columns`: This specifies the columns at the start of each output line. You can pass a string with the names of built in columns separated by spaces or commas. These are the available columns:\n - `time`: The current time. This is the only column by default.\n - `thread`: The name of the current thread. \n - `thread_ident`: The [identifier](https://docs.python.org/3/library/threading.html#threading.Thread.ident) of the current thread, in case thread names are not unique.\n - `file`: The filename (not the full path) of the current function.\n - `full_file`: The full path to the file (also shown anyway when the function is called).\n - `function`: The name of the current function.\n - `function_qualname`: The qualified name of the current function.\n \n If you want a custom column, please open an issue to tell me what you're interested in! In the meantime, you can pass a list, where the elements are either strings or callables. The callables should take one argument, which will be an `Event` object. It has attributes `frame`, `event`, and `arg`, as specified in [`sys.settrace()`](https://docs.python.org/3/library/sys.html#sys.settrace), and other attributes which may change. \n \"\"\"\n \n if builtins:\n setattr(builtins_module, snoop, package.snoop)\n setattr(builtins_module, pp, package.pp)\n setattr(builtins_module, spy, package.spy)\n config = Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )\n package.snoop.config = config\n package.pp.config = config\n package.spy.config = config" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "class Config(object):\n \"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"\n \n def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", "def len_shape_watch(source, value):\n try:\n shape = value.shape\n except Exception:\n pass\n else:\n if not inspect.ismethod(shape):\n return '{}.shape'.format(source), shape\n\n if isinstance(value, QuerySet):\n # Getting the length of a Django queryset evaluates it\n return None\n\n length = len(value)\n if (\n (isinstance(value, six.string_types)\n and length < 50) or\n (isinstance(value, (Mapping, Set, Sequence))\n and length == 0)\n ):\n return None\n\n return 'len({})'.format(source), length" ], [ "STORE_NAME", "def dtype_watch(source, value):\n dtype = value.dtype\n if not inspect.ismethod(dtype):\n return '{}.dtype'.format(source), dtype" ], [ "STORE_NAME", "def get_write_function(output, overwrite):\n is_path = (\n isinstance(output, six.string_types)\n or is_pathlike(output)\n )\n if is_path:\n return FileWriter(output, overwrite).write\n elif callable(output):\n write = output\n else:\n def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))\n return write" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "STORE_NAME", "class FileWriter(object):\n def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite\n\n def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "STORE_NAME", "can_color" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "STORE_FAST", "config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "STORE_NAME", "\"\"\"\"\n If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one.\n \n The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`.\n \"\"\"" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "STORE_NAME", " def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "STORE_NAME", " def __init__(\n self,\n out=None,\n prefix='',\n columns='time',\n overwrite=False,\n color=None,\n enabled=True,\n watch_extras=(),\n replace_watch_extras=None,\n formatter_class=DefaultFormatter,\n ):\n if can_color:\n if color is None:\n isatty = getattr(out or sys.stderr, 'isatty', lambda: False)\n color = bool(isatty())\n else:\n color = False\n\n self.write = get_write_function(out, overwrite)\n self.formatter = formatter_class(prefix, columns, color)\n self.enabled = enabled\n self.pp = PP(self)\n\n class ConfiguredTracer(Tracer):\n config = self\n\n self.snoop = ConfiguredTracer\n self.spy = Spy(self)\n\n self.last_frame = None\n self.thread_local = threading.local()\n\n if replace_watch_extras is not None:\n self.watch_extras = ensure_tuple(replace_watch_extras)\n else:\n self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "STORE_FAST", "isatty" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL", "isatty()" ], [ "CALL", "bool(isatty())" ], [ "STORE_FAST", "color" ], [ "STORE_FAST", "color" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "CALL", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "color" ], [ "CALL", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_FAST", " class ConfiguredTracer(Tracer):\n config = self" ], [ "LOAD_GLOBAL", "Tracer" ], [ "CALL", " class ConfiguredTracer(Tracer):\n config = self" ], [ "STORE_FAST", " class ConfiguredTracer(Tracer):\n config = self" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL", "ensure_tuple(watch_extras)" ], [ "BINARY_OP", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_FROM_DICT_OR_DEREF", "self" ], [ "STORE_NAME", "config" ], [ "STORE_NAME", "config" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "STORE_FAST", "shape" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL", "inspect.ismethod(shape)" ], [ "LOAD_ATTR", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL", "len(value)" ], [ "STORE_FAST", "length" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_ATTR", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "STORE_FAST", "dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL", "inspect.ismethod(dtype)" ], [ "LOAD_ATTR", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL", "is_pathlike(output)" ], [ "STORE_FAST", "is_path" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "write" ], [ "LOAD_FAST", "write" ], [ "LOAD_FAST", " def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))" ], [ "STORE_FAST", " def write(s):\n stream = output\n\n if stream is None:\n stream = sys.stderr\n\n try:\n stream.write(s)\n except UnicodeEncodeError:\n # God damn Python 2\n stream.write(shitcode(s))" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "STORE_FAST", "stream" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL", "shitcode(s)" ], [ "CALL", "stream.write(shitcode(s))" ], [ "STORE_NAME", " def __init__(self, path, overwrite):\n self.path = six.text_type(path)\n self.overwrite = overwrite" ], [ "STORE_NAME", " def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "STORE_NAME", " def write(self, s):\n with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)\n self.overwrite = False" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL", "f.write(s)" ], [ "CALL", " with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f:\n f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.5.json000066400000000000000000000322601474076367500257520ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.GetStdHandle" ], [ "CALL_FUNCTION", "kernel32.GetStdHandle(-11)" ], [ "CALL_FUNCTION", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_FUNCTION", "inspect.ismethod(shape)" ], [ "LOAD_ATTR", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_ATTR", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_FUNCTION", "inspect.ismethod(dtype)" ], [ "LOAD_ATTR", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_FUNCTION", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.6.json000066400000000000000000000322661474076367500257610ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_ATTR", "kernel32.GetStdHandle" ], [ "CALL_FUNCTION", "kernel32.GetStdHandle(-11)" ], [ "CALL_FUNCTION", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_FUNCTION", "inspect.ismethod(shape)" ], [ "LOAD_ATTR", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_ATTR", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_FUNCTION", "inspect.ismethod(dtype)" ], [ "LOAD_ATTR", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_ATTR", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_FUNCTION", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.7.json000066400000000000000000000322661474076367500257620ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOAD_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOAD_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.8.json000066400000000000000000000322661474076367500257630ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOAD_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOAD_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-py-3.9.json000066400000000000000000000322471474076367500257630ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOAD_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION_KW", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "IS_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "IS_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOAD_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOAD_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOAD_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "IS_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOAD_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION_KW", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOAD_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-pypy-2.7.json000066400000000000000000000341361474076367500263300ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOOKUP_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOOKUP_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOOKUP_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOOKUP_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOOKUP_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-pypy-3.5.json000066400000000000000000000323101474076367500263170ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOOKUP_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOOKUP_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOOKUP_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOOKUP_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOOKUP_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/configuration-pypy-3.6.json000066400000000000000000000323101474076367500263200ustar00rootroot00000000000000[ [ "LOAD_NAME", "ctypes" ], [ "LOAD_ATTR", "ctypes.windll" ], [ "LOAD_ATTR", "ctypes.windll.kernel32" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.SetConsoleMode" ], [ "LOAD_NAME", "kernel32" ], [ "LOOKUP_METHOD", "kernel32.GetStdHandle" ], [ "CALL_METHOD", "kernel32.GetStdHandle(-11)" ], [ "CALL_METHOD", "kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7)" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.name" ], [ "COMPARE_OP", "os.name != 'nt'" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "builtins" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "snoop" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "CALL_FUNCTION", "setattr(builtins_module, snoop, package.snoop)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "pp" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "CALL_FUNCTION", "setattr(builtins_module, pp, package.pp)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_GLOBAL", "builtins_module" ], [ "LOAD_FAST", "spy" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "CALL_FUNCTION", "setattr(builtins_module, spy, package.spy)" ], [ "LOAD_GLOBAL", "Config" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "color" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "LOAD_FAST", "formatter_class" ], [ "CALL_FUNCTION", "Config(\n out=out,\n prefix=prefix,\n columns=columns,\n overwrite=overwrite,\n color=color,\n enabled=enabled,\n watch_extras=watch_extras,\n replace_watch_extras=replace_watch_extras,\n formatter_class=formatter_class,\n )" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.snoop" ], [ "STORE_ATTR", "package.snoop.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.pp" ], [ "STORE_ATTR", "package.pp.config" ], [ "LOAD_FAST", "config" ], [ "LOAD_GLOBAL", "package" ], [ "LOAD_ATTR", "package.spy" ], [ "STORE_ATTR", "package.spy.config" ], [ "LOAD_NAME", "DefaultFormatter" ], [ "LOAD_GLOBAL", "can_color" ], [ "LOAD_FAST", "color" ], [ "COMPARE_OP", "color is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "out" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "getattr(out or sys.stderr, 'isatty', lambda: False)" ], [ "LOAD_GLOBAL", "bool" ], [ "LOAD_FAST", "isatty" ], [ "CALL_FUNCTION", "isatty()" ], [ "CALL_FUNCTION", "bool(isatty())" ], [ "LOAD_GLOBAL", "get_write_function" ], [ "LOAD_FAST", "out" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "get_write_function(out, overwrite)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.write" ], [ "LOAD_FAST", "formatter_class" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "columns" ], [ "LOAD_FAST", "color" ], [ "CALL_FUNCTION", "formatter_class(prefix, columns, color)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.formatter" ], [ "LOAD_FAST", "enabled" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.enabled" ], [ "LOAD_GLOBAL", "PP" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "PP(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.pp" ], [ "LOAD_GLOBAL", "Tracer" ], [ "LOAD_FAST", "ConfiguredTracer" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.snoop" ], [ "LOAD_GLOBAL", "Spy" ], [ "LOAD_DEREF", "self" ], [ "CALL_FUNCTION", "Spy(self)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.spy" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.last_frame" ], [ "LOAD_GLOBAL", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.thread_local" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "COMPARE_OP", "replace_watch_extras is not None" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "replace_watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(replace_watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_GLOBAL", "len_shape_watch" ], [ "LOAD_GLOBAL", "dtype_watch" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "ensure_tuple(watch_extras)" ], [ "BINARY_ADD", "(len_shape_watch, dtype_watch) + ensure_tuple(watch_extras)" ], [ "LOAD_DEREF", "self" ], [ "STORE_ATTR", "self.watch_extras" ], [ "LOAD_CLASSDEREF", "self" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.shape" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "shape" ], [ "CALL_METHOD", "inspect.ismethod(shape)" ], [ "LOOKUP_METHOD", "'{}.shape'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.shape'.format(source)" ], [ "LOAD_FAST", "shape" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "QuerySet" ], [ "CALL_FUNCTION", "isinstance(value, QuerySet)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "len(value)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(value, six.string_types)" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length < 50" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "value" ], [ "LOAD_GLOBAL", "Mapping" ], [ "LOAD_GLOBAL", "Set" ], [ "LOAD_GLOBAL", "Sequence" ], [ "CALL_FUNCTION", "isinstance(value, (Mapping, Set, Sequence))" ], [ "LOAD_FAST", "length" ], [ "COMPARE_OP", "length == 0" ], [ "LOOKUP_METHOD", "'len({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'len({})'.format(source)" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "value" ], [ "LOAD_ATTR", "value.dtype" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.ismethod" ], [ "LOAD_FAST", "dtype" ], [ "CALL_METHOD", "inspect.ismethod(dtype)" ], [ "LOOKUP_METHOD", "'{}.dtype'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'{}.dtype'.format(source)" ], [ "LOAD_FAST", "dtype" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "output" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(output, six.string_types)" ], [ "LOAD_GLOBAL", "is_pathlike" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "is_pathlike(output)" ], [ "LOAD_FAST", "is_path" ], [ "LOAD_GLOBAL", "FileWriter" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "overwrite" ], [ "CALL_FUNCTION", "FileWriter(output, overwrite)" ], [ "LOAD_ATTR", "FileWriter(output, overwrite).write" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_DEREF", "output" ], [ "CALL_FUNCTION", "callable(output)" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "write" ], [ "LOAD_DEREF", "output" ], [ "LOAD_FAST", "stream" ], [ "COMPARE_OP", "stream is None" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "stream.write(s)" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_FAST", "stream" ], [ "LOOKUP_METHOD", "stream.write" ], [ "LOAD_GLOBAL", "shitcode" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "shitcode(s)" ], [ "CALL_METHOD", "stream.write(shitcode(s))" ], [ "LOAD_GLOBAL", "six" ], [ "LOOKUP_METHOD", "six.text_type" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "six.text_type(path)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.path" ], [ "LOAD_FAST", "overwrite" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.path" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.overwrite" ], [ "CALL_FUNCTION", "open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8')" ], [ "LOAD_FAST", "f" ], [ "LOOKUP_METHOD", "f.write" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "f.write(s)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.overwrite" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-2.7.json000066400000000000000000000000041474076367500246670ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-py-3.10.json000066400000000000000000007410371474076367500247640ustar00rootroot00000000000000[ [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[1:]" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_METHOD", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL_METHOD", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dim" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(401)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(101)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(5)" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_MULTIPLY", "4 * _DI100Y" ], [ "BINARY_ADD", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_MULTIPLY", "25 * _DI4Y" ], [ "BINARY_SUBTRACT", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "time" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "CALL_METHOD", "timezone._create(timedelta(0))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL_FUNCTION_KW", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x == y" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year - 1" ], [ "LOAD_FAST", "y" ], [ "BINARY_MULTIPLY", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//4" ], [ "BINARY_ADD", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//100" ], [ "BINARY_SUBTRACT", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//400" ], [ "BINARY_ADD", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_before_month(year, month)" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL_FUNCTION", "divmod(n, _DI400Y)" ], [ "LOAD_FAST", "n400" ], [ "BINARY_MULTIPLY", "n400 * 400" ], [ "BINARY_ADD", "n400 * 400 + 1" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL_FUNCTION", "divmod(n, _DI100Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL_FUNCTION", "divmod(n, _DI4Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "divmod(n, 365)" ], [ "LOAD_FAST", "n100" ], [ "BINARY_MULTIPLY", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_MULTIPLY", "n4 * 4" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4 + n1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n + 50" ], [ "BINARY_RSHIFT", "(n + 50) >> 5" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_ymd2ord(y, m, d)" ], [ "BINARY_ADD", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_MODULO", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "CALL_FUNCTION", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_ADD", "_days_before_month(y, m) + d" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "wday" ], [ "LOAD_FAST", "dnum" ], [ "LOAD_FAST", "dstflag" ], [ "CALL_METHOD", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('Unknown timespec value')" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_METHOD", "fmt.format" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "CALL_METHOD", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_FAST", "off" ], [ "IS_OP", "off is not None" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(off, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(mm, timedelta(minutes=1))" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "BINARY_MODULO", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_MODULO", "\":%02d\" % ss.seconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_MODULO", "'.%06d' % ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL_FUNCTION", "len(format)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "IS_OP", "freplace is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_MODULO", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL_METHOD", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "IS_OP", "zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.utcoffset" ], [ "CALL_METHOD", "object.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "IS_OP", "offset is not None" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(offset, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_MODULO", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "BINARY_MODULO", "'%c%02d%02d' % (sign, h, m)" ], [ "LOAD_FAST", "zreplace" ], [ "CONTAINS_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL_METHOD", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "IS_OP", "Zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.tzname" ], [ "CALL_METHOD", "object.tzname()" ], [ "LOAD_FAST", "s" ], [ "IS_OP", "s is not None" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace('%', '%%')" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL_METHOD", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_METHOD", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL_METHOD", "\"\".join(newformat)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.strftime" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_METHOD", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "CONTAINS_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "idx" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_MODULO", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "CONTAINS_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[0:4]" ], [ "CALL_FUNCTION", "int(dtstr[0:4])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_ADD", "4 + has_sep" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 1])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "weekno" ], [ "LOAD_FAST", "dayno" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL_FUNCTION", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(0, 3)" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+2" ], [ "BINARY_SUBSCR", "tstr[pos:pos+2]" ], [ "CALL_FUNCTION", "int(tstr[pos:pos+2])" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "comp" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+1" ], [ "BINARY_SUBSCR", "tstr[pos:pos+1]" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_MODULO", "\"Invalid time separator: %c\" % next_char" ], [ "CALL_FUNCTION", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "pos < len_str" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "CONTAINS_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[pos:(pos+to_parse)]" ], [ "CALL_FUNCTION", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_SUBTRACT", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[(pos+to_parse):]" ], [ "CALL_FUNCTION", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL_FUNCTION", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('-')" ], [ "BINARY_ADD", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('+')" ], [ "BINARY_ADD", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('Z')" ], [ "BINARY_ADD", "tstr.find('Z') + 1" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos-1" ], [ "BINARY_SUBSCR", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(timestr)" ], [ "LOAD_FAST", "tz_pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBSCR", "tstr[tz_pos:]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "len(tzstr)" ], [ "CONTAINS_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(tzstr)" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL_FUNCTION", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL_FUNCTION_KW", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_FAST", "tzsign" ], [ "LOAD_FAST", "td" ], [ "BINARY_MULTIPLY", "tzsign * td" ], [ "CALL_FUNCTION", "timezone(tzsign * td)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_METHOD", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL_METHOD", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "x" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "BINARY_MODULO", "_ymd2ord(year, 1, 1) % 7" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "week" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_SUBTRACT", "week - 1" ], [ "BINARY_MULTIPLY", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_SUBTRACT", "day - 1" ], [ "BINARY_ADD", "(week - 1) * 7 + (day - 1)" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_FAST", "day_1" ], [ "LOAD_FAST", "day_offset" ], [ "BINARY_ADD", "day_1 + day_offset" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL_FUNCTION", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "IS_OP", "name is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "type(name)" ], [ "BINARY_MODULO", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "CONTAINS_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "IS_OP", "offset is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "type(offset)" ], [ "BINARY_MODULO", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BINARY_MODULO", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL_FUNCTION", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_index(year)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_index(month)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_index(day)" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_MODULO", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "_index(hour)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "_index(minute)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "_index(second)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "_index(microsecond)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "CONTAINS_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BINARY_MODULO", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL_FUNCTION", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "divmod(a, b)" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r > b" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r < b" ], [ "LOAD_FAST", "greater_than_half" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_MODULO", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__mul__" ], [ "LOAD_FAST", "weeks" ], [ "BINARY_MULTIPLY", "weeks*7" ], [ "LOAD_FAST", "minutes" ], [ "BINARY_MULTIPLY", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_MULTIPLY", "hours*3600" ], [ "BINARY_ADD", "minutes*60 + hours*3600" ], [ "LOAD_FAST", "milliseconds" ], [ "BINARY_MULTIPLY", "milliseconds*1000" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL_METHOD", "_math.modf(days)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_MULTIPLY", "dayfrac * (24.*3600.)" ], [ "CALL_METHOD", "_math.modf(dayfrac * (24.*3600.))" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL_FUNCTION", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL_METHOD", "_math.modf(seconds)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_MULTIPLY", "secondsfrac * 1e6" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL_FUNCTION", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "int(microseconds)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "divmod(s, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_MODULO", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL_FUNCTION", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MODULO", "\"days=%d\" % self._days" ], [ "CALL_METHOD", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_MODULO", "\"seconds=%d\" % self._seconds" ], [ "CALL_METHOD", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\"microseconds=%d\" % self._microseconds" ], [ "CALL_METHOD", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "CALL_METHOD", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL_METHOD", "', '.join(args)" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL_FUNCTION", "divmod(self._seconds, 60)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL_FUNCTION", "divmod(mm, 60)" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "BINARY_MODULO", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL_FUNCTION", "plural(self._days)" ], [ "BINARY_MODULO", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_ADD", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\".%06d\" % self._microseconds" ], [ "BINARY_ADD", "s + \".%06d\" % self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_MULTIPLY", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_ADD", "self.days * 86400 + self.seconds" ], [ "BINARY_MULTIPLY", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_ADD", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_TRUE_DIVIDE", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_ADD", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_ADD", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_ADD", "self._microseconds + other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_SUBTRACT", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_SUBTRACT", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_SUBTRACT", "self._microseconds - other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_ADD", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL_FUNCTION", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._microseconds * other" ], [ "CALL_FUNCTION", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "a" ], [ "BINARY_MULTIPLY", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "_divide_and_round(usec * a, b)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MULTIPLY", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_ADD", "self._days * (24*3600) + self._seconds" ], [ "BINARY_MULTIPLY", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_ADD", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_FLOOR_DIVIDE", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "BINARY_FLOOR_DIVIDE", "usec // other" ], [ "CALL_FUNCTION", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_TRUE_DIVIDE", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_divide_and_round(usec, other)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "b" ], [ "LOAD_FAST", "usec" ], [ "BINARY_MULTIPLY", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL_FUNCTION", "_divide_and_round(b * usec, a)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_MODULO", "self._to_microseconds() % other._to_microseconds()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "CALL_FUNCTION", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._getstate" ], [ "CALL_METHOD", "other._getstate()" ], [ "CALL_FUNCTION", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_METHOD", "year.encode" ], [ "CALL_METHOD", "year.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL_METHOD", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_time.localtime(t)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "_ord2ymd(n)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "CONTAINS_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.timetuple" ], [ "CALL_METHOD", "self.timetuple()" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "IS_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "IS_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "y2" ], [ "LOAD_FAST", "m2" ], [ "LOAD_FAST", "d2" ], [ "CALL_FUNCTION", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_ADD", "self.toordinal() + other.days" ], [ "LOAD_FAST", "o" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL_METHOD", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL_FUNCTION", "timedelta(-other.days)" ], [ "BINARY_ADD", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "CALL_FUNCTION", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_ADD", "self.toordinal() + 6" ], [ "BINARY_MODULO", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_ADD", "year+1" ], [ "CALL_FUNCTION", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "BINARY_ADD", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "day+1" ], [ "CALL_FUNCTION", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.utcoffset" ], [ "CALL_METHOD", "dt.utcoffset()" ], [ "LOAD_FAST", "dtoff" ], [ "IS_OP", "dtoff is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "IS_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_SUBTRACT", "dtoff - dtdst" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "IS_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_ADD", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "getattr(self, \"__getinitargs__\", None)" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL_FUNCTION", "getinitargs()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__getstate__" ], [ "CALL_METHOD", "self.__getstate__()" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_GLOBAL", "super" ], [ "CALL_FUNCTION", "super()" ], [ "LOAD_METHOD", "super().__new__" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "weekday" ], [ "CALL_METHOD", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "tuple(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__name__" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SUBSCR", "hour[0:1]" ], [ "CALL_FUNCTION", "ord(hour[0:1])" ], [ "BINARY_AND", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_METHOD", "hour.encode" ], [ "CALL_METHOD", "hour.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "CALL_METHOD", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_ADD", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "myoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_ADD", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "otoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "myhhmm" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "othhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL_FUNCTION_KW", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_MODULO", "m % timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "LOAD_FAST", "h" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "time(h, m, self.second, self.microsecond)" ], [ "CALL_FUNCTION", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_MODULO", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_MODULO", "\", %d\" % self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._tzstr" ], [ "CALL_METHOD", "self._tzstr()" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_METHOD", "time_string.removeprefix" ], [ "CALL_METHOD", "time_string.removeprefix('T')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL_FUNCTION", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "time_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "CALL_METHOD", "self._tzinfo.tzname(None)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "CALL_METHOD", "self._tzinfo.dst(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "IS_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "IS_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "IS_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "IS_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "IS_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_SUBTRACT", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_ADD", "date.__slots__ + time.__slots__" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "BINARY_AND", "ord(year[2:3])&0x7F" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "bytes(year, 'latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_METHOD", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_math.modf(t)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_MULTIPLY", "frac * 1e6" ], [ "CALL_FUNCTION", "round(frac * 1e6)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "converter(t)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "min(ss, 59)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is None" ], [ "LOAD_FAST", "utc" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_METHOD", "sys.platform.startswith" ], [ "CALL_METHOD", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_SUBTRACT", "t - max_fold_seconds" ], [ "CALL_FUNCTION", "converter(t - max_fold_seconds)" ], [ "BINARY_SUBSCR", "converter(t - max_fold_seconds)[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_SUBTRACT", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL_FUNCTION", "timedelta(0, max_fold_seconds)" ], [ "BINARY_SUBTRACT", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "trans // timedelta(0, 1)" ], [ "BINARY_ADD", "t + trans // timedelta(0, 1)" ], [ "CALL_FUNCTION", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SUBSCR", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL_METHOD", "tz.fromutc(result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL_FUNCTION", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL_FUNCTION", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL_FUNCTION_KW", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_find_isoformat_datetime_separator(date_string)" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SUBSCR", "date_string[0:separator_location]" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_ADD", "separator_location+1" ], [ "BINARY_SUBSCR", "date_string[(separator_location+1):]" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL_FUNCTION", "_parse_isoformat_date(dstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "_parse_isoformat_time(tstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_components" ], [ "LOAD_FAST", "time_components" ], [ "BINARY_ADD", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.dst" ], [ "CALL_METHOD", "self.dst()" ], [ "LOAD_FAST", "dst" ], [ "IS_OP", "dst is None" ], [ "LOAD_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL_FUNCTION", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "datetime(1970, 1, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBTRACT", "local(t) - t" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "a" ], [ "BINARY_SUBTRACT", "t - a" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL_FUNCTION", "local(u1)" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_ADD", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_SUBTRACT", "local(u2) - u2" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "u1" ], [ "BINARY_SUBTRACT", "t1 - u1" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBTRACT", "t - b" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "t2" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL_METHOD", "_time.localtime(u)" ], [ "BINARY_SUBSCR", "_time.localtime(u)[:6]" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_TRUE_DIVIDE", "self.microsecond / 1e6" ], [ "BINARY_ADD", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_METHOD", "(self - _EPOCH).total_seconds" ], [ "CALL_METHOD", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "IS_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "day" ], [ "IS_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "hour" ], [ "IS_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "IS_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "IS_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "IS_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "IS_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "IS_OP", "self.tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL_METHOD", "_time.localtime(ts)" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SUBSCR", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL_FUNCTION", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "mytz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "myoffset" ], [ "IS_OP", "myoffset is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(tzinfo=None)" ], [ "LOAD_METHOD", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL_METHOD", "self.replace(tzinfo=None)._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "myoffset" ], [ "BINARY_SUBTRACT", "self - myoffset" ], [ "LOAD_ATTR", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION_KW", "(self - myoffset).replace(tzinfo=tz)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL_METHOD", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_ADD", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL_FUNCTION", "map(str, L)" ], [ "CALL_METHOD", "\", \".join(map(str, L))" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.isoformat" ], [ "CALL_FUNCTION_KW", "self.isoformat(sep=' ')" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_METHOD", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "format" ], [ "CALL_METHOD", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.tzname(self)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.dst(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL_FUNCTION_KW", "self.replace(fold=not self.fold)" ], [ "LOAD_METHOD", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL_METHOD", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL_FUNCTION_KW", "other.replace(fold=not other.fold)" ], [ "LOAD_METHOD", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL_METHOD", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "BINARY_SUBTRACT", "self - other" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION_KW", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL_FUNCTION", "divmod(delta.seconds, 3600)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL_FUNCTION", "divmod(rem, 60)" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_METHOD", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL_METHOD", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL_FUNCTION_KW", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL_METHOD", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_ADD", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_MULTIPLY", "self._minute * 60" ], [ "BINARY_ADD", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 3600" ], [ "BINARY_ADD", "self._second + self._minute * 60 + self._hour * 3600" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_MULTIPLY", "other._minute * 60" ], [ "BINARY_ADD", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 3600" ], [ "BINARY_ADD", "other._second + other._minute * 60 + other._hour * 3600" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "LOAD_FAST", "secs1" ], [ "LOAD_FAST", "secs2" ], [ "BINARY_SUBTRACT", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_SUBTRACT", "self._microsecond - other._microsecond" ], [ "CALL_FUNCTION", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "IS_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "otoff" ], [ "BINARY_ADD", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_SUBTRACT", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "IS_OP", "tzoff is None" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL_FUNCTION", "_ymd2ord(self.year, self.month, self.day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_MULTIPLY", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_MULTIPLY", "self.minute * 60" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL_FUNCTION", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_SUBTRACT", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_ADD", "firstday + 6" ], [ "BINARY_MODULO", "(firstday + 6) % 7" ], [ "LOAD_FAST", "firstday" ], [ "LOAD_FAST", "firstweekday" ], [ "BINARY_SUBTRACT", "firstday - firstweekday" ], [ "LOAD_FAST", "firstweekday" ], [ "LOAD_FAST", "THURSDAY" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "object()" ], [ "LOAD_NAME", "_Omitted" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=24, microseconds=-1)" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "IS_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._create" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_METHOD", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "tzinfo.__new__(cls)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL_FUNCTION", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_FUNCTION", "hash(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utc" ], [ "IS_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_MODULO", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BINARY_MODULO", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.tzname" ], [ "CALL_METHOD", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_METHOD", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_ADD", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(delta, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-3.11.json000066400000000000000000016665521474076367500247760ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"Concrete date/time and related types.\n\nSee http://www.iana.org/time-zones/repository/tz-link.html for\ntime zone and DST data sources.\n\"\"\"" ], [ "STORE_NAME", "__all__" ], [ "STORE_NAME", "import time as _time" ], [ "STORE_NAME", "import math as _math" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from operator import index as _index" ], [ "STORE_NAME", "def _cmp(x, y):\n return 0 if x == y else 1 if x > y else -1" ], [ "STORE_NAME", "MINYEAR" ], [ "STORE_NAME", "MAXYEAR" ], [ "STORE_NAME", "_MAXORDINAL" ], [ "STORE_NAME", "_DAYS_IN_MONTH" ], [ "STORE_NAME", "_DAYS_BEFORE_MONTH" ], [ "STORE_NAME", "dbm" ], [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[1:]" ], [ "STORE_NAME", "dim" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_METHOD", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dbm" ], [ "LOAD_NAME", "dim" ], [ "BINARY_OP", "dbm += dim" ], [ "STORE_NAME", "dbm" ], [ "DELETE_NAME", "dbm" ], [ "DELETE_NAME", "dim" ], [ "STORE_NAME", "def _is_leap(year):\n \"year -> 1 if leap year, else 0.\"\n return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)" ], [ "STORE_NAME", "def _days_before_year(year):\n \"year -> number of days before January 1st of year.\"\n y = year - 1\n return y*365 + y//4 - y//100 + y//400" ], [ "STORE_NAME", "def _days_in_month(year, month):\n \"year, month -> number of days in that month in that year.\"\n assert 1 <= month <= 12, month\n if month == 2 and _is_leap(year):\n return 29\n return _DAYS_IN_MONTH[month]" ], [ "STORE_NAME", "def _days_before_month(year, month):\n \"year, month -> number of days in year preceding first day of month.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "STORE_NAME", "def _ymd2ord(year, month, day):\n \"year, month, day -> ordinal, considering 01-Jan-0001 as day 1.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n dim = _days_in_month(year, month)\n assert 1 <= day <= dim, ('day must be in 1..%d' % dim)\n return (_days_before_year(year) +\n _days_before_month(year, month) +\n day)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(401)" ], [ "STORE_NAME", "_DI400Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(101)" ], [ "STORE_NAME", "_DI100Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(5)" ], [ "STORE_NAME", "_DI4Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_OP", "4 * _DI100Y" ], [ "BINARY_OP", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_OP", "25 * _DI4Y" ], [ "BINARY_OP", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "STORE_NAME", "def _ord2ymd(n):\n \"ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.\"\n\n # n is a 1-based index, starting at 1-Jan-1. The pattern of leap years\n # repeats exactly every 400 years. The basic strategy is to find the\n # closest 400-year boundary at or before n, then work with the offset\n # from that boundary to n. Life is much clearer if we subtract 1 from\n # n first -- then the values of n at 400-year boundaries are exactly\n # those divisible by _DI400Y:\n #\n # D M Y n n-1\n # -- --- ---- ---------- ----------------\n # 31 Dec -400 -_DI400Y -_DI400Y -1\n # 1 Jan -399 -_DI400Y +1 -_DI400Y 400-year boundary\n # ...\n # 30 Dec 000 -1 -2\n # 31 Dec 000 0 -1\n # 1 Jan 001 1 0 400-year boundary\n # 2 Jan 001 2 1\n # 3 Jan 001 3 2\n # ...\n # 31 Dec 400 _DI400Y _DI400Y -1\n # 1 Jan 401 _DI400Y +1 _DI400Y 400-year boundary\n n -= 1\n n400, n = divmod(n, _DI400Y)\n year = n400 * 400 + 1 # ..., -399, 1, 401, ...\n\n # Now n is the (non-negative) offset, in days, from January 1 of year, to\n # the desired date. Now compute how many 100-year cycles precede n.\n # Note that it's possible for n100 to equal 4! In that case 4 full\n # 100-year cycles precede the desired day, which implies the desired\n # day is December 31 at the end of a 400-year cycle.\n n100, n = divmod(n, _DI100Y)\n\n # Now compute how many 4-year cycles precede it.\n n4, n = divmod(n, _DI4Y)\n\n # And now how many single years. Again n1 can be 4, and again meaning\n # that the desired day is December 31 at the end of the 4-year cycle.\n n1, n = divmod(n, 365)\n\n year += n100 * 100 + n4 * 4 + n1\n if n1 == 4 or n100 == 4:\n assert n == 0\n return year-1, 12, 31\n\n # Now the year is correct, and n is the offset from January 1. We find\n # the month via an estimate that's either exact or one too large.\n leapyear = n1 == 3 and (n4 != 24 or n100 == 3)\n assert leapyear == _is_leap(year)\n month = (n + 50) >> 5\n preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)\n if preceding > n: # estimate is too large\n month -= 1\n preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)\n n -= preceding\n assert 0 <= n < _days_in_month(year, month)\n\n # Now the year and month are correct, and n is the offset from the\n # start of that month: we're done!\n return year, month, n+1" ], [ "STORE_NAME", "_MONTHNAMES" ], [ "STORE_NAME", "_DAYNAMES" ], [ "STORE_NAME", "def _build_struct_time(y, m, d, hh, mm, ss, dstflag):\n wday = (_ymd2ord(y, m, d) + 6) % 7\n dnum = _days_before_month(y, m) + d\n return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_NAME", "def _format_time(hh, mm, ss, us, timespec='auto'):\n specs = {\n 'hours': '{:02d}',\n 'minutes': '{:02d}:{:02d}',\n 'seconds': '{:02d}:{:02d}:{:02d}',\n 'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}',\n 'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}'\n }\n\n if timespec == 'auto':\n # Skip trailing microseconds when us==0.\n timespec = 'microseconds' if us else 'seconds'\n elif timespec == 'milliseconds':\n us //= 1000\n try:\n fmt = specs[timespec]\n except KeyError:\n raise ValueError('Unknown timespec value')\n else:\n return fmt.format(hh, mm, ss, us)" ], [ "STORE_NAME", "def _format_offset(off):\n s = ''\n if off is not None:\n if off.days < 0:\n sign = \"-\"\n off = -off\n else:\n sign = \"+\"\n hh, mm = divmod(off, timedelta(hours=1))\n mm, ss = divmod(mm, timedelta(minutes=1))\n s += \"%s%02d:%02d\" % (sign, hh, mm)\n if ss or ss.microseconds:\n s += \":%02d\" % ss.seconds\n\n if ss.microseconds:\n s += '.%06d' % ss.microseconds\n return s" ], [ "STORE_NAME", "def _wrap_strftime(object, format, timetuple):\n # Don't call utcoffset() or tzname() unless actually needed.\n freplace = None # the string to use for %f\n zreplace = None # the string to use for %z\n Zreplace = None # the string to use for %Z\n\n # Scan format for %z and %Z escapes, replacing as needed.\n newformat = []\n push = newformat.append\n i, n = 0, len(format)\n while i < n:\n ch = format[i]\n i += 1\n if ch == '%':\n if i < n:\n ch = format[i]\n i += 1\n if ch == 'f':\n if freplace is None:\n freplace = '%06d' % getattr(object,\n 'microsecond', 0)\n newformat.append(freplace)\n elif ch == 'z':\n if zreplace is None:\n zreplace = \"\"\n if hasattr(object, \"utcoffset\"):\n offset = object.utcoffset()\n if offset is not None:\n sign = '+'\n if offset.days < 0:\n offset = -offset\n sign = '-'\n h, rest = divmod(offset, timedelta(hours=1))\n m, rest = divmod(rest, timedelta(minutes=1))\n s = rest.seconds\n u = offset.microseconds\n if u:\n zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u)\n elif s:\n zreplace = '%c%02d%02d%02d' % (sign, h, m, s)\n else:\n zreplace = '%c%02d%02d' % (sign, h, m)\n assert '%' not in zreplace\n newformat.append(zreplace)\n elif ch == 'Z':\n if Zreplace is None:\n Zreplace = \"\"\n if hasattr(object, \"tzname\"):\n s = object.tzname()\n if s is not None:\n # strftime is going to have at this: escape %\n Zreplace = s.replace('%', '%%')\n newformat.append(Zreplace)\n else:\n push('%')\n push(ch)\n else:\n push('%')\n else:\n push(ch)\n newformat = \"\".join(newformat)\n return _time.strftime(newformat, timetuple)" ], [ "STORE_NAME", "def _is_ascii_digit(c):\n return c in \"0123456789\"" ], [ "STORE_NAME", "def _find_isoformat_datetime_separator(dtstr):\n # See the comment in _datetimemodule.c:_find_isoformat_datetime_separator\n len_dtstr = len(dtstr)\n if len_dtstr == 7:\n return 7\n\n assert len_dtstr > 7\n date_separator = \"-\"\n week_indicator = \"W\"\n\n if dtstr[4] == date_separator:\n if dtstr[5] == week_indicator:\n if len_dtstr < 8:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 8 and dtstr[8] == date_separator:\n if len_dtstr == 9:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 10 and _is_ascii_digit(dtstr[10]):\n # This is as far as we need to resolve the ambiguity for\n # the moment - if we have YYYY-Www-##, the separator is\n # either a hyphen at 8 or a number at 10.\n #\n # We'll assume it's a hyphen at 8 because it's way more\n # likely that someone will use a hyphen as a separator than\n # a number, but at this point it's really best effort\n # because this is an extension of the spec anyway.\n # TODO(pganssle): Document this\n return 8\n return 10\n else:\n # YYYY-Www (8)\n return 8\n else:\n # YYYY-MM-DD (10)\n return 10\n else:\n if dtstr[4] == week_indicator:\n # YYYYWww (7) or YYYYWwwd (8)\n idx = 7\n while idx < len_dtstr:\n if not _is_ascii_digit(dtstr[idx]):\n break\n idx += 1\n\n if idx < 9:\n return idx\n\n if idx % 2 == 0:\n # If the index of the last number is even, it's YYYYWwwd\n return 7\n else:\n return 8\n else:\n # YYYYMMDD (8)\n return 8" ], [ "STORE_NAME", "def _parse_isoformat_date(dtstr):\n # It is assumed that this is an ASCII-only string of lengths 7, 8 or 10,\n # see the comment on Modules/_datetimemodule.c:_find_isoformat_datetime_separator\n assert len(dtstr) in (7, 8, 10)\n year = int(dtstr[0:4])\n has_sep = dtstr[4] == '-'\n\n pos = 4 + has_sep\n if dtstr[pos:pos + 1] == \"W\":\n # YYYY-?Www-?D?\n pos += 1\n weekno = int(dtstr[pos:pos + 2])\n pos += 2\n\n dayno = 1\n if len(dtstr) > pos:\n if (dtstr[pos:pos + 1] == '-') != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n\n dayno = int(dtstr[pos:pos + 1])\n\n return list(_isoweek_to_gregorian(year, weekno, dayno))\n else:\n month = int(dtstr[pos:pos + 2])\n pos += 2\n if (dtstr[pos:pos + 1] == \"-\") != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n day = int(dtstr[pos:pos + 2])\n\n return [year, month, day]" ], [ "STORE_NAME", "_FRACTION_CORRECTION" ], [ "STORE_NAME", "def _parse_hh_mm_ss_ff(tstr):\n # Parses things of the form HH[:?MM[:?SS[{.,}fff[fff]]]]\n len_str = len(tstr)\n\n time_comps = [0, 0, 0, 0]\n pos = 0\n for comp in range(0, 3):\n if (len_str - pos) < 2:\n raise ValueError(\"Incomplete time component\")\n\n time_comps[comp] = int(tstr[pos:pos+2])\n\n pos += 2\n next_char = tstr[pos:pos+1]\n\n if comp == 0:\n has_sep = next_char == ':'\n\n if not next_char or comp >= 2:\n break\n\n if has_sep and next_char != ':':\n raise ValueError(\"Invalid time separator: %c\" % next_char)\n\n pos += has_sep\n\n if pos < len_str:\n if tstr[pos] not in '.,':\n raise ValueError(\"Invalid microsecond component\")\n else:\n pos += 1\n\n len_remainder = len_str - pos\n\n if len_remainder >= 6:\n to_parse = 6\n else:\n to_parse = len_remainder\n\n time_comps[3] = int(tstr[pos:(pos+to_parse)])\n if to_parse < 6:\n time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]\n if (len_remainder > to_parse\n and not all(map(_is_ascii_digit, tstr[(pos+to_parse):]))):\n raise ValueError(\"Non-digit values in unparsed fraction\")\n\n return time_comps" ], [ "STORE_NAME", "def _parse_isoformat_time(tstr):\n # Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]\n len_str = len(tstr)\n if len_str < 2:\n raise ValueError(\"Isoformat time too short\")\n\n # This is equivalent to re.search('[+-Z]', tstr), but faster\n tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1 or tstr.find('Z') + 1)\n timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr\n\n time_comps = _parse_hh_mm_ss_ff(timestr)\n\n tzi = None\n if tz_pos == len_str and tstr[-1] == 'Z':\n tzi = timezone.utc\n elif tz_pos > 0:\n tzstr = tstr[tz_pos:]\n\n # Valid time zone strings are:\n # HH len: 2\n # HHMM len: 4\n # HH:MM len: 5\n # HHMMSS len: 6\n # HHMMSS.f+ len: 7+\n # HH:MM:SS len: 8\n # HH:MM:SS.f+ len: 10+\n\n if len(tzstr) in (0, 1, 3):\n raise ValueError(\"Malformed time zone string\")\n\n tz_comps = _parse_hh_mm_ss_ff(tzstr)\n\n if all(x == 0 for x in tz_comps):\n tzi = timezone.utc\n else:\n tzsign = -1 if tstr[tz_pos - 1] == '-' else 1\n\n td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])\n\n tzi = timezone(tzsign * td)\n\n time_comps.append(tzi)\n\n return time_comps" ], [ "STORE_NAME", "def _isoweek_to_gregorian(year, week, day):\n # Year is bounded this way because 9999-12-31 is (9999, 52, 5)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError(f\"Year is out of range: {year}\")\n\n if not 0 < week < 53:\n out_of_range = True\n\n if week == 53:\n # ISO years have 53 weeks in them on years starting with a\n # Thursday and leap years starting on a Wednesday\n first_weekday = _ymd2ord(year, 1, 1) % 7\n if (first_weekday == 4 or (first_weekday == 3 and\n _is_leap(year))):\n out_of_range = False\n\n if out_of_range:\n raise ValueError(f\"Invalid week: {week}\")\n\n if not 0 < day < 8:\n raise ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")\n\n # Now compute the offset from (Y, 1, 1) in days:\n day_offset = (week - 1) * 7 + (day - 1)\n\n # Calculate the ordinal day for monday, week 1\n day_1 = _isoweek1monday(year)\n ord_day = day_1 + day_offset\n\n return _ord2ymd(ord_day)" ], [ "STORE_NAME", "def _check_tzname(name):\n if name is not None and not isinstance(name, str):\n raise TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "STORE_NAME", "def _check_utc_offset(name, offset):\n assert name in (\"utcoffset\", \"dst\")\n if offset is None:\n return\n if not isinstance(offset, timedelta):\n raise TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))\n if not -timedelta(1) < offset < timedelta(1):\n raise ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "STORE_NAME", "def _check_date_fields(year, month, day):\n year = _index(year)\n month = _index(month)\n day = _index(day)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)\n if not 1 <= month <= 12:\n raise ValueError('month must be in 1..12', month)\n dim = _days_in_month(year, month)\n if not 1 <= day <= dim:\n raise ValueError('day must be in 1..%d' % dim, day)\n return year, month, day" ], [ "STORE_NAME", "def _check_time_fields(hour, minute, second, microsecond, fold):\n hour = _index(hour)\n minute = _index(minute)\n second = _index(second)\n microsecond = _index(microsecond)\n if not 0 <= hour <= 23:\n raise ValueError('hour must be in 0..23', hour)\n if not 0 <= minute <= 59:\n raise ValueError('minute must be in 0..59', minute)\n if not 0 <= second <= 59:\n raise ValueError('second must be in 0..59', second)\n if not 0 <= microsecond <= 999999:\n raise ValueError('microsecond must be in 0..999999', microsecond)\n if fold not in (0, 1):\n raise ValueError('fold must be either 0 or 1', fold)\n return hour, minute, second, microsecond, fold" ], [ "STORE_NAME", "def _check_tzinfo_arg(tz):\n if tz is not None and not isinstance(tz, tzinfo):\n raise TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "STORE_NAME", "def _cmperror(x, y):\n raise TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "STORE_NAME", "def _divide_and_round(a, b):\n \"\"\"divide a by b and round result to the nearest integer\n\n When the ratio is exactly half-way between two integers,\n the even integer is returned.\n \"\"\"\n # Based on the reference implementation for divmod_near\n # in Objects/longobject.c.\n q, r = divmod(a, b)\n # round up if either r / b > 0.5, or r / b == 0.5 and q is odd.\n # The expression r / b > 0.5 is equivalent to 2 * r > b if b is\n # positive, 2 * r < b if b negative.\n r *= 2\n greater_than_half = r > b if b > 0 else r < b\n if greater_than_half or r == b and q % 2 == 1:\n q += 1\n\n return q" ], [ "CALL", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "CALL", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "date" ], [ "STORE_NAME", "_date_class" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "CALL", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "STORE_NAME", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_NAME", "tuple" ], [ "CALL", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "STORE_NAME", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "STORE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "STORE_NAME", "_tzinfo_class" ], [ "CALL", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "time" ], [ "STORE_NAME", "_time_class" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "CALL", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "STORE_NAME", "def _isoweek1monday(year):\n # Helper to calculate the day number of the Monday starting week 1\n # XXX This could be done more efficiently\n THURSDAY = 3\n firstday = _ymd2ord(year, 1, 1)\n firstweekday = (firstday + 6) % 7 # See weekday() above\n week1monday = firstday - firstweekday\n if firstweekday > THURSDAY:\n week1monday += 7\n return week1monday" ], [ "LOAD_NAME", "tzinfo" ], [ "CALL", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "STORE_NAME", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "CALL", "timezone._create(timedelta(0))" ], [ "STORE_NAME", "UTC" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "STORE_NAME", "_EPOCH" ], [ "DELETE_NAME", "_DAYNAMES" ], [ "DELETE_NAME", "_DAYS_BEFORE_MONTH" ], [ "DELETE_NAME", "_DAYS_IN_MONTH" ], [ "DELETE_NAME", "_DI100Y" ], [ "DELETE_NAME", "_DI400Y" ], [ "DELETE_NAME", "_DI4Y" ], [ "DELETE_NAME", "_EPOCH" ], [ "DELETE_NAME", "_MAXORDINAL" ], [ "DELETE_NAME", "_MONTHNAMES" ], [ "DELETE_NAME", "_build_struct_time" ], [ "DELETE_NAME", "_check_date_fields" ], [ "DELETE_NAME", "_check_time_fields" ], [ "DELETE_NAME", "_check_tzinfo_arg" ], [ "DELETE_NAME", "_check_tzname" ], [ "DELETE_NAME", "_check_utc_offset" ], [ "DELETE_NAME", "_cmp" ], [ "DELETE_NAME", "_cmperror" ], [ "DELETE_NAME", "_date_class" ], [ "DELETE_NAME", "_days_before_month" ], [ "DELETE_NAME", "_days_before_year" ], [ "DELETE_NAME", "_days_in_month" ], [ "DELETE_NAME", "_format_time" ], [ "DELETE_NAME", "_format_offset" ], [ "DELETE_NAME", "_index" ], [ "DELETE_NAME", "_is_leap" ], [ "DELETE_NAME", "_isoweek1monday" ], [ "DELETE_NAME", "_math" ], [ "DELETE_NAME", "_ord2ymd" ], [ "DELETE_NAME", "_time" ], [ "DELETE_NAME", "_time_class" ], [ "DELETE_NAME", "_tzinfo_class" ], [ "DELETE_NAME", "_wrap_strftime" ], [ "DELETE_NAME", "_ymd2ord" ], [ "DELETE_NAME", "_divide_and_round" ], [ "DELETE_NAME", "_parse_isoformat_date" ], [ "DELETE_NAME", "_parse_isoformat_time" ], [ "DELETE_NAME", "_parse_hh_mm_ss_ff" ], [ "DELETE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "_isoweek_to_gregorian" ], [ "DELETE_NAME", "_find_isoformat_datetime_separator" ], [ "DELETE_NAME", "_FRACTION_CORRECTION" ], [ "DELETE_NAME", "_is_ascii_digit" ], [ "STORE_NAME", "from _datetime import __doc__" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x == y" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year - 1" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//4" ], [ "BINARY_OP", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//100" ], [ "BINARY_OP", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//400" ], [ "BINARY_OP", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_before_month(year, month)" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n -= 1" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL", "divmod(n, _DI400Y)" ], [ "STORE_FAST", "n400" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n400" ], [ "BINARY_OP", "n400 * 400" ], [ "BINARY_OP", "n400 * 400 + 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL", "divmod(n, _DI100Y)" ], [ "STORE_FAST", "n100" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL", "divmod(n, _DI4Y)" ], [ "STORE_FAST", "n4" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL", "divmod(n, 365)" ], [ "STORE_FAST", "n1" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "n100" ], [ "BINARY_OP", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_OP", "n4 * 4" ], [ "BINARY_OP", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_OP", "n100 * 100 + n4 * 4 + n1" ], [ "BINARY_OP", "year += n100 * 100 + n4 * 4 + n1" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "STORE_FAST", "leapyear" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n + 50" ], [ "BINARY_OP", "(n + 50) >> 5" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_FAST", "month" ], [ "BINARY_OP", "month -= 1" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "BINARY_OP", "preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "preceding" ], [ "BINARY_OP", "n -= preceding" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "_ymd2ord(y, m, d)" ], [ "BINARY_OP", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_OP", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "STORE_FAST", "wday" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "CALL", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "_days_before_month(y, m) + d" ], [ "STORE_FAST", "dnum" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "wday" ], [ "LOAD_FAST", "dnum" ], [ "LOAD_FAST", "dstflag" ], [ "CALL", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "STORE_FAST", "timespec" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us //= 1000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "STORE_FAST", "fmt" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_METHOD", "fmt.format" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "CALL", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('Unknown timespec value')" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "off" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "STORE_FAST", "off" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(off, timedelta(hours=1))" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(mm, timedelta(minutes=1))" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "BINARY_OP", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "BINARY_OP", "s += \"%s%02d:%02d\" % (sign, hh, mm)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_OP", "\":%02d\" % ss.seconds" ], [ "BINARY_OP", "s += \":%02d\" % ss.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_OP", "'.%06d' % ss.microseconds" ], [ "BINARY_OP", "s += '.%06d' % ss.microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "STORE_FAST", "freplace" ], [ "STORE_FAST", "zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "STORE_FAST", "newformat" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "STORE_FAST", "push" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL", "len(format)" ], [ "STORE_FAST", "n" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_OP", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "STORE_FAST", "freplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.utcoffset" ], [ "CALL", "object.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "STORE_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(offset, timedelta(hours=1))" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "rest" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "rest" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "STORE_FAST", "u" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_OP", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "'%c%02d%02d' % (sign, h, m)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "zreplace" ], [ "CONTAINS_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.tzname" ], [ "CALL", "object.tzname()" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL", "s.replace('%', '%%')" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_METHOD", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL", "\"\".join(newformat)" ], [ "STORE_FAST", "newformat" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.strftime" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_FAST", "timetuple" ], [ "CALL", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "CONTAINS_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "STORE_FAST", "len_dtstr" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "STORE_FAST", "date_separator" ], [ "STORE_FAST", "week_indicator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "STORE_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "idx" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx += 1" ], [ "STORE_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "CONTAINS_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[0:4]" ], [ "CALL", "int(dtstr[0:4])" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "4 + has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "weekno" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "CALL", "int(dtstr[pos:pos + 1])" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "weekno" ], [ "LOAD_FAST", "dayno" ], [ "CALL", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(0, 3)" ], [ "STORE_FAST", "comp" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+2" ], [ "BINARY_SUBSCR", "tstr[pos:pos+2]" ], [ "CALL", "int(tstr[pos:pos+2])" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "comp" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+1" ], [ "BINARY_SUBSCR", "tstr[pos:pos+1]" ], [ "STORE_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_OP", "\"Invalid time separator: %c\" % next_char" ], [ "CALL", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "pos < len_str" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "CONTAINS_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "len_str - pos" ], [ "STORE_FAST", "len_remainder" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_FAST", "len_remainder" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[pos:(pos+to_parse)]" ], [ "CALL", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "BINARY_SUBSCR", "time_comps[3]" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "BINARY_OP", "time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[(pos+to_parse):]" ], [ "CALL", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL", "tstr.find('-')" ], [ "BINARY_OP", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL", "tstr.find('+')" ], [ "BINARY_OP", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL", "tstr.find('Z')" ], [ "BINARY_OP", "tstr.find('Z') + 1" ], [ "STORE_FAST", "tz_pos" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_OP", "tz_pos-1" ], [ "BINARY_SUBSCR", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "STORE_FAST", "timestr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL", "_parse_hh_mm_ss_ff(timestr)" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tz_pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBSCR", "tstr[tz_pos:]" ], [ "STORE_FAST", "tzstr" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "len(tzstr)" ], [ "CONTAINS_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "_parse_hh_mm_ss_ff(tzstr)" ], [ "STORE_FAST", "tz_comps" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL", "(x == 0 for x in tz_comps)" ], [ "CALL", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_OP", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "STORE_FAST", "tzsign" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "STORE_FAST", "td" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_FAST", "tzsign" ], [ "LOAD_FAST", "td" ], [ "BINARY_OP", "tzsign * td" ], [ "CALL", "timezone(tzsign * td)" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_METHOD", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "(x == 0 for x in tz_comps)" ], [ "STORE_FAST", "x" ], [ "LOAD_FAST", "x" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "year" ], [ "CALL", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "0 < week < 53" ], [ "COMPARE_OP", "0 < week < 53" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "BINARY_OP", "_ymd2ord(year, 1, 1) % 7" ], [ "STORE_FAST", "first_weekday" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "week" ], [ "CALL", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "0 < day < 8" ], [ "COMPARE_OP", "0 < day < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "day" ], [ "CALL", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_OP", "week - 1" ], [ "BINARY_OP", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day - 1" ], [ "BINARY_OP", "(week - 1) * 7 + (day - 1)" ], [ "STORE_FAST", "day_offset" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "day_1" ], [ "LOAD_FAST", "day_1" ], [ "LOAD_FAST", "day_offset" ], [ "BINARY_OP", "day_1 + day_offset" ], [ "STORE_FAST", "ord_day" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL", "type(name)" ], [ "BINARY_OP", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "CONTAINS_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL", "type(offset)" ], [ "BUILD_STRING", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BUILD_STRING", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL", "_index(year)" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL", "_index(month)" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL", "_index(day)" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_OP", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL", "_index(hour)" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL", "_index(minute)" ], [ "STORE_FAST", "minute" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL", "_index(second)" ], [ "STORE_FAST", "second" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "_index(microsecond)" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "hour" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "CONTAINS_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BUILD_STRING", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "CALL", "divmod(a, b)" ], [ "STORE_FAST", "q" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "r" ], [ "BINARY_OP", "r *= 2" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r > b" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r < b" ], [ "STORE_FAST", "greater_than_half" ], [ "LOAD_FAST", "greater_than_half" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q += 1" ], [ "STORE_FAST", "q" ], [ "LOAD_FAST", "q" ], [ "STORE_NAME", "\"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self" ], [ "STORE_NAME", " def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "STORE_NAME", " def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s" ], [ "STORE_NAME", " def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds" ], [ "STORE_NAME", " def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented" ], [ "STORE_NAME", " def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented" ], [ "STORE_NAME", " def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "STORE_NAME", " def __pos__(self):\n return self" ], [ "STORE_NAME", " def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self" ], [ "STORE_NAME", " def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented" ], [ "LOAD_NAME", "__mul__" ], [ "STORE_NAME", "__rmul__" ], [ "STORE_NAME", " def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)" ], [ "STORE_NAME", " def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)" ], [ "STORE_NAME", " def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "STORE_NAME", " def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)" ], [ "STORE_NAME", " def _getstate(self):\n return (self._days, self._seconds, self._microseconds)" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "s" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "weeks" ], [ "BINARY_OP", "weeks*7" ], [ "BINARY_OP", "days += weeks*7" ], [ "STORE_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "minutes" ], [ "BINARY_OP", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_OP", "hours*3600" ], [ "BINARY_OP", "minutes*60 + hours*3600" ], [ "BINARY_OP", "seconds += minutes*60 + hours*3600" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "milliseconds" ], [ "BINARY_OP", "milliseconds*1000" ], [ "BINARY_OP", "microseconds += milliseconds*1000" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL", "_math.modf(days)" ], [ "STORE_FAST", "dayfrac" ], [ "STORE_FAST", "days" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_OP", "dayfrac * (24.*3600.)" ], [ "CALL", "_math.modf(dayfrac * (24.*3600.))" ], [ "STORE_FAST", "daysecondsfrac" ], [ "STORE_FAST", "daysecondswhole" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "daysecondsfrac" ], [ "LOAD_FAST", "days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "_math.modf(seconds)" ], [ "STORE_FAST", "secondsfrac" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "BINARY_OP", "secondsfrac += daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "BINARY_OP", "s += int(seconds)" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_OP", "secondsfrac * 1e6" ], [ "STORE_FAST", "usdouble" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "int(microseconds)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL", "divmod(s, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "\"days=%d\" % self._days" ], [ "CALL", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "\"seconds=%d\" % self._seconds" ], [ "CALL", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\"microseconds=%d\" % self._microseconds" ], [ "CALL", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "CALL", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL", "', '.join(args)" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL", "divmod(self._seconds, 60)" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL", "divmod(mm, 60)" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "BINARY_OP", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "STORE_FAST", " def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL", "plural(self._days)" ], [ "BINARY_OP", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\".%06d\" % self._microseconds" ], [ "BINARY_OP", "s + \".%06d\" % self._microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_OP", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_OP", "self.days * 86400 + self.seconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_OP", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds + other._microseconds" ], [ "CALL", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds - other._microseconds" ], [ "CALL", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._microseconds * other" ], [ "CALL", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "STORE_FAST", "a" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "a" ], [ "BINARY_OP", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL", "_divide_and_round(usec * a, b)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "self._days * (24*3600) + self._seconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "usec // other" ], [ "CALL", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "CALL", "_divide_and_round(usec, other)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "STORE_FAST", "a" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "b" ], [ "LOAD_FAST", "usec" ], [ "BINARY_OP", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL", "_divide_and_round(b * usec, a)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "self._to_microseconds() % other._to_microseconds()" ], [ "STORE_FAST", "r" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "CALL", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "STORE_FAST", "q" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._getstate" ], [ "CALL", "other._getstate()" ], [ "CALL", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "STORE_NAME", " def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))" ], [ "STORE_NAME", " def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented" ], [ "STORE_NAME", " def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7" ], [ "STORE_NAME", " def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7" ], [ "STORE_NAME", " def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)" ], [ "STORE_NAME", " def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day])," ], [ "STORE_NAME", " def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_METHOD", "year.encode" ], [ "CALL", "year.encode('latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "month" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL", "_time.localtime(t)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "weekday" ], [ "STORE_FAST", "jday" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL", "_ord2ymd(n)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "CONTAINS_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "day" ], [ "CALL", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.timetuple" ], [ "CALL", "self.timetuple()" ], [ "CALL", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "STORE_FAST", "d2" ], [ "STORE_FAST", "m2" ], [ "STORE_FAST", "y2" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "y2" ], [ "LOAD_FAST", "m2" ], [ "LOAD_FAST", "d2" ], [ "CALL", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_OP", "self.toordinal() + other.days" ], [ "STORE_FAST", "o" ], [ "LOAD_FAST", "o" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_METHOD", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL", "timedelta(-other.days)" ], [ "BINARY_OP", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_OP", "days1 - days2" ], [ "CALL", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() + 6" ], [ "BINARY_OP", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "STORE_FAST", "today" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "STORE_FAST", "week" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year -= 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "STORE_FAST", "week" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year+1" ], [ "CALL", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year += 1" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "week" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "BINARY_OP", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day+1" ], [ "CALL", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "STORE_NAME", " def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "STORE_NAME", " def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst" ], [ "STORE_NAME", " def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.utcoffset" ], [ "CALL", "dt.utcoffset()" ], [ "STORE_FAST", "dtoff" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_OP", "dtoff - dtdst" ], [ "STORE_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "delta" ], [ "BINARY_OP", "dt += delta" ], [ "STORE_FAST", "dt" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_OP", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL", "getattr(self, \"__getinitargs__\", None)" ], [ "STORE_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL", "getinitargs()" ], [ "STORE_FAST", "args" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__getstate__" ], [ "CALL", "self.__getstate__()" ], [ "STORE_NAME", " def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n return self[0]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def week(self):\n return self[1]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def weekday(self):\n return self[2]" ], [ "STORE_NAME", " def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))" ], [ "STORE_NAME", " def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_GLOBAL", "super" ], [ "CALL", "super()" ], [ "LOAD_METHOD", "super().__new__" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "weekday" ], [ "CALL", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL", "tuple(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__name__" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "STORE_NAME", "\"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "STORE_NAME", " def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode" ], [ "STORE_NAME", " def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SUBSCR", "hour[0:1]" ], [ "CALL", "ord(hour[0:1])" ], [ "BINARY_OP", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_METHOD", "hour.encode" ], [ "CALL", "hour.encode('latin1')" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "CALL", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "STORE_FAST", "microsecond" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "STORE_FAST", "myoff" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "myoff//timedelta(minutes=1)" ], [ "BINARY_OP", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "STORE_FAST", "myhhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "otoff//timedelta(minutes=1)" ], [ "BINARY_OP", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "STORE_FAST", "othhmm" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "myhhmm" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "othhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.replace" ], [ "CALL", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "m % timedelta(minutes=1)" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "m //= timedelta(minutes=1)" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "time(h, m, self.second, self.microsecond)" ], [ "CALL", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_OP", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_OP", "\", %d\" % self._second" ], [ "STORE_FAST", "s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._tzstr" ], [ "CALL", "self._tzstr()" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_METHOD", "time_string.removeprefix" ], [ "CALL", "time_string.removeprefix('T')" ], [ "STORE_FAST", "time_string" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "time_string" ], [ "CALL", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "STORE_FAST", "timetuple" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "timetuple" ], [ "CALL", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "CALL", "self._tzinfo.utcoffset(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "CALL", "self._tzinfo.tzname(None)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "CALL", "self._tzinfo.dst(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "STORE_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h += 128" ], [ "STORE_FAST", "h" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_NAME", "\"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_OP", "date.__slots__ + time.__slots__" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "STORE_NAME", " def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)" ], [ "STORE_NAME", " def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()" ], [ "STORE_NAME", " def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "STORE_NAME", " def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)" ], [ "STORE_NAME", " def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "STORE_NAME", " def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)" ], [ "STORE_NAME", " def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "STORE_NAME", " def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "BINARY_OP", "ord(year[2:3])&0x7F" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL", "bytes(year, 'latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "month" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "STORE_FAST", "microsecond" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL", "_math.modf(t)" ], [ "STORE_FAST", "frac" ], [ "STORE_FAST", "t" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_OP", "frac * 1e6" ], [ "CALL", "round(frac * 1e6)" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t += 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us -= 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t -= 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us += 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "STORE_FAST", "converter" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL", "converter(t)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "weekday" ], [ "STORE_FAST", "jday" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL", "min(ss, 59)" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "utc" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_METHOD", "sys.platform.startswith" ], [ "CALL", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_OP", "t - max_fold_seconds" ], [ "CALL", "converter(t - max_fold_seconds)" ], [ "BINARY_SUBSCR", "converter(t - max_fold_seconds)[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_OP", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL", "timedelta(0, max_fold_seconds)" ], [ "BINARY_OP", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "STORE_FAST", "trans" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "trans // timedelta(0, 1)" ], [ "BINARY_OP", "t + trans // timedelta(0, 1)" ], [ "CALL", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SUBSCR", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe2" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL", "tz.fromutc(result)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_find_isoformat_datetime_separator(date_string)" ], [ "STORE_FAST", "separator_location" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SUBSCR", "date_string[0:separator_location]" ], [ "STORE_FAST", "dstr" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_OP", "separator_location+1" ], [ "BINARY_SUBSCR", "date_string[(separator_location+1):]" ], [ "STORE_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL", "_parse_isoformat_date(dstr)" ], [ "STORE_FAST", "date_components" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "_parse_isoformat_time(tstr)" ], [ "STORE_FAST", "time_components" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "STORE_FAST", "time_components" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_components" ], [ "LOAD_FAST", "time_components" ], [ "BINARY_OP", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.dst" ], [ "CALL", "self.dst()" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "datetime(1970, 1, 1)" ], [ "STORE_DEREF", "epoch" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(self - epoch) // timedelta(0, 1)" ], [ "STORE_FAST", "t" ], [ "STORE_FAST", " def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "local(t) - t" ], [ "STORE_FAST", "a" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "a" ], [ "BINARY_OP", "t - a" ], [ "STORE_FAST", "u1" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL", "local(u1)" ], [ "STORE_FAST", "t1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_OP", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_OP", "local(u2) - u2" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "u1" ], [ "BINARY_OP", "t1 - u1" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "b" ], [ "BINARY_OP", "t - b" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "STORE_FAST", "t2" ], [ "LOAD_FAST", "t2" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "u2" ], [ "CALL", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL", "_time.localtime(u)" ], [ "BINARY_SUBSCR", "_time.localtime(u)[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_OP", "self.microsecond / 1e6" ], [ "BINARY_OP", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_METHOD", "(self - _EPOCH).total_seconds" ], [ "CALL", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "offset" ], [ "BINARY_OP", "self -= offset" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "hh" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "ts" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(seconds=1)" ], [ "BINARY_OP", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "STORE_FAST", "ts" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL", "_time.localtime(ts)" ], [ "STORE_FAST", "localtm" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SUBSCR", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "STORE_FAST", "local" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "STORE_FAST", "gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "STORE_FAST", "zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "myoffset" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.replace" ], [ "CALL", "self.replace(tzinfo=None)" ], [ "LOAD_METHOD", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL", "self.replace(tzinfo=None)._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "myoffset" ], [ "BINARY_OP", "self - myoffset" ], [ "LOAD_METHOD", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL", "(self - myoffset).replace(tzinfo=tz)" ], [ "STORE_FAST", "utc" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "STORE_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL", "map(str, L)" ], [ "CALL", "\", \".join(map(str, L))" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.isoformat" ], [ "CALL", "self.isoformat(sep=' ')" ], [ "STORE_FAST", "import _strptime" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_METHOD", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "format" ], [ "CALL", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.utcoffset(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.tzname(self)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.dst(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "STORE_FAST", "myoff" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL", "self.replace(fold=not self.fold)" ], [ "LOAD_METHOD", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL", "other.replace(fold=not other.fold)" ], [ "LOAD_METHOD", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self - other" ], [ "STORE_FAST", "diff" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "STORE_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "delta += other" ], [ "STORE_FAST", "delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL", "divmod(delta.seconds, 3600)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "rem" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL", "divmod(rem, 60)" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_METHOD", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_METHOD", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_OP", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._minute * 60" ], [ "BINARY_OP", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 3600" ], [ "BINARY_OP", "self._second + self._minute * 60 + self._hour * 3600" ], [ "STORE_FAST", "secs1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._minute * 60" ], [ "BINARY_OP", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 3600" ], [ "BINARY_OP", "other._second + other._minute * 60 + other._hour * 3600" ], [ "STORE_FAST", "secs2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_OP", "days1 - days2" ], [ "LOAD_FAST", "secs1" ], [ "LOAD_FAST", "secs2" ], [ "BINARY_OP", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_OP", "self._microsecond - other._microsecond" ], [ "CALL", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "STORE_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "IS_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "otoff" ], [ "BINARY_OP", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_OP", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.replace" ], [ "CALL", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL", "_ymd2ord(self.year, self.month, self.day)" ], [ "STORE_FAST", "days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_OP", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_OP", "self.minute * 60" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "STORE_FAST", "seconds" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m += 128" ], [ "STORE_FAST", "m" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_FAST", "THURSDAY" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "STORE_FAST", "firstday" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_OP", "firstday + 6" ], [ "BINARY_OP", "(firstday + 6) % 7" ], [ "STORE_FAST", "firstweekday" ], [ "LOAD_FAST", "firstday" ], [ "LOAD_FAST", "firstweekday" ], [ "BINARY_OP", "firstday - firstweekday" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_FAST", "firstweekday" ], [ "LOAD_FAST", "THURSDAY" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "week1monday += 7" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_FAST", "week1monday" ], [ "STORE_NAME", "__slots__" ], [ "LOAD_NAME", "object" ], [ "CALL", "object()" ], [ "STORE_NAME", "_Omitted" ], [ "LOAD_NAME", "_Omitted" ], [ "STORE_NAME", " def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self" ], [ "STORE_NAME", " def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented" ], [ "STORE_NAME", " def __hash__(self):\n return hash(self._offset)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "STORE_NAME", " def __str__(self):\n return self.tzname(None)" ], [ "STORE_NAME", " def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=24, microseconds=-1)" ], [ "STORE_NAME", "_maxoffset" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "STORE_NAME", "_minoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "IS_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._create" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "name" ], [ "CALL", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_METHOD", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "tzinfo.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "hash(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utc" ], [ "IS_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BUILD_STRING", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BUILD_STRING", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.tzname" ], [ "CALL", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_OP", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "STORE_FAST", "delta" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(delta, timedelta(hours=1))" ], [ "STORE_FAST", "hours" ], [ "STORE_FAST", "rest" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "STORE_FAST", "minutes" ], [ "STORE_FAST", "rest" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-3.12.json000066400000000000000000016724171474076367500247740ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"Concrete date/time and related types.\n\nSee http://www.iana.org/time-zones/repository/tz-link.html for\ntime zone and DST data sources.\n\"\"\"" ], [ "STORE_NAME", "__all__" ], [ "STORE_NAME", "import time as _time" ], [ "STORE_NAME", "import math as _math" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from operator import index as _index" ], [ "STORE_NAME", "def _cmp(x, y):\n return 0 if x == y else 1 if x > y else -1" ], [ "STORE_NAME", "MINYEAR" ], [ "STORE_NAME", "MAXYEAR" ], [ "STORE_NAME", "_MAXORDINAL" ], [ "STORE_NAME", "_DAYS_IN_MONTH" ], [ "STORE_NAME", "_DAYS_BEFORE_MONTH" ], [ "STORE_NAME", "dbm" ], [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SLICE", "_DAYS_IN_MONTH[1:]" ], [ "STORE_NAME", "dim" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_ATTR", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dbm" ], [ "LOAD_NAME", "dim" ], [ "BINARY_OP", "dbm += dim" ], [ "STORE_NAME", "dbm" ], [ "DELETE_NAME", "dbm" ], [ "DELETE_NAME", "dim" ], [ "STORE_NAME", "def _is_leap(year):\n \"year -> 1 if leap year, else 0.\"\n return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)" ], [ "STORE_NAME", "def _days_before_year(year):\n \"year -> number of days before January 1st of year.\"\n y = year - 1\n return y*365 + y//4 - y//100 + y//400" ], [ "STORE_NAME", "def _days_in_month(year, month):\n \"year, month -> number of days in that month in that year.\"\n assert 1 <= month <= 12, month\n if month == 2 and _is_leap(year):\n return 29\n return _DAYS_IN_MONTH[month]" ], [ "STORE_NAME", "def _days_before_month(year, month):\n \"year, month -> number of days in year preceding first day of month.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "STORE_NAME", "def _ymd2ord(year, month, day):\n \"year, month, day -> ordinal, considering 01-Jan-0001 as day 1.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n dim = _days_in_month(year, month)\n assert 1 <= day <= dim, ('day must be in 1..%d' % dim)\n return (_days_before_year(year) +\n _days_before_month(year, month) +\n day)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(401)" ], [ "STORE_NAME", "_DI400Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(101)" ], [ "STORE_NAME", "_DI100Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(5)" ], [ "STORE_NAME", "_DI4Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_OP", "4 * _DI100Y" ], [ "BINARY_OP", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_OP", "25 * _DI4Y" ], [ "BINARY_OP", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "STORE_NAME", "def _ord2ymd(n):\n \"ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.\"\n\n # n is a 1-based index, starting at 1-Jan-1. The pattern of leap years\n # repeats exactly every 400 years. The basic strategy is to find the\n # closest 400-year boundary at or before n, then work with the offset\n # from that boundary to n. Life is much clearer if we subtract 1 from\n # n first -- then the values of n at 400-year boundaries are exactly\n # those divisible by _DI400Y:\n #\n # D M Y n n-1\n # -- --- ---- ---------- ----------------\n # 31 Dec -400 -_DI400Y -_DI400Y -1\n # 1 Jan -399 -_DI400Y +1 -_DI400Y 400-year boundary\n # ...\n # 30 Dec 000 -1 -2\n # 31 Dec 000 0 -1\n # 1 Jan 001 1 0 400-year boundary\n # 2 Jan 001 2 1\n # 3 Jan 001 3 2\n # ...\n # 31 Dec 400 _DI400Y _DI400Y -1\n # 1 Jan 401 _DI400Y +1 _DI400Y 400-year boundary\n n -= 1\n n400, n = divmod(n, _DI400Y)\n year = n400 * 400 + 1 # ..., -399, 1, 401, ...\n\n # Now n is the (non-negative) offset, in days, from January 1 of year, to\n # the desired date. Now compute how many 100-year cycles precede n.\n # Note that it's possible for n100 to equal 4! In that case 4 full\n # 100-year cycles precede the desired day, which implies the desired\n # day is December 31 at the end of a 400-year cycle.\n n100, n = divmod(n, _DI100Y)\n\n # Now compute how many 4-year cycles precede it.\n n4, n = divmod(n, _DI4Y)\n\n # And now how many single years. Again n1 can be 4, and again meaning\n # that the desired day is December 31 at the end of the 4-year cycle.\n n1, n = divmod(n, 365)\n\n year += n100 * 100 + n4 * 4 + n1\n if n1 == 4 or n100 == 4:\n assert n == 0\n return year-1, 12, 31\n\n # Now the year is correct, and n is the offset from January 1. We find\n # the month via an estimate that's either exact or one too large.\n leapyear = n1 == 3 and (n4 != 24 or n100 == 3)\n assert leapyear == _is_leap(year)\n month = (n + 50) >> 5\n preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)\n if preceding > n: # estimate is too large\n month -= 1\n preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)\n n -= preceding\n assert 0 <= n < _days_in_month(year, month)\n\n # Now the year and month are correct, and n is the offset from the\n # start of that month: we're done!\n return year, month, n+1" ], [ "STORE_NAME", "_MONTHNAMES" ], [ "STORE_NAME", "_DAYNAMES" ], [ "STORE_NAME", "def _build_struct_time(y, m, d, hh, mm, ss, dstflag):\n wday = (_ymd2ord(y, m, d) + 6) % 7\n dnum = _days_before_month(y, m) + d\n return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_NAME", "def _format_time(hh, mm, ss, us, timespec='auto'):\n specs = {\n 'hours': '{:02d}',\n 'minutes': '{:02d}:{:02d}',\n 'seconds': '{:02d}:{:02d}:{:02d}',\n 'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}',\n 'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}'\n }\n\n if timespec == 'auto':\n # Skip trailing microseconds when us==0.\n timespec = 'microseconds' if us else 'seconds'\n elif timespec == 'milliseconds':\n us //= 1000\n try:\n fmt = specs[timespec]\n except KeyError:\n raise ValueError('Unknown timespec value')\n else:\n return fmt.format(hh, mm, ss, us)" ], [ "STORE_NAME", "def _format_offset(off):\n s = ''\n if off is not None:\n if off.days < 0:\n sign = \"-\"\n off = -off\n else:\n sign = \"+\"\n hh, mm = divmod(off, timedelta(hours=1))\n mm, ss = divmod(mm, timedelta(minutes=1))\n s += \"%s%02d:%02d\" % (sign, hh, mm)\n if ss or ss.microseconds:\n s += \":%02d\" % ss.seconds\n\n if ss.microseconds:\n s += '.%06d' % ss.microseconds\n return s" ], [ "STORE_NAME", "def _wrap_strftime(object, format, timetuple):\n # Don't call utcoffset() or tzname() unless actually needed.\n freplace = None # the string to use for %f\n zreplace = None # the string to use for %z\n Zreplace = None # the string to use for %Z\n\n # Scan format for %z and %Z escapes, replacing as needed.\n newformat = []\n push = newformat.append\n i, n = 0, len(format)\n while i < n:\n ch = format[i]\n i += 1\n if ch == '%':\n if i < n:\n ch = format[i]\n i += 1\n if ch == 'f':\n if freplace is None:\n freplace = '%06d' % getattr(object,\n 'microsecond', 0)\n newformat.append(freplace)\n elif ch == 'z':\n if zreplace is None:\n zreplace = \"\"\n if hasattr(object, \"utcoffset\"):\n offset = object.utcoffset()\n if offset is not None:\n sign = '+'\n if offset.days < 0:\n offset = -offset\n sign = '-'\n h, rest = divmod(offset, timedelta(hours=1))\n m, rest = divmod(rest, timedelta(minutes=1))\n s = rest.seconds\n u = offset.microseconds\n if u:\n zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u)\n elif s:\n zreplace = '%c%02d%02d%02d' % (sign, h, m, s)\n else:\n zreplace = '%c%02d%02d' % (sign, h, m)\n assert '%' not in zreplace\n newformat.append(zreplace)\n elif ch == 'Z':\n if Zreplace is None:\n Zreplace = \"\"\n if hasattr(object, \"tzname\"):\n s = object.tzname()\n if s is not None:\n # strftime is going to have at this: escape %\n Zreplace = s.replace('%', '%%')\n newformat.append(Zreplace)\n else:\n push('%')\n push(ch)\n else:\n push('%')\n else:\n push(ch)\n newformat = \"\".join(newformat)\n return _time.strftime(newformat, timetuple)" ], [ "STORE_NAME", "def _is_ascii_digit(c):\n return c in \"0123456789\"" ], [ "STORE_NAME", "def _find_isoformat_datetime_separator(dtstr):\n # See the comment in _datetimemodule.c:_find_isoformat_datetime_separator\n len_dtstr = len(dtstr)\n if len_dtstr == 7:\n return 7\n\n assert len_dtstr > 7\n date_separator = \"-\"\n week_indicator = \"W\"\n\n if dtstr[4] == date_separator:\n if dtstr[5] == week_indicator:\n if len_dtstr < 8:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 8 and dtstr[8] == date_separator:\n if len_dtstr == 9:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 10 and _is_ascii_digit(dtstr[10]):\n # This is as far as we need to resolve the ambiguity for\n # the moment - if we have YYYY-Www-##, the separator is\n # either a hyphen at 8 or a number at 10.\n #\n # We'll assume it's a hyphen at 8 because it's way more\n # likely that someone will use a hyphen as a separator than\n # a number, but at this point it's really best effort\n # because this is an extension of the spec anyway.\n # TODO(pganssle): Document this\n return 8\n return 10\n else:\n # YYYY-Www (8)\n return 8\n else:\n # YYYY-MM-DD (10)\n return 10\n else:\n if dtstr[4] == week_indicator:\n # YYYYWww (7) or YYYYWwwd (8)\n idx = 7\n while idx < len_dtstr:\n if not _is_ascii_digit(dtstr[idx]):\n break\n idx += 1\n\n if idx < 9:\n return idx\n\n if idx % 2 == 0:\n # If the index of the last number is even, it's YYYYWwwd\n return 7\n else:\n return 8\n else:\n # YYYYMMDD (8)\n return 8" ], [ "STORE_NAME", "def _parse_isoformat_date(dtstr):\n # It is assumed that this is an ASCII-only string of lengths 7, 8 or 10,\n # see the comment on Modules/_datetimemodule.c:_find_isoformat_datetime_separator\n assert len(dtstr) in (7, 8, 10)\n year = int(dtstr[0:4])\n has_sep = dtstr[4] == '-'\n\n pos = 4 + has_sep\n if dtstr[pos:pos + 1] == \"W\":\n # YYYY-?Www-?D?\n pos += 1\n weekno = int(dtstr[pos:pos + 2])\n pos += 2\n\n dayno = 1\n if len(dtstr) > pos:\n if (dtstr[pos:pos + 1] == '-') != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n\n dayno = int(dtstr[pos:pos + 1])\n\n return list(_isoweek_to_gregorian(year, weekno, dayno))\n else:\n month = int(dtstr[pos:pos + 2])\n pos += 2\n if (dtstr[pos:pos + 1] == \"-\") != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n day = int(dtstr[pos:pos + 2])\n\n return [year, month, day]" ], [ "STORE_NAME", "_FRACTION_CORRECTION" ], [ "STORE_NAME", "def _parse_hh_mm_ss_ff(tstr):\n # Parses things of the form HH[:?MM[:?SS[{.,}fff[fff]]]]\n len_str = len(tstr)\n\n time_comps = [0, 0, 0, 0]\n pos = 0\n for comp in range(0, 3):\n if (len_str - pos) < 2:\n raise ValueError(\"Incomplete time component\")\n\n time_comps[comp] = int(tstr[pos:pos+2])\n\n pos += 2\n next_char = tstr[pos:pos+1]\n\n if comp == 0:\n has_sep = next_char == ':'\n\n if not next_char or comp >= 2:\n break\n\n if has_sep and next_char != ':':\n raise ValueError(\"Invalid time separator: %c\" % next_char)\n\n pos += has_sep\n\n if pos < len_str:\n if tstr[pos] not in '.,':\n raise ValueError(\"Invalid microsecond component\")\n else:\n pos += 1\n\n len_remainder = len_str - pos\n\n if len_remainder >= 6:\n to_parse = 6\n else:\n to_parse = len_remainder\n\n time_comps[3] = int(tstr[pos:(pos+to_parse)])\n if to_parse < 6:\n time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]\n if (len_remainder > to_parse\n and not all(map(_is_ascii_digit, tstr[(pos+to_parse):]))):\n raise ValueError(\"Non-digit values in unparsed fraction\")\n\n return time_comps" ], [ "STORE_NAME", "def _parse_isoformat_time(tstr):\n # Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]\n len_str = len(tstr)\n if len_str < 2:\n raise ValueError(\"Isoformat time too short\")\n\n # This is equivalent to re.search('[+-Z]', tstr), but faster\n tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1 or tstr.find('Z') + 1)\n timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr\n\n time_comps = _parse_hh_mm_ss_ff(timestr)\n\n tzi = None\n if tz_pos == len_str and tstr[-1] == 'Z':\n tzi = timezone.utc\n elif tz_pos > 0:\n tzstr = tstr[tz_pos:]\n\n # Valid time zone strings are:\n # HH len: 2\n # HHMM len: 4\n # HH:MM len: 5\n # HHMMSS len: 6\n # HHMMSS.f+ len: 7+\n # HH:MM:SS len: 8\n # HH:MM:SS.f+ len: 10+\n\n if len(tzstr) in (0, 1, 3):\n raise ValueError(\"Malformed time zone string\")\n\n tz_comps = _parse_hh_mm_ss_ff(tzstr)\n\n if all(x == 0 for x in tz_comps):\n tzi = timezone.utc\n else:\n tzsign = -1 if tstr[tz_pos - 1] == '-' else 1\n\n td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])\n\n tzi = timezone(tzsign * td)\n\n time_comps.append(tzi)\n\n return time_comps" ], [ "STORE_NAME", "def _isoweek_to_gregorian(year, week, day):\n # Year is bounded this way because 9999-12-31 is (9999, 52, 5)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError(f\"Year is out of range: {year}\")\n\n if not 0 < week < 53:\n out_of_range = True\n\n if week == 53:\n # ISO years have 53 weeks in them on years starting with a\n # Thursday and leap years starting on a Wednesday\n first_weekday = _ymd2ord(year, 1, 1) % 7\n if (first_weekday == 4 or (first_weekday == 3 and\n _is_leap(year))):\n out_of_range = False\n\n if out_of_range:\n raise ValueError(f\"Invalid week: {week}\")\n\n if not 0 < day < 8:\n raise ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")\n\n # Now compute the offset from (Y, 1, 1) in days:\n day_offset = (week - 1) * 7 + (day - 1)\n\n # Calculate the ordinal day for monday, week 1\n day_1 = _isoweek1monday(year)\n ord_day = day_1 + day_offset\n\n return _ord2ymd(ord_day)" ], [ "STORE_NAME", "def _check_tzname(name):\n if name is not None and not isinstance(name, str):\n raise TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "STORE_NAME", "def _check_utc_offset(name, offset):\n assert name in (\"utcoffset\", \"dst\")\n if offset is None:\n return\n if not isinstance(offset, timedelta):\n raise TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))\n if not -timedelta(1) < offset < timedelta(1):\n raise ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "STORE_NAME", "def _check_date_fields(year, month, day):\n year = _index(year)\n month = _index(month)\n day = _index(day)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)\n if not 1 <= month <= 12:\n raise ValueError('month must be in 1..12', month)\n dim = _days_in_month(year, month)\n if not 1 <= day <= dim:\n raise ValueError('day must be in 1..%d' % dim, day)\n return year, month, day" ], [ "STORE_NAME", "def _check_time_fields(hour, minute, second, microsecond, fold):\n hour = _index(hour)\n minute = _index(minute)\n second = _index(second)\n microsecond = _index(microsecond)\n if not 0 <= hour <= 23:\n raise ValueError('hour must be in 0..23', hour)\n if not 0 <= minute <= 59:\n raise ValueError('minute must be in 0..59', minute)\n if not 0 <= second <= 59:\n raise ValueError('second must be in 0..59', second)\n if not 0 <= microsecond <= 999999:\n raise ValueError('microsecond must be in 0..999999', microsecond)\n if fold not in (0, 1):\n raise ValueError('fold must be either 0 or 1', fold)\n return hour, minute, second, microsecond, fold" ], [ "STORE_NAME", "def _check_tzinfo_arg(tz):\n if tz is not None and not isinstance(tz, tzinfo):\n raise TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "STORE_NAME", "def _cmperror(x, y):\n raise TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "STORE_NAME", "def _divide_and_round(a, b):\n \"\"\"divide a by b and round result to the nearest integer\n\n When the ratio is exactly half-way between two integers,\n the even integer is returned.\n \"\"\"\n # Based on the reference implementation for divmod_near\n # in Objects/longobject.c.\n q, r = divmod(a, b)\n # round up if either r / b > 0.5, or r / b == 0.5 and q is odd.\n # The expression r / b > 0.5 is equivalent to 2 * r > b if b is\n # positive, 2 * r < b if b negative.\n r *= 2\n greater_than_half = r > b if b > 0 else r < b\n if greater_than_half or r == b and q % 2 == 1:\n q += 1\n\n return q" ], [ "CALL", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "CALL", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "date" ], [ "STORE_NAME", "_date_class" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "CALL", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "STORE_NAME", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_NAME", "tuple" ], [ "CALL", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "STORE_NAME", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "STORE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "STORE_NAME", "_tzinfo_class" ], [ "CALL", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "time" ], [ "STORE_NAME", "_time_class" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "CALL", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "STORE_NAME", "def _isoweek1monday(year):\n # Helper to calculate the day number of the Monday starting week 1\n # XXX This could be done more efficiently\n THURSDAY = 3\n firstday = _ymd2ord(year, 1, 1)\n firstweekday = (firstday + 6) % 7 # See weekday() above\n week1monday = firstday - firstweekday\n if firstweekday > THURSDAY:\n week1monday += 7\n return week1monday" ], [ "LOAD_NAME", "tzinfo" ], [ "CALL", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "STORE_NAME", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "CALL", "timezone._create(timedelta(0))" ], [ "STORE_NAME", "UTC" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "STORE_NAME", "_EPOCH" ], [ "CALL_INTRINSIC_1", "from _datetime import *" ], [ "DELETE_NAME", "_DAYNAMES" ], [ "DELETE_NAME", "_DAYS_BEFORE_MONTH" ], [ "DELETE_NAME", "_DAYS_IN_MONTH" ], [ "DELETE_NAME", "_DI100Y" ], [ "DELETE_NAME", "_DI400Y" ], [ "DELETE_NAME", "_DI4Y" ], [ "DELETE_NAME", "_EPOCH" ], [ "DELETE_NAME", "_MAXORDINAL" ], [ "DELETE_NAME", "_MONTHNAMES" ], [ "DELETE_NAME", "_build_struct_time" ], [ "DELETE_NAME", "_check_date_fields" ], [ "DELETE_NAME", "_check_time_fields" ], [ "DELETE_NAME", "_check_tzinfo_arg" ], [ "DELETE_NAME", "_check_tzname" ], [ "DELETE_NAME", "_check_utc_offset" ], [ "DELETE_NAME", "_cmp" ], [ "DELETE_NAME", "_cmperror" ], [ "DELETE_NAME", "_date_class" ], [ "DELETE_NAME", "_days_before_month" ], [ "DELETE_NAME", "_days_before_year" ], [ "DELETE_NAME", "_days_in_month" ], [ "DELETE_NAME", "_format_time" ], [ "DELETE_NAME", "_format_offset" ], [ "DELETE_NAME", "_index" ], [ "DELETE_NAME", "_is_leap" ], [ "DELETE_NAME", "_isoweek1monday" ], [ "DELETE_NAME", "_math" ], [ "DELETE_NAME", "_ord2ymd" ], [ "DELETE_NAME", "_time" ], [ "DELETE_NAME", "_time_class" ], [ "DELETE_NAME", "_tzinfo_class" ], [ "DELETE_NAME", "_wrap_strftime" ], [ "DELETE_NAME", "_ymd2ord" ], [ "DELETE_NAME", "_divide_and_round" ], [ "DELETE_NAME", "_parse_isoformat_date" ], [ "DELETE_NAME", "_parse_isoformat_time" ], [ "DELETE_NAME", "_parse_hh_mm_ss_ff" ], [ "DELETE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "_isoweek_to_gregorian" ], [ "DELETE_NAME", "_find_isoformat_datetime_separator" ], [ "DELETE_NAME", "_FRACTION_CORRECTION" ], [ "DELETE_NAME", "_is_ascii_digit" ], [ "STORE_NAME", "from _datetime import __doc__" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x == y" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year - 1" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//4" ], [ "BINARY_OP", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//100" ], [ "BINARY_OP", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//400" ], [ "BINARY_OP", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_before_month(year, month)" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n -= 1" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL", "divmod(n, _DI400Y)" ], [ "STORE_FAST", "n400" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n400" ], [ "BINARY_OP", "n400 * 400" ], [ "BINARY_OP", "n400 * 400 + 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL", "divmod(n, _DI100Y)" ], [ "STORE_FAST", "n100" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL", "divmod(n, _DI4Y)" ], [ "STORE_FAST", "n4" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL", "divmod(n, 365)" ], [ "STORE_FAST", "n1" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "n100" ], [ "BINARY_OP", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_OP", "n4 * 4" ], [ "BINARY_OP", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_OP", "n100 * 100 + n4 * 4 + n1" ], [ "BINARY_OP", "year += n100 * 100 + n4 * 4 + n1" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "STORE_FAST", "leapyear" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n + 50" ], [ "BINARY_OP", "(n + 50) >> 5" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_FAST", "month" ], [ "BINARY_OP", "month -= 1" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "BINARY_OP", "preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "preceding" ], [ "BINARY_OP", "n -= preceding" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "_ymd2ord(y, m, d)" ], [ "BINARY_OP", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_OP", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "STORE_FAST", "wday" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "CALL", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "_days_before_month(y, m) + d" ], [ "STORE_FAST", "dnum" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "wday" ], [ "LOAD_FAST", "dnum" ], [ "LOAD_FAST", "dstflag" ], [ "CALL", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "STORE_FAST", "timespec" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us //= 1000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "STORE_FAST", "fmt" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_ATTR", "fmt.format" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "CALL", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('Unknown timespec value')" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "off" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "STORE_FAST", "off" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(off, timedelta(hours=1))" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(mm, timedelta(minutes=1))" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "BINARY_OP", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "BINARY_OP", "s += \"%s%02d:%02d\" % (sign, hh, mm)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_OP", "\":%02d\" % ss.seconds" ], [ "BINARY_OP", "s += \":%02d\" % ss.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_OP", "'.%06d' % ss.microseconds" ], [ "BINARY_OP", "s += '.%06d' % ss.microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "STORE_FAST", "freplace" ], [ "STORE_FAST", "zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "STORE_FAST", "newformat" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "STORE_FAST", "push" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL", "len(format)" ], [ "STORE_FAST", "n" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_OP", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "STORE_FAST", "freplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_ATTR", "object.utcoffset" ], [ "CALL", "object.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "STORE_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(offset, timedelta(hours=1))" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "rest" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "rest" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "STORE_FAST", "u" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_OP", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "'%c%02d%02d' % (sign, h, m)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "zreplace" ], [ "CONTAINS_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_ATTR", "object.tzname" ], [ "CALL", "object.tzname()" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.replace" ], [ "CALL", "s.replace('%', '%%')" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_ATTR", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL", "\"\".join(newformat)" ], [ "STORE_FAST", "newformat" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.strftime" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_FAST", "timetuple" ], [ "CALL", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "CONTAINS_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "STORE_FAST", "len_dtstr" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "STORE_FAST", "date_separator" ], [ "STORE_FAST", "week_indicator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "STORE_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "idx" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx += 1" ], [ "STORE_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "CONTAINS_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SLICE", "dtstr[0:4]" ], [ "CALL", "int(dtstr[0:4])" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "4 + has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "weekno" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "CALL", "int(dtstr[pos:pos + 1])" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "weekno" ], [ "LOAD_FAST", "dayno" ], [ "CALL", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(0, 3)" ], [ "STORE_FAST", "comp" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+2" ], [ "BINARY_SLICE", "tstr[pos:pos+2]" ], [ "CALL", "int(tstr[pos:pos+2])" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "comp" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+1" ], [ "BINARY_SLICE", "tstr[pos:pos+1]" ], [ "STORE_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST_CHECK", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_OP", "\"Invalid time separator: %c\" % next_char" ], [ "CALL", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "pos < len_str" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "CONTAINS_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "len_str - pos" ], [ "STORE_FAST", "len_remainder" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_FAST", "len_remainder" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SLICE", "tstr[pos:(pos+to_parse)]" ], [ "CALL", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "BINARY_SUBSCR", "time_comps[3]" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "BINARY_OP", "time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SLICE", "tstr[(pos+to_parse):]" ], [ "CALL", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('-')" ], [ "BINARY_OP", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('+')" ], [ "BINARY_OP", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('Z')" ], [ "BINARY_OP", "tstr.find('Z') + 1" ], [ "STORE_FAST", "tz_pos" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_OP", "tz_pos-1" ], [ "BINARY_SLICE", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "STORE_FAST", "timestr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL", "_parse_hh_mm_ss_ff(timestr)" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tz_pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SLICE", "tstr[tz_pos:]" ], [ "STORE_FAST", "tzstr" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "len(tzstr)" ], [ "CONTAINS_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "_parse_hh_mm_ss_ff(tzstr)" ], [ "STORE_FAST", "tz_comps" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL", "(x == 0 for x in tz_comps)" ], [ "CALL", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_OP", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "STORE_FAST", "tzsign" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "STORE_FAST", "td" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_FAST", "tzsign" ], [ "LOAD_FAST", "td" ], [ "BINARY_OP", "tzsign * td" ], [ "CALL", "timezone(tzsign * td)" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_ATTR", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "(x == 0 for x in tz_comps)" ], [ "STORE_FAST", "x" ], [ "LOAD_FAST", "x" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "year" ], [ "BUILD_STRING", "f\"Year is out of range: {year}\"" ], [ "CALL", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "0 < week < 53" ], [ "COMPARE_OP", "0 < week < 53" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "BINARY_OP", "_ymd2ord(year, 1, 1) % 7" ], [ "STORE_FAST", "first_weekday" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "week" ], [ "BUILD_STRING", "f\"Invalid week: {week}\"" ], [ "CALL", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "0 < day < 8" ], [ "COMPARE_OP", "0 < day < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "day" ], [ "BUILD_STRING", "f\"Invalid weekday: {day} (range is [1, 7])\"" ], [ "CALL", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_OP", "week - 1" ], [ "BINARY_OP", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day - 1" ], [ "BINARY_OP", "(week - 1) * 7 + (day - 1)" ], [ "STORE_FAST", "day_offset" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "day_1" ], [ "LOAD_FAST", "day_1" ], [ "LOAD_FAST", "day_offset" ], [ "BINARY_OP", "day_1 + day_offset" ], [ "STORE_FAST", "ord_day" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL", "type(name)" ], [ "BINARY_OP", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "CONTAINS_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL", "type(offset)" ], [ "BUILD_STRING", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BUILD_STRING", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL", "_index(year)" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL", "_index(month)" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL", "_index(day)" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_OP", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL", "_index(hour)" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL", "_index(minute)" ], [ "STORE_FAST", "minute" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL", "_index(second)" ], [ "STORE_FAST", "second" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "_index(microsecond)" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "hour" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "CONTAINS_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BUILD_STRING", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "CALL", "divmod(a, b)" ], [ "STORE_FAST", "q" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "r" ], [ "BINARY_OP", "r *= 2" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r > b" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r < b" ], [ "STORE_FAST", "greater_than_half" ], [ "LOAD_FAST", "greater_than_half" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q += 1" ], [ "STORE_FAST", "q" ], [ "LOAD_FAST", "q" ], [ "STORE_NAME", "\"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self" ], [ "STORE_NAME", " def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "STORE_NAME", " def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s" ], [ "STORE_NAME", " def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds" ], [ "STORE_NAME", " def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented" ], [ "STORE_NAME", " def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented" ], [ "STORE_NAME", " def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "STORE_NAME", " def __pos__(self):\n return self" ], [ "STORE_NAME", " def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self" ], [ "STORE_NAME", " def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented" ], [ "LOAD_NAME", "__mul__" ], [ "STORE_NAME", "__rmul__" ], [ "STORE_NAME", " def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)" ], [ "STORE_NAME", " def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)" ], [ "STORE_NAME", " def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "STORE_NAME", " def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)" ], [ "STORE_NAME", " def _getstate(self):\n return (self._days, self._seconds, self._microseconds)" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "s" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "weeks" ], [ "BINARY_OP", "weeks*7" ], [ "BINARY_OP", "days += weeks*7" ], [ "STORE_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "minutes" ], [ "BINARY_OP", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_OP", "hours*3600" ], [ "BINARY_OP", "minutes*60 + hours*3600" ], [ "BINARY_OP", "seconds += minutes*60 + hours*3600" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "milliseconds" ], [ "BINARY_OP", "milliseconds*1000" ], [ "BINARY_OP", "microseconds += milliseconds*1000" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL", "_math.modf(days)" ], [ "STORE_FAST", "dayfrac" ], [ "STORE_FAST", "days" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_OP", "dayfrac * (24.*3600.)" ], [ "CALL", "_math.modf(dayfrac * (24.*3600.))" ], [ "STORE_FAST", "daysecondsfrac" ], [ "STORE_FAST", "daysecondswhole" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "daysecondsfrac" ], [ "LOAD_FAST", "days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "_math.modf(seconds)" ], [ "STORE_FAST", "secondsfrac" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "BINARY_OP", "secondsfrac += daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "BINARY_OP", "s += int(seconds)" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_OP", "secondsfrac * 1e6" ], [ "STORE_FAST", "usdouble" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "int(microseconds)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "STORE_FAST", "seconds" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "seconds" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL", "divmod(s, 24*3600)" ], [ "STORE_FAST", "days" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "days" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "\"days=%d\" % self._days" ], [ "CALL", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "\"seconds=%d\" % self._seconds" ], [ "CALL", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\"microseconds=%d\" % self._microseconds" ], [ "CALL", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "CALL", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL", "', '.join(args)" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL", "divmod(self._seconds, 60)" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL", "divmod(mm, 60)" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "BINARY_OP", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "STORE_FAST", " def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL", "plural(self._days)" ], [ "BINARY_OP", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\".%06d\" % self._microseconds" ], [ "BINARY_OP", "s + \".%06d\" % self._microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_OP", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_OP", "self.days * 86400 + self.seconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_OP", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds + other._microseconds" ], [ "CALL", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds - other._microseconds" ], [ "CALL", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._microseconds * other" ], [ "CALL", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "STORE_FAST", "a" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "a" ], [ "BINARY_OP", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL", "_divide_and_round(usec * a, b)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "self._days * (24*3600) + self._seconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "usec // other" ], [ "CALL", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "CALL", "_divide_and_round(usec, other)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "STORE_FAST", "a" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "b" ], [ "LOAD_FAST", "usec" ], [ "BINARY_OP", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL", "_divide_and_round(b * usec, a)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "self._to_microseconds() % other._to_microseconds()" ], [ "STORE_FAST", "r" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "CALL", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "STORE_FAST", "q" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._getstate" ], [ "CALL", "other._getstate()" ], [ "CALL", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "STORE_NAME", " def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))" ], [ "STORE_NAME", " def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented" ], [ "STORE_NAME", " def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7" ], [ "STORE_NAME", " def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7" ], [ "STORE_NAME", " def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)" ], [ "STORE_NAME", " def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day])," ], [ "STORE_NAME", " def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SLICE", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_ATTR", "year.encode" ], [ "CALL", "year.encode('latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "month" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL", "_time.localtime(t)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "weekday" ], [ "STORE_FAST", "jday" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL", "_ord2ymd(n)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "CONTAINS_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "day" ], [ "CALL", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.timetuple" ], [ "CALL", "self.timetuple()" ], [ "CALL", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "STORE_FAST", "d2" ], [ "STORE_FAST", "m2" ], [ "STORE_FAST", "y2" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "y2" ], [ "LOAD_FAST", "m2" ], [ "LOAD_FAST", "d2" ], [ "CALL", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_OP", "self.toordinal() + other.days" ], [ "STORE_FAST", "o" ], [ "LOAD_FAST", "o" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_ATTR", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL", "timedelta(-other.days)" ], [ "BINARY_OP", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_OP", "days1 - days2" ], [ "CALL", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() + 6" ], [ "BINARY_OP", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "STORE_FAST", "today" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "STORE_FAST", "week" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year -= 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "STORE_FAST", "week" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year+1" ], [ "CALL", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year += 1" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "week" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "BINARY_OP", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day+1" ], [ "CALL", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "STORE_NAME", " def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "STORE_NAME", " def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst" ], [ "STORE_NAME", " def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.utcoffset" ], [ "CALL", "dt.utcoffset()" ], [ "STORE_FAST", "dtoff" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_OP", "dtoff - dtdst" ], [ "STORE_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "delta" ], [ "BINARY_OP", "dt += delta" ], [ "STORE_FAST", "dt" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_OP", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL", "getattr(self, \"__getinitargs__\", None)" ], [ "STORE_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL", "getinitargs()" ], [ "STORE_FAST", "args" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__getstate__" ], [ "CALL", "self.__getstate__()" ], [ "STORE_NAME", " def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n return self[0]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def week(self):\n return self[1]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def weekday(self):\n return self[2]" ], [ "STORE_NAME", " def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))" ], [ "STORE_NAME", " def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_SUPER_ATTR", "super().__new__" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "weekday" ], [ "CALL", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL", "tuple(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__name__" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "BUILD_STRING", "f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})'" ], [ "STORE_NAME", "\"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "STORE_NAME", " def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode" ], [ "STORE_NAME", " def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SLICE", "hour[0:1]" ], [ "CALL", "ord(hour[0:1])" ], [ "BINARY_OP", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_ATTR", "hour.encode" ], [ "CALL", "hour.encode('latin1')" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "CALL", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "STORE_FAST", "microsecond" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "STORE_FAST", "myoff" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "myoff//timedelta(minutes=1)" ], [ "BINARY_OP", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "STORE_FAST", "myhhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "otoff//timedelta(minutes=1)" ], [ "BINARY_OP", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "STORE_FAST", "othhmm" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "myhhmm" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "othhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "m % timedelta(minutes=1)" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "BINARY_OP", "m //= timedelta(minutes=1)" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "time(h, m, self.second, self.microsecond)" ], [ "CALL", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_OP", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_OP", "\", %d\" % self._second" ], [ "STORE_FAST", "s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzstr" ], [ "CALL", "self._tzstr()" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_ATTR", "time_string.removeprefix" ], [ "CALL", "time_string.removeprefix('T')" ], [ "STORE_FAST", "time_string" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "time_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {time_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "STORE_FAST", "timetuple" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "timetuple" ], [ "CALL", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.utcoffset" ], [ "CALL", "self._tzinfo.utcoffset(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.tzname" ], [ "CALL", "self._tzinfo.tzname(None)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.dst" ], [ "CALL", "self._tzinfo.dst(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "STORE_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h += 128" ], [ "STORE_FAST", "h" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_NAME", "\"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_OP", "date.__slots__ + time.__slots__" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "STORE_NAME", " def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)" ], [ "STORE_NAME", " def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()" ], [ "STORE_NAME", " def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "STORE_NAME", " def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)" ], [ "STORE_NAME", " def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "STORE_NAME", " def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)" ], [ "STORE_NAME", " def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "STORE_NAME", " def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SLICE", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "BINARY_OP", "ord(year[2:3])&0x7F" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL", "bytes(year, 'latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "month" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "STORE_FAST", "microsecond" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL", "_math.modf(t)" ], [ "STORE_FAST", "frac" ], [ "STORE_FAST", "t" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_OP", "frac * 1e6" ], [ "CALL", "round(frac * 1e6)" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t += 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us -= 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t -= 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us += 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "STORE_FAST", "converter" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL", "converter(t)" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "weekday" ], [ "STORE_FAST", "jday" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL", "min(ss, 59)" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "utc" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_ATTR", "sys.platform.startswith" ], [ "CALL", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_OP", "t - max_fold_seconds" ], [ "CALL", "converter(t - max_fold_seconds)" ], [ "BINARY_SLICE", "converter(t - max_fold_seconds)[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_OP", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL", "timedelta(0, max_fold_seconds)" ], [ "BINARY_OP", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "STORE_FAST", "trans" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "trans // timedelta(0, 1)" ], [ "BINARY_OP", "t + trans // timedelta(0, 1)" ], [ "CALL", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SLICE", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe2" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_ATTR", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL", "tz.fromutc(result)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_find_isoformat_datetime_separator(date_string)" ], [ "STORE_FAST", "separator_location" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SLICE", "date_string[0:separator_location]" ], [ "STORE_FAST", "dstr" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_OP", "separator_location+1" ], [ "BINARY_SLICE", "date_string[(separator_location+1):]" ], [ "STORE_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL", "_parse_isoformat_date(dstr)" ], [ "STORE_FAST", "date_components" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "_parse_isoformat_time(tstr)" ], [ "STORE_FAST", "time_components" ], [ "STORE_FAST", "time_components" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_components" ], [ "LOAD_FAST", "time_components" ], [ "BINARY_OP", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dst" ], [ "CALL", "self.dst()" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "datetime(1970, 1, 1)" ], [ "STORE_DEREF", "epoch" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(self - epoch) // timedelta(0, 1)" ], [ "STORE_FAST", "t" ], [ "STORE_FAST", " def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "local(t) - t" ], [ "STORE_FAST", "a" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "a" ], [ "BINARY_OP", "t - a" ], [ "STORE_FAST", "u1" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL", "local(u1)" ], [ "STORE_FAST", "t1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_OP", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_OP", "local(u2) - u2" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "u1" ], [ "BINARY_OP", "t1 - u1" ], [ "STORE_FAST", "b" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "b" ], [ "BINARY_OP", "t - b" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "STORE_FAST", "t2" ], [ "LOAD_FAST", "t2" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "u2" ], [ "CALL", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL", "_time.localtime(u)" ], [ "BINARY_SLICE", "_time.localtime(u)[:6]" ], [ "STORE_FAST", "y" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "hh" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "ss" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_OP", "self.microsecond / 1e6" ], [ "BINARY_OP", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_ATTR", "(self - _EPOCH).total_seconds" ], [ "CALL", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "offset" ], [ "BINARY_OP", "self -= offset" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "m" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "ss" ], [ "STORE_FAST", "mm" ], [ "STORE_FAST", "hh" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "ts" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(seconds=1)" ], [ "BINARY_OP", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "STORE_FAST", "ts" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL", "_time.localtime(ts)" ], [ "STORE_FAST", "localtm" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SLICE", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "STORE_FAST", "local" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "STORE_FAST", "gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "STORE_FAST", "zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "myoffset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL", "self.replace(tzinfo=None)" ], [ "LOAD_ATTR", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL", "self.replace(tzinfo=None)._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "myoffset" ], [ "BINARY_OP", "self - myoffset" ], [ "LOAD_ATTR", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL", "(self - myoffset).replace(tzinfo=tz)" ], [ "STORE_FAST", "utc" ], [ "LOAD_FAST", "tz" ], [ "LOAD_ATTR", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "STORE_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_ATTR", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL", "map(str, L)" ], [ "CALL", "\", \".join(map(str, L))" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.isoformat" ], [ "CALL", "self.isoformat(sep=' ')" ], [ "STORE_FAST", "import _strptime" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_ATTR", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "format" ], [ "CALL", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.utcoffset(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.tzname(self)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.dst(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "STORE_FAST", "myoff" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL", "self.replace(fold=not self.fold)" ], [ "LOAD_ATTR", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL", "other.replace(fold=not other.fold)" ], [ "LOAD_ATTR", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self - other" ], [ "STORE_FAST", "diff" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "STORE_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "delta += other" ], [ "STORE_FAST", "delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL", "divmod(delta.seconds, 3600)" ], [ "STORE_FAST", "hour" ], [ "STORE_FAST", "rem" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL", "divmod(rem, 60)" ], [ "STORE_FAST", "minute" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_ATTR", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_ATTR", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_OP", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._minute * 60" ], [ "BINARY_OP", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 3600" ], [ "BINARY_OP", "self._second + self._minute * 60 + self._hour * 3600" ], [ "STORE_FAST", "secs1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._minute * 60" ], [ "BINARY_OP", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 3600" ], [ "BINARY_OP", "other._second + other._minute * 60 + other._hour * 3600" ], [ "STORE_FAST", "secs2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_OP", "days1 - days2" ], [ "LOAD_FAST", "secs1" ], [ "LOAD_FAST", "secs2" ], [ "BINARY_OP", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_OP", "self._microsecond - other._microsecond" ], [ "CALL", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "STORE_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "IS_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "otoff" ], [ "BINARY_OP", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_OP", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL", "_ymd2ord(self.year, self.month, self.day)" ], [ "STORE_FAST", "days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_OP", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_OP", "self.minute * 60" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "STORE_FAST", "seconds" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m += 128" ], [ "STORE_FAST", "m" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_FAST", "yhi" ], [ "STORE_FAST", "ylo" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us1" ], [ "STORE_FAST", "us2" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_FAST", "THURSDAY" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "STORE_FAST", "firstday" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_OP", "firstday + 6" ], [ "BINARY_OP", "(firstday + 6) % 7" ], [ "STORE_FAST", "firstweekday" ], [ "LOAD_FAST", "firstday" ], [ "LOAD_FAST", "firstweekday" ], [ "BINARY_OP", "firstday - firstweekday" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_FAST", "firstweekday" ], [ "LOAD_FAST", "THURSDAY" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "week1monday += 7" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_FAST", "week1monday" ], [ "STORE_NAME", "__slots__" ], [ "LOAD_NAME", "object" ], [ "CALL", "object()" ], [ "STORE_NAME", "_Omitted" ], [ "LOAD_NAME", "_Omitted" ], [ "STORE_NAME", " def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self" ], [ "STORE_NAME", " def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented" ], [ "STORE_NAME", " def __hash__(self):\n return hash(self._offset)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "STORE_NAME", " def __str__(self):\n return self.tzname(None)" ], [ "STORE_NAME", " def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(hours=24, microseconds=-1)" ], [ "STORE_NAME", "_maxoffset" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "STORE_NAME", "_minoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "IS_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._create" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "name" ], [ "CALL", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_ATTR", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "tzinfo.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "hash(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utc" ], [ "IS_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BUILD_STRING", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BUILD_STRING", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzname" ], [ "CALL", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_OP", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "STORE_FAST", "delta" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(hours=1)" ], [ "CALL", "divmod(delta, timedelta(hours=1))" ], [ "STORE_FAST", "hours" ], [ "STORE_FAST", "rest" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "STORE_FAST", "minutes" ], [ "STORE_FAST", "rest" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}'" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}'" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-3.13.json000066400000000000000000016041311474076367500247610ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"Concrete date/time and related types.\n\nSee http://www.iana.org/time-zones/repository/tz-link.html for\ntime zone and DST data sources.\n\"\"\"" ], [ "STORE_NAME", "__all__" ], [ "STORE_NAME", "import time as _time" ], [ "STORE_NAME", "import math as _math" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from operator import index as _index" ], [ "STORE_NAME", "def _cmp(x, y):\n return 0 if x == y else 1 if x > y else -1" ], [ "STORE_NAME", "MINYEAR" ], [ "STORE_NAME", "MAXYEAR" ], [ "STORE_NAME", "_MAXORDINAL" ], [ "STORE_NAME", "_DAYS_IN_MONTH" ], [ "STORE_NAME", "_DAYS_BEFORE_MONTH" ], [ "STORE_NAME", "dbm" ], [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SLICE", "_DAYS_IN_MONTH[1:]" ], [ "STORE_NAME", "dim" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_ATTR", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dbm" ], [ "LOAD_NAME", "dim" ], [ "BINARY_OP", "dbm += dim" ], [ "STORE_NAME", "dbm" ], [ "DELETE_NAME", "dbm" ], [ "DELETE_NAME", "dim" ], [ "STORE_NAME", "def _is_leap(year):\n \"year -> 1 if leap year, else 0.\"\n return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0)" ], [ "STORE_NAME", "def _days_before_year(year):\n \"year -> number of days before January 1st of year.\"\n y = year - 1\n return y*365 + y//4 - y//100 + y//400" ], [ "STORE_NAME", "def _days_in_month(year, month):\n \"year, month -> number of days in that month in that year.\"\n assert 1 <= month <= 12, month\n if month == 2 and _is_leap(year):\n return 29\n return _DAYS_IN_MONTH[month]" ], [ "STORE_NAME", "def _days_before_month(year, month):\n \"year, month -> number of days in year preceding first day of month.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "STORE_NAME", "def _ymd2ord(year, month, day):\n \"year, month, day -> ordinal, considering 01-Jan-0001 as day 1.\"\n assert 1 <= month <= 12, 'month must be in 1..12'\n dim = _days_in_month(year, month)\n assert 1 <= day <= dim, ('day must be in 1..%d' % dim)\n return (_days_before_year(year) +\n _days_before_month(year, month) +\n day)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(401)" ], [ "STORE_NAME", "_DI400Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(101)" ], [ "STORE_NAME", "_DI100Y" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL", "_days_before_year(5)" ], [ "STORE_NAME", "_DI4Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_OP", "4 * _DI100Y" ], [ "BINARY_OP", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_OP", "25 * _DI4Y" ], [ "BINARY_OP", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "STORE_NAME", "def _ord2ymd(n):\n \"ordinal -> (year, month, day), considering 01-Jan-0001 as day 1.\"\n\n # n is a 1-based index, starting at 1-Jan-1. The pattern of leap years\n # repeats exactly every 400 years. The basic strategy is to find the\n # closest 400-year boundary at or before n, then work with the offset\n # from that boundary to n. Life is much clearer if we subtract 1 from\n # n first -- then the values of n at 400-year boundaries are exactly\n # those divisible by _DI400Y:\n #\n # D M Y n n-1\n # -- --- ---- ---------- ----------------\n # 31 Dec -400 -_DI400Y -_DI400Y -1\n # 1 Jan -399 -_DI400Y +1 -_DI400Y 400-year boundary\n # ...\n # 30 Dec 000 -1 -2\n # 31 Dec 000 0 -1\n # 1 Jan 001 1 0 400-year boundary\n # 2 Jan 001 2 1\n # 3 Jan 001 3 2\n # ...\n # 31 Dec 400 _DI400Y _DI400Y -1\n # 1 Jan 401 _DI400Y +1 _DI400Y 400-year boundary\n n -= 1\n n400, n = divmod(n, _DI400Y)\n year = n400 * 400 + 1 # ..., -399, 1, 401, ...\n\n # Now n is the (non-negative) offset, in days, from January 1 of year, to\n # the desired date. Now compute how many 100-year cycles precede n.\n # Note that it's possible for n100 to equal 4! In that case 4 full\n # 100-year cycles precede the desired day, which implies the desired\n # day is December 31 at the end of a 400-year cycle.\n n100, n = divmod(n, _DI100Y)\n\n # Now compute how many 4-year cycles precede it.\n n4, n = divmod(n, _DI4Y)\n\n # And now how many single years. Again n1 can be 4, and again meaning\n # that the desired day is December 31 at the end of the 4-year cycle.\n n1, n = divmod(n, 365)\n\n year += n100 * 100 + n4 * 4 + n1\n if n1 == 4 or n100 == 4:\n assert n == 0\n return year-1, 12, 31\n\n # Now the year is correct, and n is the offset from January 1. We find\n # the month via an estimate that's either exact or one too large.\n leapyear = n1 == 3 and (n4 != 24 or n100 == 3)\n assert leapyear == _is_leap(year)\n month = (n + 50) >> 5\n preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)\n if preceding > n: # estimate is too large\n month -= 1\n preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)\n n -= preceding\n assert 0 <= n < _days_in_month(year, month)\n\n # Now the year and month are correct, and n is the offset from the\n # start of that month: we're done!\n return year, month, n+1" ], [ "STORE_NAME", "_MONTHNAMES" ], [ "STORE_NAME", "_DAYNAMES" ], [ "STORE_NAME", "def _build_struct_time(y, m, d, hh, mm, ss, dstflag):\n wday = (_ymd2ord(y, m, d) + 6) % 7\n dnum = _days_before_month(y, m) + d\n return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_NAME", "def _format_time(hh, mm, ss, us, timespec='auto'):\n specs = {\n 'hours': '{:02d}',\n 'minutes': '{:02d}:{:02d}',\n 'seconds': '{:02d}:{:02d}:{:02d}',\n 'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}',\n 'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}'\n }\n\n if timespec == 'auto':\n # Skip trailing microseconds when us==0.\n timespec = 'microseconds' if us else 'seconds'\n elif timespec == 'milliseconds':\n us //= 1000\n try:\n fmt = specs[timespec]\n except KeyError:\n raise ValueError('Unknown timespec value')\n else:\n return fmt.format(hh, mm, ss, us)" ], [ "STORE_NAME", "def _format_offset(off):\n s = ''\n if off is not None:\n if off.days < 0:\n sign = \"-\"\n off = -off\n else:\n sign = \"+\"\n hh, mm = divmod(off, timedelta(hours=1))\n mm, ss = divmod(mm, timedelta(minutes=1))\n s += \"%s%02d:%02d\" % (sign, hh, mm)\n if ss or ss.microseconds:\n s += \":%02d\" % ss.seconds\n\n if ss.microseconds:\n s += '.%06d' % ss.microseconds\n return s" ], [ "STORE_NAME", "def _wrap_strftime(object, format, timetuple):\n # Don't call utcoffset() or tzname() unless actually needed.\n freplace = None # the string to use for %f\n zreplace = None # the string to use for %z\n Zreplace = None # the string to use for %Z\n\n # Scan format for %z and %Z escapes, replacing as needed.\n newformat = []\n push = newformat.append\n i, n = 0, len(format)\n while i < n:\n ch = format[i]\n i += 1\n if ch == '%':\n if i < n:\n ch = format[i]\n i += 1\n if ch == 'f':\n if freplace is None:\n freplace = '%06d' % getattr(object,\n 'microsecond', 0)\n newformat.append(freplace)\n elif ch == 'z':\n if zreplace is None:\n zreplace = \"\"\n if hasattr(object, \"utcoffset\"):\n offset = object.utcoffset()\n if offset is not None:\n sign = '+'\n if offset.days < 0:\n offset = -offset\n sign = '-'\n h, rest = divmod(offset, timedelta(hours=1))\n m, rest = divmod(rest, timedelta(minutes=1))\n s = rest.seconds\n u = offset.microseconds\n if u:\n zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u)\n elif s:\n zreplace = '%c%02d%02d%02d' % (sign, h, m, s)\n else:\n zreplace = '%c%02d%02d' % (sign, h, m)\n assert '%' not in zreplace\n newformat.append(zreplace)\n elif ch == 'Z':\n if Zreplace is None:\n Zreplace = \"\"\n if hasattr(object, \"tzname\"):\n s = object.tzname()\n if s is not None:\n # strftime is going to have at this: escape %\n Zreplace = s.replace('%', '%%')\n newformat.append(Zreplace)\n else:\n push('%')\n push(ch)\n else:\n push('%')\n else:\n push(ch)\n newformat = \"\".join(newformat)\n return _time.strftime(newformat, timetuple)" ], [ "STORE_NAME", "def _is_ascii_digit(c):\n return c in \"0123456789\"" ], [ "STORE_NAME", "def _find_isoformat_datetime_separator(dtstr):\n # See the comment in _datetimemodule.c:_find_isoformat_datetime_separator\n len_dtstr = len(dtstr)\n if len_dtstr == 7:\n return 7\n\n assert len_dtstr > 7\n date_separator = \"-\"\n week_indicator = \"W\"\n\n if dtstr[4] == date_separator:\n if dtstr[5] == week_indicator:\n if len_dtstr < 8:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 8 and dtstr[8] == date_separator:\n if len_dtstr == 9:\n raise ValueError(\"Invalid ISO string\")\n if len_dtstr > 10 and _is_ascii_digit(dtstr[10]):\n # This is as far as we need to resolve the ambiguity for\n # the moment - if we have YYYY-Www-##, the separator is\n # either a hyphen at 8 or a number at 10.\n #\n # We'll assume it's a hyphen at 8 because it's way more\n # likely that someone will use a hyphen as a separator than\n # a number, but at this point it's really best effort\n # because this is an extension of the spec anyway.\n # TODO(pganssle): Document this\n return 8\n return 10\n else:\n # YYYY-Www (8)\n return 8\n else:\n # YYYY-MM-DD (10)\n return 10\n else:\n if dtstr[4] == week_indicator:\n # YYYYWww (7) or YYYYWwwd (8)\n idx = 7\n while idx < len_dtstr:\n if not _is_ascii_digit(dtstr[idx]):\n break\n idx += 1\n\n if idx < 9:\n return idx\n\n if idx % 2 == 0:\n # If the index of the last number is even, it's YYYYWwwd\n return 7\n else:\n return 8\n else:\n # YYYYMMDD (8)\n return 8" ], [ "STORE_NAME", "def _parse_isoformat_date(dtstr):\n # It is assumed that this is an ASCII-only string of lengths 7, 8 or 10,\n # see the comment on Modules/_datetimemodule.c:_find_isoformat_datetime_separator\n assert len(dtstr) in (7, 8, 10)\n year = int(dtstr[0:4])\n has_sep = dtstr[4] == '-'\n\n pos = 4 + has_sep\n if dtstr[pos:pos + 1] == \"W\":\n # YYYY-?Www-?D?\n pos += 1\n weekno = int(dtstr[pos:pos + 2])\n pos += 2\n\n dayno = 1\n if len(dtstr) > pos:\n if (dtstr[pos:pos + 1] == '-') != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n\n dayno = int(dtstr[pos:pos + 1])\n\n return list(_isoweek_to_gregorian(year, weekno, dayno))\n else:\n month = int(dtstr[pos:pos + 2])\n pos += 2\n if (dtstr[pos:pos + 1] == \"-\") != has_sep:\n raise ValueError(\"Inconsistent use of dash separator\")\n\n pos += has_sep\n day = int(dtstr[pos:pos + 2])\n\n return [year, month, day]" ], [ "STORE_NAME", "_FRACTION_CORRECTION" ], [ "STORE_NAME", "def _parse_hh_mm_ss_ff(tstr):\n # Parses things of the form HH[:?MM[:?SS[{.,}fff[fff]]]]\n len_str = len(tstr)\n\n time_comps = [0, 0, 0, 0]\n pos = 0\n for comp in range(0, 3):\n if (len_str - pos) < 2:\n raise ValueError(\"Incomplete time component\")\n\n time_comps[comp] = int(tstr[pos:pos+2])\n\n pos += 2\n next_char = tstr[pos:pos+1]\n\n if comp == 0:\n has_sep = next_char == ':'\n\n if not next_char or comp >= 2:\n break\n\n if has_sep and next_char != ':':\n raise ValueError(\"Invalid time separator: %c\" % next_char)\n\n pos += has_sep\n\n if pos < len_str:\n if tstr[pos] not in '.,':\n raise ValueError(\"Invalid microsecond component\")\n else:\n pos += 1\n\n len_remainder = len_str - pos\n\n if len_remainder >= 6:\n to_parse = 6\n else:\n to_parse = len_remainder\n\n time_comps[3] = int(tstr[pos:(pos+to_parse)])\n if to_parse < 6:\n time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]\n if (len_remainder > to_parse\n and not all(map(_is_ascii_digit, tstr[(pos+to_parse):]))):\n raise ValueError(\"Non-digit values in unparsed fraction\")\n\n return time_comps" ], [ "STORE_NAME", "def _parse_isoformat_time(tstr):\n # Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]]\n len_str = len(tstr)\n if len_str < 2:\n raise ValueError(\"Isoformat time too short\")\n\n # This is equivalent to re.search('[+-Z]', tstr), but faster\n tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1 or tstr.find('Z') + 1)\n timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr\n\n time_comps = _parse_hh_mm_ss_ff(timestr)\n\n tzi = None\n if tz_pos == len_str and tstr[-1] == 'Z':\n tzi = timezone.utc\n elif tz_pos > 0:\n tzstr = tstr[tz_pos:]\n\n # Valid time zone strings are:\n # HH len: 2\n # HHMM len: 4\n # HH:MM len: 5\n # HHMMSS len: 6\n # HHMMSS.f+ len: 7+\n # HH:MM:SS len: 8\n # HH:MM:SS.f+ len: 10+\n\n if len(tzstr) in (0, 1, 3):\n raise ValueError(\"Malformed time zone string\")\n\n tz_comps = _parse_hh_mm_ss_ff(tzstr)\n\n if all(x == 0 for x in tz_comps):\n tzi = timezone.utc\n else:\n tzsign = -1 if tstr[tz_pos - 1] == '-' else 1\n\n td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])\n\n tzi = timezone(tzsign * td)\n\n time_comps.append(tzi)\n\n return time_comps" ], [ "STORE_NAME", "def _isoweek_to_gregorian(year, week, day):\n # Year is bounded this way because 9999-12-31 is (9999, 52, 5)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError(f\"Year is out of range: {year}\")\n\n if not 0 < week < 53:\n out_of_range = True\n\n if week == 53:\n # ISO years have 53 weeks in them on years starting with a\n # Thursday and leap years starting on a Wednesday\n first_weekday = _ymd2ord(year, 1, 1) % 7\n if (first_weekday == 4 or (first_weekday == 3 and\n _is_leap(year))):\n out_of_range = False\n\n if out_of_range:\n raise ValueError(f\"Invalid week: {week}\")\n\n if not 0 < day < 8:\n raise ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")\n\n # Now compute the offset from (Y, 1, 1) in days:\n day_offset = (week - 1) * 7 + (day - 1)\n\n # Calculate the ordinal day for monday, week 1\n day_1 = _isoweek1monday(year)\n ord_day = day_1 + day_offset\n\n return _ord2ymd(ord_day)" ], [ "STORE_NAME", "def _check_tzname(name):\n if name is not None and not isinstance(name, str):\n raise TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "STORE_NAME", "def _check_utc_offset(name, offset):\n assert name in (\"utcoffset\", \"dst\")\n if offset is None:\n return\n if not isinstance(offset, timedelta):\n raise TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))\n if not -timedelta(1) < offset < timedelta(1):\n raise ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "STORE_NAME", "def _check_date_fields(year, month, day):\n year = _index(year)\n month = _index(month)\n day = _index(day)\n if not MINYEAR <= year <= MAXYEAR:\n raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)\n if not 1 <= month <= 12:\n raise ValueError('month must be in 1..12', month)\n dim = _days_in_month(year, month)\n if not 1 <= day <= dim:\n raise ValueError('day must be in 1..%d' % dim, day)\n return year, month, day" ], [ "STORE_NAME", "def _check_time_fields(hour, minute, second, microsecond, fold):\n hour = _index(hour)\n minute = _index(minute)\n second = _index(second)\n microsecond = _index(microsecond)\n if not 0 <= hour <= 23:\n raise ValueError('hour must be in 0..23', hour)\n if not 0 <= minute <= 59:\n raise ValueError('minute must be in 0..59', minute)\n if not 0 <= second <= 59:\n raise ValueError('second must be in 0..59', second)\n if not 0 <= microsecond <= 999999:\n raise ValueError('microsecond must be in 0..999999', microsecond)\n if fold not in (0, 1):\n raise ValueError('fold must be either 0 or 1', fold)\n return hour, minute, second, microsecond, fold" ], [ "STORE_NAME", "def _check_tzinfo_arg(tz):\n if tz is not None and not isinstance(tz, tzinfo):\n raise TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "STORE_NAME", "def _cmperror(x, y):\n raise TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "STORE_NAME", "def _divide_and_round(a, b):\n \"\"\"divide a by b and round result to the nearest integer\n\n When the ratio is exactly half-way between two integers,\n the even integer is returned.\n \"\"\"\n # Based on the reference implementation for divmod_near\n # in Objects/longobject.c.\n q, r = divmod(a, b)\n # round up if either r / b > 0.5, or r / b == 0.5 and q is odd.\n # The expression r / b > 0.5 is equivalent to 2 * r > b if b is\n # positive, 2 * r < b if b negative.\n r *= 2\n greater_than_half = r > b if b > 0 else r < b\n if greater_than_half or r == b and q % 2 == 1:\n q += 1\n\n return q" ], [ "CALL", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class timedelta:\n \"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"\n __slots__ = '_days', '_seconds', '_microseconds', '_hashcode'\n\n def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self\n\n def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))\n\n def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s\n\n def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6\n\n # Read-only field accessors\n @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days\n\n @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds\n\n @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds\n\n def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented\n\n def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented\n\n def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)\n\n def __pos__(self):\n return self\n\n def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self\n\n def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented\n\n __rmul__ = __mul__\n\n def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)\n\n def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)\n\n def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))\n\n def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented\n\n def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented\n\n # Comparisons of timedelta objects with other.\n\n def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())\n\n def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)\n\n # Pickle support.\n\n def _getstate(self):\n return (self._days, self._seconds, self._microseconds)\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "CALL", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", "class date:\n \"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"\n __slots__ = '_year', '_month', '_day', '_hashcode'\n\n def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self\n\n # Additional constructors\n\n @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)\n\n @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)\n\n @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))\n\n # Conversions to string\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)\n # XXX These shouldn't depend on time.localtime(), because that\n # clips the usable dates to [1970 .. 2038). At least ctime() is\n # easily done without using strftime() -- that's better too because\n # strftime(\"%c\", ...) is locale specific.\n\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)\n\n def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)\n\n __str__ = isoformat\n\n # Read-only field accessors\n @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year\n\n @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month\n\n @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day\n\n # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__,\n # __hash__ (and helpers)\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)\n\n def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)\n\n def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)\n\n # Comparisons of date objects with other.\n\n def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented\n\n def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))\n\n def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode\n\n # Computations\n\n def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented\n\n def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7\n\n # Day-of-the-week and week-of-the-year, according to ISO\n\n def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7\n\n def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)\n\n # Pickle support.\n\n def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day]),\n\n def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo\n\n def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_NAME", "date" ], [ "STORE_NAME", "_date_class" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "CALL", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "STORE_NAME", "class tzinfo:\n \"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"\n __slots__ = ()\n\n def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")\n\n def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")\n\n def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")\n\n def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst\n\n # Pickle support.\n\n def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_NAME", "tuple" ], [ "CALL", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "STORE_NAME", "class IsoCalendarDate(tuple):\n\n def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))\n\n @property\n def year(self):\n return self[0]\n\n @property\n def week(self):\n return self[1]\n\n @property\n def weekday(self):\n return self[2]\n\n def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))\n\n def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "STORE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "STORE_NAME", "_tzinfo_class" ], [ "CALL", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class time:\n \"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"\n __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold'\n\n def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n # Standard conversions, __hash__ (and helpers)\n\n # Comparisons of time objects with other.\n\n def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented\n\n def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented\n\n def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented\n\n def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented\n\n def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))\n\n def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode\n\n # Conversion to string\n\n def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s\n\n __str__ = isoformat\n\n @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')\n\n\n def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)\n\n def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)\n\n # Timezone functions\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "time" ], [ "STORE_NAME", "_time_class" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "CALL", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", "class datetime(date):\n \"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"\n __slots__ = date.__slots__ + time.__slots__\n\n def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self\n\n # Read-only field accessors\n @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour\n\n @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute\n\n @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second\n\n @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond\n\n @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo\n\n @property\n def fold(self):\n return self._fold\n\n @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result\n\n @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)\n\n @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)\n\n @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)\n\n @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)\n\n @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)\n\n @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))\n\n def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)\n\n def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)\n\n\n def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()\n\n def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)\n\n def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)\n\n def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)\n\n def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)\n\n def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)\n\n def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)\n\n def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)\n\n # Ways to produce a string.\n\n def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)\n\n def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s\n\n def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')\n\n @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)\n\n def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset\n\n def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name\n\n def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset\n\n # Comparisons of datetime objects with other.\n\n def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False\n\n def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)\n\n def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0\n\n def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")\n\n __radd__ = __add__\n\n def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff\n\n def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode\n\n # Pickle support.\n\n def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)\n\n def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo\n\n def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))\n\n def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "STORE_NAME", "def _isoweek1monday(year):\n # Helper to calculate the day number of the Monday starting week 1\n # XXX This could be done more efficiently\n THURSDAY = 3\n firstday = _ymd2ord(year, 1, 1)\n firstweekday = (firstday + 6) % 7 # See weekday() above\n week1monday = firstday - firstweekday\n if firstweekday > THURSDAY:\n week1monday += 7\n return week1monday" ], [ "LOAD_NAME", "tzinfo" ], [ "CALL", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "STORE_NAME", "class timezone(tzinfo):\n __slots__ = '_offset', '_name'\n\n # Sentinel value to disallow None\n _Omitted = object()\n def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)\n\n @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self\n\n def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)\n\n def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented\n\n def __hash__(self):\n return hash(self._offset)\n\n def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)\n\n def __str__(self):\n return self.tzname(None)\n\n def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")\n\n def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")\n\n def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")\n\n def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")\n\n _maxoffset = timedelta(hours=24, microseconds=-1)\n _minoffset = -_maxoffset\n\n @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "CALL", "timezone._create(timedelta(0))" ], [ "STORE_NAME", "UTC" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(hours=23, minutes=59)" ], [ "CALL", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL_KW", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "STORE_NAME", "_EPOCH" ], [ "CALL_INTRINSIC_1", "from _datetime import *" ], [ "DELETE_NAME", "_DAYNAMES" ], [ "DELETE_NAME", "_DAYS_BEFORE_MONTH" ], [ "DELETE_NAME", "_DAYS_IN_MONTH" ], [ "DELETE_NAME", "_DI100Y" ], [ "DELETE_NAME", "_DI400Y" ], [ "DELETE_NAME", "_DI4Y" ], [ "DELETE_NAME", "_EPOCH" ], [ "DELETE_NAME", "_MAXORDINAL" ], [ "DELETE_NAME", "_MONTHNAMES" ], [ "DELETE_NAME", "_build_struct_time" ], [ "DELETE_NAME", "_check_date_fields" ], [ "DELETE_NAME", "_check_time_fields" ], [ "DELETE_NAME", "_check_tzinfo_arg" ], [ "DELETE_NAME", "_check_tzname" ], [ "DELETE_NAME", "_check_utc_offset" ], [ "DELETE_NAME", "_cmp" ], [ "DELETE_NAME", "_cmperror" ], [ "DELETE_NAME", "_date_class" ], [ "DELETE_NAME", "_days_before_month" ], [ "DELETE_NAME", "_days_before_year" ], [ "DELETE_NAME", "_days_in_month" ], [ "DELETE_NAME", "_format_time" ], [ "DELETE_NAME", "_format_offset" ], [ "DELETE_NAME", "_index" ], [ "DELETE_NAME", "_is_leap" ], [ "DELETE_NAME", "_isoweek1monday" ], [ "DELETE_NAME", "_math" ], [ "DELETE_NAME", "_ord2ymd" ], [ "DELETE_NAME", "_time" ], [ "DELETE_NAME", "_time_class" ], [ "DELETE_NAME", "_tzinfo_class" ], [ "DELETE_NAME", "_wrap_strftime" ], [ "DELETE_NAME", "_ymd2ord" ], [ "DELETE_NAME", "_divide_and_round" ], [ "DELETE_NAME", "_parse_isoformat_date" ], [ "DELETE_NAME", "_parse_isoformat_time" ], [ "DELETE_NAME", "_parse_hh_mm_ss_ff" ], [ "DELETE_NAME", "_IsoCalendarDate" ], [ "DELETE_NAME", "_isoweek_to_gregorian" ], [ "DELETE_NAME", "_find_isoformat_datetime_separator" ], [ "DELETE_NAME", "_FRACTION_CORRECTION" ], [ "DELETE_NAME", "_is_ascii_digit" ], [ "STORE_NAME", "from _datetime import __doc__" ], [ "LOAD_NAME", "ImportError" ], [ "COMPARE_OP", "x == y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year - 1" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//4" ], [ "BINARY_OP", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//100" ], [ "BINARY_OP", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_OP", "y//400" ], [ "BINARY_OP", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "CALL", "_days_before_month(year, month)" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n -= 1" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL", "divmod(n, _DI400Y)" ], [ "LOAD_FAST", "n400" ], [ "BINARY_OP", "n400 * 400" ], [ "BINARY_OP", "n400 * 400 + 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL", "divmod(n, _DI100Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL", "divmod(n, _DI4Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL", "divmod(n, 365)" ], [ "BINARY_OP", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_OP", "n4 * 4" ], [ "BINARY_OP", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_OP", "n100 * 100 + n4 * 4 + n1" ], [ "BINARY_OP", "year += n100 * 100 + n4 * 4 + n1" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "STORE_FAST", "leapyear" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n + 50" ], [ "BINARY_OP", "(n + 50) >> 5" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_FAST", "month" ], [ "BINARY_OP", "month -= 1" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_OP", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "BINARY_OP", "preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "STORE_FAST", "preceding" ], [ "BINARY_OP", "n -= preceding" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "CALL", "_days_in_month(year, month)" ], [ "COMPARE_OP", "0 <= n < _days_in_month(year, month)" ], [ "LOAD_FAST", "n" ], [ "BINARY_OP", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "d" ], [ "CALL", "_ymd2ord(y, m, d)" ], [ "BINARY_OP", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_OP", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "STORE_FAST", "wday" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "CALL", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "_days_before_month(y, m) + d" ], [ "STORE_FAST", "dnum" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.struct_time" ], [ "LOAD_FAST", "dstflag" ], [ "CALL", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "STORE_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "STORE_FAST", "timespec" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us //= 1000" ], [ "STORE_FAST", "us" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "STORE_FAST", "fmt" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_ATTR", "fmt.format" ], [ "CALL", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('Unknown timespec value')" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "off" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "STORE_FAST", "off" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(hours=1)" ], [ "CALL", "divmod(off, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "CALL", "divmod(mm, timedelta(minutes=1))" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "mm" ], [ "BINARY_OP", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "BINARY_OP", "s += \"%s%02d:%02d\" % (sign, hh, mm)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_OP", "\":%02d\" % ss.seconds" ], [ "BINARY_OP", "s += \":%02d\" % ss.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_OP", "'.%06d' % ss.microseconds" ], [ "BINARY_OP", "s += '.%06d' % ss.microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "STORE_FAST", "freplace" ], [ "STORE_FAST", "zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "STORE_FAST", "newformat" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "STORE_FAST", "push" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL", "len(format)" ], [ "COMPARE_OP", "i < n" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "COMPARE_OP", "i < n" ], [ "BINARY_SUBSCR", "format[i]" ], [ "STORE_FAST", "ch" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_OP", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "STORE_FAST", "freplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_ATTR", "object.utcoffset" ], [ "CALL", "object.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "STORE_FAST", "offset" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(hours=1)" ], [ "CALL", "divmod(offset, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "STORE_FAST", "u" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_OP", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "'%c%02d%02d' % (sign, h, m)" ], [ "STORE_FAST", "zreplace" ], [ "LOAD_FAST", "zreplace" ], [ "CONTAINS_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_ATTR", "object.tzname" ], [ "CALL", "object.tzname()" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.replace" ], [ "CALL", "s.replace('%', '%%')" ], [ "STORE_FAST", "Zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL", "push(ch)" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_ATTR", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL", "\"\".join(newformat)" ], [ "STORE_FAST", "newformat" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.strftime" ], [ "CALL", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "CONTAINS_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "STORE_FAST", "len_dtstr" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "STORE_FAST", "date_separator" ], [ "STORE_FAST", "week_indicator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "STORE_FAST", "idx" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx += 1" ], [ "STORE_FAST", "idx" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_OP", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "CONTAINS_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SLICE", "dtstr[0:4]" ], [ "CALL", "int(dtstr[0:4])" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_OP", "4 + has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "weekno" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "CALL", "int(dtstr[pos:pos + 1])" ], [ "STORE_FAST", "dayno" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "dayno" ], [ "CALL", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 1" ], [ "BINARY_SLICE", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Inconsistent use of dash separator\")" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos + 2" ], [ "BINARY_SLICE", "dtstr[pos:pos + 2]" ], [ "CALL", "int(dtstr[pos:pos + 2])" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "pos" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(0, 3)" ], [ "STORE_FAST", "comp" ], [ "BINARY_OP", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+2" ], [ "BINARY_SLICE", "tstr[pos:pos+2]" ], [ "CALL", "int(tstr[pos:pos+2])" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 2" ], [ "STORE_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos+1" ], [ "BINARY_SLICE", "tstr[pos:pos+1]" ], [ "STORE_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "STORE_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST_CHECK", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_OP", "\"Invalid time separator: %c\" % next_char" ], [ "CALL", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "BINARY_OP", "pos += has_sep" ], [ "STORE_FAST", "pos" ], [ "COMPARE_OP", "pos < len_str" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "CONTAINS_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "pos" ], [ "BINARY_OP", "pos += 1" ], [ "STORE_FAST", "pos" ], [ "BINARY_OP", "len_str - pos" ], [ "STORE_FAST", "len_remainder" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_FAST", "len_remainder" ], [ "STORE_FAST", "to_parse" ], [ "LOAD_GLOBAL", "int" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SLICE", "tstr[pos:(pos+to_parse)]" ], [ "CALL", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "BINARY_SUBSCR", "time_comps[3]" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "BINARY_OP", "time_comps[3] *= _FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_OP", "pos+to_parse" ], [ "BINARY_SLICE", "tstr[(pos+to_parse):]" ], [ "CALL", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "len(tstr)" ], [ "STORE_FAST", "len_str" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('-')" ], [ "BINARY_OP", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('+')" ], [ "BINARY_OP", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_ATTR", "tstr.find" ], [ "CALL", "tstr.find('Z')" ], [ "BINARY_OP", "tstr.find('Z') + 1" ], [ "STORE_FAST", "tz_pos" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_OP", "tz_pos-1" ], [ "BINARY_SLICE", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "STORE_FAST", "timestr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL", "_parse_hh_mm_ss_ff(timestr)" ], [ "STORE_FAST", "time_comps" ], [ "STORE_FAST", "tzi" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "BINARY_SLICE", "tstr[tz_pos:]" ], [ "STORE_FAST", "tzstr" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "len(tzstr)" ], [ "CONTAINS_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL", "_parse_hh_mm_ss_ff(tzstr)" ], [ "STORE_FAST", "tz_comps" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL", "(x == 0 for x in tz_comps)" ], [ "CALL", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "STORE_FAST", "tzi" ], [ "BINARY_OP", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "STORE_FAST", "tzsign" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL_KW", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "STORE_FAST", "td" ], [ "LOAD_GLOBAL", "timezone" ], [ "BINARY_OP", "tzsign * td" ], [ "CALL", "timezone(tzsign * td)" ], [ "STORE_FAST", "tzi" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_ATTR", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "(x == 0 for x in tz_comps)" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "year" ], [ "BUILD_STRING", "f\"Year is out of range: {year}\"" ], [ "CALL", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "0 < week < 53" ], [ "COMPARE_OP", "0 < week < 53" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "BINARY_OP", "_ymd2ord(year, 1, 1) % 7" ], [ "STORE_FAST", "first_weekday" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL", "_is_leap(year)" ], [ "STORE_FAST", "out_of_range" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "week" ], [ "BUILD_STRING", "f\"Invalid week: {week}\"" ], [ "CALL", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "0 < day < 8" ], [ "COMPARE_OP", "0 < day < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "day" ], [ "BUILD_STRING", "f\"Invalid weekday: {day} (range is [1, 7])\"" ], [ "CALL", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_OP", "week - 1" ], [ "BINARY_OP", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day - 1" ], [ "BINARY_OP", "(week - 1) * 7 + (day - 1)" ], [ "STORE_FAST", "day_offset" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "day_1" ], [ "BINARY_OP", "day_1 + day_offset" ], [ "STORE_FAST", "ord_day" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL", "type(name)" ], [ "BINARY_OP", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "CONTAINS_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL", "type(offset)" ], [ "BUILD_STRING", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(1)" ], [ "COMPARE_OP", "-timedelta(1) < offset < timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BUILD_STRING", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL", "_index(year)" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL", "_index(month)" ], [ "STORE_FAST", "month" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL", "_index(day)" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "COMPARE_OP", "MINYEAR <= year <= MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_OP", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "COMPARE_OP", "1 <= month <= 12" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "CALL", "_days_in_month(year, month)" ], [ "STORE_FAST", "dim" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_FAST", "dim" ], [ "COMPARE_OP", "1 <= day <= dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_OP", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL", "_index(hour)" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL", "_index(minute)" ], [ "STORE_FAST", "minute" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL", "_index(second)" ], [ "STORE_FAST", "second" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "_index(microsecond)" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "hour" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "COMPARE_OP", "0 <= hour <= 23" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "COMPARE_OP", "0 <= minute <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "COMPARE_OP", "0 <= second <= 59" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "COMPARE_OP", "0 <= microsecond <= 999999" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "CONTAINS_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BUILD_STRING", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "CALL", "divmod(a, b)" ], [ "LOAD_FAST", "r" ], [ "BINARY_OP", "r *= 2" ], [ "STORE_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "COMPARE_OP", "r > b" ], [ "COMPARE_OP", "r < b" ], [ "STORE_FAST", "greater_than_half" ], [ "LOAD_FAST", "greater_than_half" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "BINARY_OP", "q += 1" ], [ "STORE_FAST", "q" ], [ "LOAD_FAST", "q" ], [ "STORE_NAME", "\"\"\"Represent the difference between two datetime objects.\n\n Supported operators:\n\n - add, subtract timedelta\n - unary plus, minus, abs\n - compare to timedelta\n - multiply, divide by int\n\n In addition, datetime supports subtraction of two datetime objects\n returning a timedelta, and addition or subtraction of a datetime\n and a timedelta giving a datetime.\n\n Representation: (days, seconds, microseconds). Why? Because I\n felt like it.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, days=0, seconds=0, microseconds=0,\n milliseconds=0, minutes=0, hours=0, weeks=0):\n # Doing this efficiently and accurately in C is going to be difficult\n # and error-prone, due to ubiquitous overflow possibilities, and that\n # C double doesn't have enough bits of precision to represent\n # microseconds over 10K years faithfully. The code here tries to make\n # explicit where go-fast assumptions can be relied on, in order to\n # guide the C implementation; it's way more convoluted than speed-\n # ignoring auto-overflow-to-long idiomatic Python could be.\n\n # XXX Check that all inputs are ints or floats.\n\n # Final values, all integer.\n # s and us fit in 32-bit signed ints; d isn't bounded.\n d = s = us = 0\n\n # Normalize everything to days, seconds, microseconds.\n days += weeks*7\n seconds += minutes*60 + hours*3600\n microseconds += milliseconds*1000\n\n # Get rid of all fractions, and normalize s and us.\n # Take a deep breath .\n if isinstance(days, float):\n dayfrac, days = _math.modf(days)\n daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.))\n assert daysecondswhole == int(daysecondswhole) # can't overflow\n s = int(daysecondswhole)\n assert days == int(days)\n d = int(days)\n else:\n daysecondsfrac = 0.0\n d = days\n assert isinstance(daysecondsfrac, float)\n assert abs(daysecondsfrac) <= 1.0\n assert isinstance(d, int)\n assert abs(s) <= 24 * 3600\n # days isn't referenced again before redefinition\n\n if isinstance(seconds, float):\n secondsfrac, seconds = _math.modf(seconds)\n assert seconds == int(seconds)\n seconds = int(seconds)\n secondsfrac += daysecondsfrac\n assert abs(secondsfrac) <= 2.0\n else:\n secondsfrac = daysecondsfrac\n # daysecondsfrac isn't referenced again\n assert isinstance(secondsfrac, float)\n assert abs(secondsfrac) <= 2.0\n\n assert isinstance(seconds, int)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += int(seconds) # can't overflow\n assert isinstance(s, int)\n assert abs(s) <= 2 * 24 * 3600\n # seconds isn't referenced again before redefinition\n\n usdouble = secondsfrac * 1e6\n assert abs(usdouble) < 2.1e6 # exact value not critical\n # secondsfrac isn't referenced again\n\n if isinstance(microseconds, float):\n microseconds = round(microseconds + usdouble)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n else:\n microseconds = int(microseconds)\n seconds, microseconds = divmod(microseconds, 1000000)\n days, seconds = divmod(seconds, 24*3600)\n d += days\n s += seconds\n microseconds = round(microseconds + usdouble)\n assert isinstance(s, int)\n assert isinstance(microseconds, int)\n assert abs(s) <= 3 * 24 * 3600\n assert abs(microseconds) < 3.1e6\n\n # Just a little bit of carrying possible for microseconds and seconds.\n seconds, us = divmod(microseconds, 1000000)\n s += seconds\n days, s = divmod(s, 24*3600)\n d += days\n\n assert isinstance(d, int)\n assert isinstance(s, int) and 0 <= s < 24*3600\n assert isinstance(us, int) and 0 <= us < 1000000\n\n if abs(d) > 999999999:\n raise OverflowError(\"timedelta # of days is too large: %d\" % d)\n\n self = object.__new__(cls)\n self._days = d\n self._seconds = s\n self._microseconds = us\n self._hashcode = -1\n return self" ], [ "STORE_NAME", " def __repr__(self):\n args = []\n if self._days:\n args.append(\"days=%d\" % self._days)\n if self._seconds:\n args.append(\"seconds=%d\" % self._seconds)\n if self._microseconds:\n args.append(\"microseconds=%d\" % self._microseconds)\n if not args:\n args.append('0')\n return \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "STORE_NAME", " def __str__(self):\n mm, ss = divmod(self._seconds, 60)\n hh, mm = divmod(mm, 60)\n s = \"%d:%02d:%02d\" % (hh, mm, ss)\n if self._days:\n def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"\n s = (\"%d day%s, \" % plural(self._days)) + s\n if self._microseconds:\n s = s + \".%06d\" % self._microseconds\n return s" ], [ "STORE_NAME", " def total_seconds(self):\n \"\"\"Total seconds in the duration.\"\"\"\n return ((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def days(self):\n \"\"\"days\"\"\"\n return self._days" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def seconds(self):\n \"\"\"seconds\"\"\"\n return self._seconds" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microseconds(self):\n \"\"\"microseconds\"\"\"\n return self._microseconds" ], [ "STORE_NAME", " def __add__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n if isinstance(other, timedelta):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)\n return NotImplemented" ], [ "STORE_NAME", " def __rsub__(self, other):\n if isinstance(other, timedelta):\n return -self + other\n return NotImplemented" ], [ "STORE_NAME", " def __neg__(self):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "STORE_NAME", " def __pos__(self):\n return self" ], [ "STORE_NAME", " def __abs__(self):\n if self._days < 0:\n return -self\n else:\n return self" ], [ "STORE_NAME", " def __mul__(self, other):\n if isinstance(other, int):\n # for CPython compatibility, we cannot use\n # our __class__ here, but need a real timedelta\n return timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)\n if isinstance(other, float):\n usec = self._to_microseconds()\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(usec * a, b))\n return NotImplemented" ], [ "LOAD_NAME", "__mul__" ], [ "STORE_NAME", "__rmul__" ], [ "STORE_NAME", " def _to_microseconds(self):\n return ((self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds)" ], [ "STORE_NAME", " def __floordiv__(self, other):\n if not isinstance(other, (int, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec // other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, usec // other)" ], [ "STORE_NAME", " def __truediv__(self, other):\n if not isinstance(other, (int, float, timedelta)):\n return NotImplemented\n usec = self._to_microseconds()\n if isinstance(other, timedelta):\n return usec / other._to_microseconds()\n if isinstance(other, int):\n return timedelta(0, 0, _divide_and_round(usec, other))\n if isinstance(other, float):\n a, b = other.as_integer_ratio()\n return timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "STORE_NAME", " def __mod__(self, other):\n if isinstance(other, timedelta):\n r = self._to_microseconds() % other._to_microseconds()\n return timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __divmod__(self, other):\n if isinstance(other, timedelta):\n q, r = divmod(self._to_microseconds(),\n other._to_microseconds())\n return q, timedelta(0, 0, r)\n return NotImplemented" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, timedelta):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, timedelta)\n return _cmp(self._getstate(), other._getstate())" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __bool__(self):\n return (self._days != 0 or\n self._seconds != 0 or\n self._microseconds != 0)" ], [ "STORE_NAME", " def _getstate(self):\n return (self._days, self._seconds, self._microseconds)" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_FAST", "d" ], [ "BINARY_OP", "weeks*7" ], [ "BINARY_OP", "days += weeks*7" ], [ "STORE_FAST", "days" ], [ "BINARY_OP", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_OP", "hours*3600" ], [ "BINARY_OP", "minutes*60 + hours*3600" ], [ "BINARY_OP", "seconds += minutes*60 + hours*3600" ], [ "STORE_FAST", "seconds" ], [ "BINARY_OP", "milliseconds*1000" ], [ "BINARY_OP", "microseconds += milliseconds*1000" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL", "_math.modf(days)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_OP", "dayfrac * (24.*3600.)" ], [ "CALL", "_math.modf(dayfrac * (24.*3600.))" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL", "int(daysecondswhole)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL", "int(days)" ], [ "STORE_FAST", "d" ], [ "STORE_FAST", "daysecondsfrac" ], [ "LOAD_FAST", "days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "_math.modf(seconds)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "STORE_FAST", "seconds" ], [ "BINARY_OP", "secondsfrac += daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "STORE_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "int(seconds)" ], [ "BINARY_OP", "s += int(seconds)" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_OP", "secondsfrac * 1e6" ], [ "STORE_FAST", "usdouble" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "int(microseconds)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL", "divmod(seconds, 24*3600)" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "round" ], [ "BINARY_OP", "microseconds + usdouble" ], [ "CALL", "round(microseconds + usdouble)" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL", "divmod(microseconds, 1000000)" ], [ "BINARY_OP", "s += seconds" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL", "divmod(s, 24*3600)" ], [ "BINARY_OP", "d += days" ], [ "STORE_FAST", "d" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "COMPARE_OP", "0 <= s < 24*3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "COMPARE_OP", "0 <= us < 1000000" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_OP", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "\"days=%d\" % self._days" ], [ "CALL", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "\"seconds=%d\" % self._seconds" ], [ "CALL", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\"microseconds=%d\" % self._microseconds" ], [ "CALL", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.append" ], [ "CALL", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL", "', '.join(args)" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL", "divmod(self._seconds, 60)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL", "divmod(mm, 60)" ], [ "LOAD_FAST", "ss" ], [ "BINARY_OP", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "STORE_FAST", " def plural(n):\n return n, abs(n) != 1 and \"s\" or \"\"" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL", "plural(self._days)" ], [ "BINARY_OP", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "\".%06d\" % self._microseconds" ], [ "BINARY_OP", "s + \".%06d\" % self._microseconds" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_OP", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_OP", "self.days * 86400 + self.seconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_OP", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_OP", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds + other._microseconds" ], [ "CALL", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_OP", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_OP", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_OP", "self._microseconds - other._microseconds" ], [ "CALL", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_OP", "self._microseconds * other" ], [ "CALL", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "BINARY_OP", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL", "_divide_and_round(usec * a, b)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_OP", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_OP", "self._days * (24*3600) + self._seconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_OP", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "BINARY_OP", "usec // other" ], [ "CALL", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "STORE_FAST", "usec" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "CALL", "_divide_and_round(usec, other)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.as_integer_ratio" ], [ "CALL", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "BINARY_OP", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL", "_divide_and_round(b * usec, a)" ], [ "CALL", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "BINARY_OP", "self._to_microseconds() % other._to_microseconds()" ], [ "STORE_FAST", "r" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._to_microseconds" ], [ "CALL", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._to_microseconds" ], [ "CALL", "other._to_microseconds()" ], [ "CALL", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._getstate" ], [ "CALL", "other._getstate()" ], [ "CALL", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Concrete date type.\n\n Constructors:\n\n __new__()\n fromtimestamp()\n today()\n fromordinal()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n __add__, __radd__, __sub__ (add/radd only with timedelta arg)\n\n Methods:\n\n timetuple()\n toordinal()\n weekday()\n isoweekday(), isocalendar(), isoformat()\n ctime()\n strftime()\n\n Properties (readonly):\n year, month, day\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None):\n \"\"\"Constructor.\n\n Arguments:\n\n year, month, day (required, base 1)\n \"\"\"\n if (month is None and\n isinstance(year, (bytes, str)) and len(year) == 4 and\n 1 <= ord(year[2:3]) <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = year.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hashcode = -1\n return self" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t):\n \"Construct a date from a POSIX timestamp (like time.time()).\"\n y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def today(cls):\n \"Construct a date from time.time().\"\n t = _time.time()\n return cls.fromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromordinal(cls, n):\n \"\"\"Construct a date from a proleptic Gregorian ordinal.\n\n January 1 of year 1 is day 1. Only the year, month and day are\n non-zero in the result.\n \"\"\"\n y, m, d = _ord2ymd(n)\n return cls(y, m, d)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a date from a string in ISO 8601 format.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) not in (7, 8, 10):\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n try:\n return cls(*_parse_isoformat_date(date_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisocalendar(cls, year, week, day):\n \"\"\"Construct a date from the ISO year, week number and weekday.\n\n This is the inverse of the date.isocalendar() function\"\"\"\n return cls(*_isoweek_to_gregorian(year, week, day))" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> dt = datetime(2010, 1, 1)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0)'\n\n >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc)\n >>> repr(dt)\n 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)'\n \"\"\"\n return \"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"Format using strftime().\"\n return _wrap_strftime(self, fmt, self.timetuple())" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def isoformat(self):\n \"\"\"Return the date formatted according to ISO.\n\n This is 'YYYY-MM-DD'.\n\n References:\n - http://www.w3.org/TR/NOTE-datetime\n - http://www.cl.cam.ac.uk/~mgk25/iso-time.html\n \"\"\"\n return \"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n \"\"\"year (1-9999)\"\"\"\n return self._year" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def month(self):\n \"\"\"month (1-12)\"\"\"\n return self._month" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def day(self):\n \"\"\"day (1-31)\"\"\"\n return self._day" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n return _build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "STORE_NAME", " def toordinal(self):\n \"\"\"Return proleptic Gregorian ordinal for the year, month and day.\n\n January 1 of year 1 is day 1. Only the year, month and day values\n contribute to the result.\n \"\"\"\n return _ymd2ord(self._year, self._month, self._day)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None):\n \"\"\"Return a new date with new values for the specified fields.\"\"\"\n if year is None:\n year = self._year\n if month is None:\n month = self._month\n if day is None:\n day = self._day\n return type(self)(year, month, day)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, date):\n return self._cmp(other) == 0\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, date):\n return self._cmp(other) <= 0\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) < 0\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, date):\n return self._cmp(other) >= 0\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, date):\n return self._cmp(other) > 0\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other):\n assert isinstance(other, date)\n y, m, d = self._year, self._month, self._day\n y2, m2, d2 = other._year, other._month, other._day\n return _cmp((y, m, d), (y2, m2, d2))" ], [ "STORE_NAME", " def __hash__(self):\n \"Hash.\"\n if self._hashcode == -1:\n self._hashcode = hash(self._getstate())\n return self._hashcode" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a date to a timedelta.\"\n if isinstance(other, timedelta):\n o = self.toordinal() + other.days\n if 0 < o <= _MAXORDINAL:\n return type(self).fromordinal(o)\n raise OverflowError(\"result out of range\")\n return NotImplemented" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"\"\"Subtract two dates, or a date and a timedelta.\"\"\"\n if isinstance(other, timedelta):\n return self + timedelta(-other.days)\n if isinstance(other, date):\n days1 = self.toordinal()\n days2 = other.toordinal()\n return timedelta(days1 - days2)\n return NotImplemented" ], [ "STORE_NAME", " def weekday(self):\n \"Return day of the week, where Monday == 0 ... Sunday == 6.\"\n return (self.toordinal() + 6) % 7" ], [ "STORE_NAME", " def isoweekday(self):\n \"Return day of the week, where Monday == 1 ... Sunday == 7.\"\n # 1-Jan-0001 is a Monday\n return self.toordinal() % 7 or 7" ], [ "STORE_NAME", " def isocalendar(self):\n \"\"\"Return a named tuple containing ISO year, week number, and weekday.\n\n The first ISO week of the year is the (Mon-Sun) week\n containing the year's first Thursday; everything else derives\n from that.\n\n The first week is 1; Monday is 1 ... Sunday is 7.\n\n ISO calendar algorithm taken from\n http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm\n (used with permission)\n \"\"\"\n year = self._year\n week1monday = _isoweek1monday(year)\n today = _ymd2ord(self._year, self._month, self._day)\n # Internally, week and day have origin 0\n week, day = divmod(today - week1monday, 7)\n if week < 0:\n year -= 1\n week1monday = _isoweek1monday(year)\n week, day = divmod(today - week1monday, 7)\n elif week >= 52:\n if today >= _isoweek1monday(year+1):\n year += 1\n week = 0\n return _IsoCalendarDate(year, week+1, day+1)" ], [ "STORE_NAME", " def _getstate(self):\n yhi, ylo = divmod(self._year, 256)\n return bytes([yhi, ylo, self._month, self._day])," ], [ "STORE_NAME", " def __setstate(self, string):\n yhi, ylo, self._month, self._day = string\n self._year = yhi * 256 + ylo" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "STORE_NAME", " def __reduce__(self):\n return (self.__class__, self._getstate())" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SLICE", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3]) <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_ATTR", "year.encode" ], [ "CALL", "year.encode('latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "STORE_ATTR", "self._month" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL", "_time.localtime(t)" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL", "_ord2ymd(n)" ], [ "STORE_FAST", "d" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "d" ], [ "CALL", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "CONTAINS_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "day" ], [ "CALL", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.timetuple" ], [ "CALL", "self.timetuple()" ], [ "CALL", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_OP", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "day" ], [ "CALL", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "STORE_FAST", "y2" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "d2" ], [ "CALL", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "CALL", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_OP", "self.toordinal() + other.days" ], [ "STORE_FAST", "o" ], [ "LOAD_FAST", "o" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < o <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_ATTR", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL", "timedelta(-other.days)" ], [ "BINARY_OP", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "BINARY_OP", "days1 - days2" ], [ "CALL", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() + 6" ], [ "BINARY_OP", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "_ymd2ord(self._year, self._month, self._day)" ], [ "STORE_FAST", "today" ], [ "LOAD_GLOBAL", "divmod" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year -= 1" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL", "_isoweek1monday(year)" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_GLOBAL", "divmod" ], [ "BINARY_OP", "today - week1monday" ], [ "CALL", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year+1" ], [ "CALL", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_FAST", "year" ], [ "BINARY_OP", "year += 1" ], [ "STORE_FAST", "year" ], [ "STORE_FAST", "week" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "BINARY_OP", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_OP", "day+1" ], [ "CALL", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "CALL", "self._getstate()" ], [ "STORE_NAME", "\"\"\"Abstract base class for time zone info classes.\n\n Subclasses must override the name(), utcoffset() and dst() methods.\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def tzname(self, dt):\n \"datetime -> string name of time zone.\"\n raise NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "STORE_NAME", " def utcoffset(self, dt):\n \"datetime -> timedelta, positive for east of UTC, negative for west of UTC\"\n raise NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "STORE_NAME", " def dst(self, dt):\n \"\"\"datetime -> DST offset as timedelta, positive for east of UTC.\n\n Return 0 if DST not in effect. utcoffset() must include the DST\n offset.\n \"\"\"\n raise NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n \"datetime in UTC -> datetime in local time.\"\n\n if not isinstance(dt, datetime):\n raise TypeError(\"fromutc() requires a datetime argument\")\n if dt.tzinfo is not self:\n raise ValueError(\"dt.tzinfo is not self\")\n\n dtoff = dt.utcoffset()\n if dtoff is None:\n raise ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")\n\n # See the long comment block at the end of this file for an\n # explanation of this algorithm.\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc() requires a non-None dst() result\")\n delta = dtoff - dtdst\n if delta:\n dt += delta\n dtdst = dt.dst()\n if dtdst is None:\n raise ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")\n return dt + dtdst" ], [ "STORE_NAME", " def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "STORE_NAME", " def __reduce__(self):\n getinitargs = getattr(self, \"__getinitargs__\", None)\n if getinitargs:\n args = getinitargs()\n else:\n args = ()\n return (self.__class__, args, self.__getstate__())" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.utcoffset" ], [ "CALL", "dt.utcoffset()" ], [ "STORE_FAST", "dtoff" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "BINARY_OP", "dtoff - dtdst" ], [ "STORE_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "BINARY_OP", "dt += delta" ], [ "STORE_FAST", "dt" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.dst" ], [ "CALL", "dt.dst()" ], [ "STORE_FAST", "dtdst" ], [ "LOAD_FAST", "dtdst" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "BINARY_OP", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL", "getattr(self, \"__getinitargs__\", None)" ], [ "STORE_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL", "getinitargs()" ], [ "STORE_FAST", "args" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__getstate__" ], [ "CALL", "self.__getstate__()" ], [ "STORE_NAME", " def __new__(cls, year, week, weekday, /):\n return super().__new__(cls, (year, week, weekday))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def year(self):\n return self[0]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def week(self):\n return self[1]" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def weekday(self):\n return self[2]" ], [ "STORE_NAME", " def __reduce__(self):\n # This code is intended to pickle the object without making the\n # class public. See https://bugs.python.org/msg352381\n return (tuple, (tuple(self),))" ], [ "STORE_NAME", " def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "STORE_NAME", " def __repr__(self):\n return (f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})')" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_SUPER_ATTR", "super().__new__" ], [ "CALL", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL", "tuple(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__name__" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "BUILD_STRING", "f'{self.__class__.__name__}'\n f'(year={self[0]}, week={self[1]}, weekday={self[2]})'" ], [ "STORE_NAME", "\"\"\"Time with time zone.\n\n Constructors:\n\n __new__()\n\n Operators:\n\n __repr__, __str__\n __eq__, __le__, __lt__, __ge__, __gt__, __hash__\n\n Methods:\n\n strftime()\n isoformat()\n utcoffset()\n tzname()\n dst()\n\n Properties (readonly):\n hour, minute, second, microsecond, tzinfo, fold\n \"\"\"" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0):\n \"\"\"Constructor.\n\n Arguments:\n\n hour, minute (required)\n second, microsecond (default to zero)\n tzinfo (default to None)\n fold (keyword only, default to zero)\n \"\"\"\n if (isinstance(hour, (bytes, str)) and len(hour) == 6 and\n ord(hour[0:1])&0x7F < 24):\n # Pickle support\n if isinstance(hour, str):\n try:\n hour = hour.encode('latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(hour, minute or None)\n self._hashcode = -1\n return self\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, time):\n return self._cmp(other, allow_mixed=True) == 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, time):\n return self._cmp(other) <= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) < 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, time):\n return self._cmp(other) >= 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, time):\n return self._cmp(other) > 0\n else:\n return NotImplemented" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, time)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware times\")\n myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)\n othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)\n return _cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "STORE_NAME", " def __hash__(self):\n \"\"\"Hash.\"\"\"\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if not tzoff: # zero or None\n self._hashcode = hash(t._getstate()[0])\n else:\n h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))\n assert not m % timedelta(minutes=1), \"whole minute\"\n m //= timedelta(minutes=1)\n if 0 <= h < 24:\n self._hashcode = hash(time(h, m, self.second, self.microsecond))\n else:\n self._hashcode = hash((h, m, self.second, self.microsecond))\n return self._hashcode" ], [ "STORE_NAME", " def _tzstr(self):\n \"\"\"Return formatted timezone offset (+xx:xx) or an empty string.\"\"\"\n off = self.utcoffset()\n return _format_offset(off)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n if self._microsecond != 0:\n s = \", %d, %d\" % (self._second, self._microsecond)\n elif self._second != 0:\n s = \", %d\" % self._second\n else:\n s = \"\"\n s= \"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def isoformat(self, timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional\n part is omitted if self.microsecond == 0.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)\n tz = self._tzstr()\n if tz:\n s += tz\n return s" ], [ "LOAD_NAME", "isoformat" ], [ "STORE_NAME", "__str__" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, time_string):\n \"\"\"Construct a time from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(time_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n # The spec actually requires that time-only ISO 8601 strings start with\n # T, but the extended format allows this to be omitted as long as there\n # is no ambiguity with date strings.\n time_string = time_string.removeprefix('T')\n\n try:\n return cls(*_parse_isoformat_time(time_string))\n except Exception:\n raise ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "STORE_NAME", " def strftime(self, fmt):\n \"\"\"Format using strftime(). The date part of the timestamp passed\n to underlying strftime should not be used.\n \"\"\"\n # The year must be >= 1000 else Python's strftime implementation\n # can raise a bogus exception.\n timetuple = (1900, 1, 1,\n self._hour, self._minute, self._second,\n 0, 1, -1)\n return _wrap_strftime(self, fmt, timetuple)" ], [ "STORE_NAME", " def __format__(self, fmt):\n if not isinstance(fmt, str):\n raise TypeError(\"must be str, not %s\" % type(fmt).__name__)\n if len(fmt) != 0:\n return self.strftime(fmt)\n return str(self)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta, positive east of UTC\n (negative west of UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(None)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(None)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(None)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def replace(self, hour=None, minute=None, second=None, microsecond=None,\n tzinfo=True, *, fold=None):\n \"\"\"Return a new time with new values for the specified fields.\"\"\"\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self._fold\n return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n h = self._hour\n if self._fold and protocol > 3:\n h += 128\n basestate = bytes([h, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n h, self._minute, self._second, us1, us2, us3 = string\n if h > 127:\n self._fold = 1\n self._hour = h - 128\n else:\n self._fold = 0\n self._hour = h\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SLICE", "hour[0:1]" ], [ "CALL", "ord(hour[0:1])" ], [ "BINARY_OP", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_ATTR", "hour.encode" ], [ "CALL", "hour.encode('latin1')" ], [ "STORE_FAST", "hour" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "CALL", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "STORE_ATTR", "self._minute" ], [ "STORE_ATTR", "self._second" ], [ "STORE_ATTR", "self._microsecond" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "BINARY_OP", "myoff//timedelta(minutes=1)" ], [ "BINARY_OP", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "STORE_FAST", "myhhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "BINARY_OP", "otoff//timedelta(minutes=1)" ], [ "BINARY_OP", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "STORE_FAST", "othhmm" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_KW", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL_KW", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(hours=1)" ], [ "CALL", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "BINARY_OP", "m % timedelta(minutes=1)" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "BINARY_OP", "m //= timedelta(minutes=1)" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "COMPARE_OP", "0 <= h < 24" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "time(h, m, self.second, self.microsecond)" ], [ "CALL", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_OP", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_OP", "\", %d\" % self._second" ], [ "STORE_FAST", "s" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_OP", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzstr" ], [ "CALL", "self._tzstr()" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_ATTR", "time_string.removeprefix" ], [ "CALL", "time_string.removeprefix('T')" ], [ "STORE_FAST", "time_string" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "time_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {time_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "STORE_FAST", "timetuple" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "timetuple" ], [ "CALL", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_OP", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.utcoffset" ], [ "CALL", "self._tzinfo.utcoffset(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.tzname" ], [ "CALL", "self._tzinfo.tzname(None)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.dst" ], [ "CALL", "self._tzinfo.dst(None)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "CALL_KW", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "STORE_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h += 128" ], [ "STORE_FAST", "h" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_OP", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_NAME", "\"\"\"datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\n The year, month and day arguments are required. tzinfo may be None, or an\n instance of a tzinfo subclass. The remaining arguments may be ints.\n \"\"\"" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_OP", "date.__slots__ + time.__slots__" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0,\n microsecond=0, tzinfo=None, *, fold=0):\n if (isinstance(year, (bytes, str)) and len(year) == 10 and\n 1 <= ord(year[2:3])&0x7F <= 12):\n # Pickle support\n if isinstance(year, str):\n try:\n year = bytes(year, 'latin1')\n except UnicodeEncodeError:\n # More informative error message.\n raise ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")\n self = object.__new__(cls)\n self.__setstate(year, month)\n self._hashcode = -1\n return self\n year, month, day = _check_date_fields(year, month, day)\n hour, minute, second, microsecond, fold = _check_time_fields(\n hour, minute, second, microsecond, fold)\n _check_tzinfo_arg(tzinfo)\n self = object.__new__(cls)\n self._year = year\n self._month = month\n self._day = day\n self._hour = hour\n self._minute = minute\n self._second = second\n self._microsecond = microsecond\n self._tzinfo = tzinfo\n self._hashcode = -1\n self._fold = fold\n return self" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def hour(self):\n \"\"\"hour (0-23)\"\"\"\n return self._hour" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def minute(self):\n \"\"\"minute (0-59)\"\"\"\n return self._minute" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def second(self):\n \"\"\"second (0-59)\"\"\"\n return self._second" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def microsecond(self):\n \"\"\"microsecond (0-999999)\"\"\"\n return self._microsecond" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def tzinfo(self):\n \"\"\"timezone info object\"\"\"\n return self._tzinfo" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def fold(self):\n return self._fold" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _fromtimestamp(cls, t, utc, tz):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n frac, t = _math.modf(t)\n us = round(frac * 1e6)\n if us >= 1000000:\n t += 1\n us -= 1000000\n elif us < 0:\n t -= 1\n us += 1000000\n\n converter = _time.gmtime if utc else _time.localtime\n y, m, d, hh, mm, ss, weekday, jday, dst = converter(t)\n ss = min(ss, 59) # clamp out leap seconds if the platform has them\n result = cls(y, m, d, hh, mm, ss, us, tz)\n if tz is None and not utc:\n # As of version 2015f max fold in IANA database is\n # 23 hours at 1969-09-30 13:00:00 in Kwajalein.\n # Let's probe 24 hours in the past to detect a transition:\n max_fold_seconds = 24 * 3600\n\n # On Windows localtime_s throws an OSError for negative values,\n # thus we can't perform fold detection for values of time less\n # than the max time fold. See comments in _datetimemodule's\n # version of this method for more details.\n if t < max_fold_seconds and sys.platform.startswith(\"win\"):\n return result\n\n y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6]\n probe1 = cls(y, m, d, hh, mm, ss, us, tz)\n trans = result - probe1 - timedelta(0, max_fold_seconds)\n if trans.days < 0:\n y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]\n probe2 = cls(y, m, d, hh, mm, ss, us, tz)\n if probe2 == result:\n result._fold = 1\n elif tz is not None:\n result = tz.fromutc(result)\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromtimestamp(cls, t, tz=None):\n \"\"\"Construct a datetime from a POSIX timestamp (like time.time()).\n\n A timezone info object may be passed in as well.\n \"\"\"\n _check_tzinfo_arg(tz)\n\n return cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcfromtimestamp(cls, t):\n \"\"\"Construct a naive UTC datetime from a POSIX timestamp.\"\"\"\n return cls._fromtimestamp(t, True, None)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def now(cls, tz=None):\n \"Construct a datetime from time.time() and optional time zone info.\"\n t = _time.time()\n return cls.fromtimestamp(t, tz)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def utcnow(cls):\n \"Construct a UTC datetime from time.time().\"\n t = _time.time()\n return cls.utcfromtimestamp(t)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def combine(cls, date, time, tzinfo=True):\n \"Construct a datetime from a given date and a given time.\"\n if not isinstance(date, _date_class):\n raise TypeError(\"date argument must be a date instance\")\n if not isinstance(time, _time_class):\n raise TypeError(\"time argument must be a time instance\")\n if tzinfo is True:\n tzinfo = time.tzinfo\n return cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def fromisoformat(cls, date_string):\n \"\"\"Construct a datetime from a string in one of the ISO 8601 formats.\"\"\"\n if not isinstance(date_string, str):\n raise TypeError('fromisoformat: argument must be str')\n\n if len(date_string) < 7:\n raise ValueError(f'Invalid isoformat string: {date_string!r}')\n\n # Split this at the separator\n try:\n separator_location = _find_isoformat_datetime_separator(date_string)\n dstr = date_string[0:separator_location]\n tstr = date_string[(separator_location+1):]\n\n date_components = _parse_isoformat_date(dstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n\n if tstr:\n try:\n time_components = _parse_isoformat_time(tstr)\n except ValueError:\n raise ValueError(\n f'Invalid isoformat string: {date_string!r}') from None\n else:\n time_components = [0, 0, 0, 0, None]\n\n return cls(*(date_components + time_components))" ], [ "STORE_NAME", " def timetuple(self):\n \"Return local time tuple compatible with time.localtime().\"\n dst = self.dst()\n if dst is None:\n dst = -1\n elif dst:\n dst = 1\n else:\n dst = 0\n return _build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "STORE_NAME", " def _mktime(self):\n \"\"\"Return integer POSIX timestamp.\"\"\"\n epoch = datetime(1970, 1, 1)\n max_fold_seconds = 24 * 3600\n t = (self - epoch) // timedelta(0, 1)\n def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)\n\n # Our goal is to solve t = local(u) for u.\n a = local(t) - t\n u1 = t - a\n t1 = local(u1)\n if t1 == t:\n # We found one solution, but it may not be the one we need.\n # Look for an earlier solution (if `fold` is 0), or a\n # later one (if `fold` is 1).\n u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]\n b = local(u2) - u2\n if a == b:\n return u1\n else:\n b = t1 - u1\n assert a != b\n u2 = t - b\n t2 = local(u2)\n if t2 == t:\n return u2\n if t1 == t:\n return u1\n # We have found both offsets a and b, but neither t - a nor t - b is\n # a solution. This means t is in the gap.\n return (max, min)[self.fold](u1, u2)" ], [ "STORE_NAME", " def timestamp(self):\n \"Return POSIX timestamp as float\"\n if self._tzinfo is None:\n s = self._mktime()\n return s + self.microsecond / 1e6\n else:\n return (self - _EPOCH).total_seconds()" ], [ "STORE_NAME", " def utctimetuple(self):\n \"Return UTC time tuple compatible with time.gmtime().\"\n offset = self.utcoffset()\n if offset:\n self -= offset\n y, m, d = self.year, self.month, self.day\n hh, mm, ss = self.hour, self.minute, self.second\n return _build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "STORE_NAME", " def date(self):\n \"Return the date part.\"\n return date(self._year, self._month, self._day)" ], [ "STORE_NAME", " def time(self):\n \"Return the time part, with tzinfo None.\"\n return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "STORE_NAME", " def timetz(self):\n \"Return the time part, with same tzinfo.\"\n return time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "STORE_NAME", " def replace(self, year=None, month=None, day=None, hour=None,\n minute=None, second=None, microsecond=None, tzinfo=True,\n *, fold=None):\n \"\"\"Return a new datetime with new values for the specified fields.\"\"\"\n if year is None:\n year = self.year\n if month is None:\n month = self.month\n if day is None:\n day = self.day\n if hour is None:\n hour = self.hour\n if minute is None:\n minute = self.minute\n if second is None:\n second = self.second\n if microsecond is None:\n microsecond = self.microsecond\n if tzinfo is True:\n tzinfo = self.tzinfo\n if fold is None:\n fold = self.fold\n return type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "STORE_NAME", " def _local_timezone(self):\n if self.tzinfo is None:\n ts = self._mktime()\n else:\n ts = (self - _EPOCH) // timedelta(seconds=1)\n localtm = _time.localtime(ts)\n local = datetime(*localtm[:6])\n # Extract TZ data\n gmtoff = localtm.tm_gmtoff\n zone = localtm.tm_zone\n return timezone(timedelta(seconds=gmtoff), zone)" ], [ "STORE_NAME", " def astimezone(self, tz=None):\n if tz is None:\n tz = self._local_timezone()\n elif not isinstance(tz, tzinfo):\n raise TypeError(\"tz argument must be an instance of tzinfo\")\n\n mytz = self.tzinfo\n if mytz is None:\n mytz = self._local_timezone()\n myoffset = mytz.utcoffset(self)\n else:\n myoffset = mytz.utcoffset(self)\n if myoffset is None:\n mytz = self.replace(tzinfo=None)._local_timezone()\n myoffset = mytz.utcoffset(self)\n\n if tz is mytz:\n return self\n\n # Convert self to UTC, and attach the new time zone object.\n utc = (self - myoffset).replace(tzinfo=tz)\n\n # Convert from UTC to tz's local time.\n return tz.fromutc(utc)" ], [ "STORE_NAME", " def ctime(self):\n \"Return ctime() style string.\"\n weekday = self.toordinal() % 7 or 7\n return \"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "STORE_NAME", " def isoformat(self, sep='T', timespec='auto'):\n \"\"\"Return the time formatted according to ISO.\n\n The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'.\n By default, the fractional part is omitted if self.microsecond == 0.\n\n If self.tzinfo is not None, the UTC offset is also attached, giving\n giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'.\n\n Optional argument sep specifies the separator between date and\n time, default 'T'.\n\n The optional argument timespec specifies the number of additional\n terms of the time to include. Valid options are 'auto', 'hours',\n 'minutes', 'seconds', 'milliseconds' and 'microseconds'.\n \"\"\"\n s = (\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec))\n\n off = self.utcoffset()\n tz = _format_offset(off)\n if tz:\n s += tz\n\n return s" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\"\"\"\n L = [self._year, self._month, self._day, # These are never zero\n self._hour, self._minute, self._second, self._microsecond]\n if L[-1] == 0:\n del L[-1]\n if L[-1] == 0:\n del L[-1]\n s = \"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))\n if self._tzinfo is not None:\n assert s[-1:] == \")\"\n s = s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"\n if self._fold:\n assert s[-1:] == \")\"\n s = s[:-1] + \", fold=1)\"\n return s" ], [ "STORE_NAME", " def __str__(self):\n \"Convert to string, for str().\"\n return self.isoformat(sep=' ')" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def strptime(cls, date_string, format):\n 'string, format -> new datetime parsed from a string (like time.strptime()).'\n import _strptime\n return _strptime._strptime_datetime(cls, date_string, format)" ], [ "STORE_NAME", " def utcoffset(self):\n \"\"\"Return the timezone offset as timedelta positive east of UTC (negative west of\n UTC).\"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.utcoffset(self)\n _check_utc_offset(\"utcoffset\", offset)\n return offset" ], [ "STORE_NAME", " def tzname(self):\n \"\"\"Return the timezone name.\n\n Note that the name is 100% informational -- there's no requirement that\n it mean anything in particular. For example, \"GMT\", \"UTC\", \"-500\",\n \"-5:00\", \"EDT\", \"US/Eastern\", \"America/New York\" are all valid replies.\n \"\"\"\n if self._tzinfo is None:\n return None\n name = self._tzinfo.tzname(self)\n _check_tzname(name)\n return name" ], [ "STORE_NAME", " def dst(self):\n \"\"\"Return 0 if DST is not in effect, or the DST offset (as timedelta\n positive eastward) if DST is in effect.\n\n This is purely informational; the DST offset has already been added to\n the UTC offset returned by utcoffset() if applicable, so there's no\n need to consult dst() unless you're interested in displaying the DST\n info.\n \"\"\"\n if self._tzinfo is None:\n return None\n offset = self._tzinfo.dst(self)\n _check_utc_offset(\"dst\", offset)\n return offset" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other, allow_mixed=True) == 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n return False" ], [ "STORE_NAME", " def __le__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) <= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __lt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) < 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __ge__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) >= 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def __gt__(self, other):\n if isinstance(other, datetime):\n return self._cmp(other) > 0\n elif not isinstance(other, date):\n return NotImplemented\n else:\n _cmperror(self, other)" ], [ "STORE_NAME", " def _cmp(self, other, allow_mixed=False):\n assert isinstance(other, datetime)\n mytz = self._tzinfo\n ottz = other._tzinfo\n myoff = otoff = None\n\n if mytz is ottz:\n base_compare = True\n else:\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n # Assume that allow_mixed means that we are called from __eq__\n if allow_mixed:\n if myoff != self.replace(fold=not self.fold).utcoffset():\n return 2\n if otoff != other.replace(fold=not other.fold).utcoffset():\n return 2\n base_compare = myoff == otoff\n\n if base_compare:\n return _cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))\n if myoff is None or otoff is None:\n if allow_mixed:\n return 2 # arbitrary non-zero value\n else:\n raise TypeError(\"cannot compare naive and aware datetimes\")\n # XXX What follows could be done more efficiently...\n diff = self - other # this will take offsets into account\n if diff.days < 0:\n return -1\n return diff and 1 or 0" ], [ "STORE_NAME", " def __add__(self, other):\n \"Add a datetime and a timedelta.\"\n if not isinstance(other, timedelta):\n return NotImplemented\n delta = timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)\n delta += other\n hour, rem = divmod(delta.seconds, 3600)\n minute, second = divmod(rem, 60)\n if 0 < delta.days <= _MAXORDINAL:\n return type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))\n raise OverflowError(\"result out of range\")" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__radd__" ], [ "STORE_NAME", " def __sub__(self, other):\n \"Subtract two datetimes, or a datetime and a timedelta.\"\n if not isinstance(other, datetime):\n if isinstance(other, timedelta):\n return self + -other\n return NotImplemented\n\n days1 = self.toordinal()\n days2 = other.toordinal()\n secs1 = self._second + self._minute * 60 + self._hour * 3600\n secs2 = other._second + other._minute * 60 + other._hour * 3600\n base = timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)\n if self._tzinfo is other._tzinfo:\n return base\n myoff = self.utcoffset()\n otoff = other.utcoffset()\n if myoff == otoff:\n return base\n if myoff is None or otoff is None:\n raise TypeError(\"cannot mix naive and timezone-aware time\")\n return base + otoff - myoff" ], [ "STORE_NAME", " def __hash__(self):\n if self._hashcode == -1:\n if self.fold:\n t = self.replace(fold=0)\n else:\n t = self\n tzoff = t.utcoffset()\n if tzoff is None:\n self._hashcode = hash(t._getstate()[0])\n else:\n days = _ymd2ord(self.year, self.month, self.day)\n seconds = self.hour * 3600 + self.minute * 60 + self.second\n self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)\n return self._hashcode" ], [ "STORE_NAME", " def _getstate(self, protocol=3):\n yhi, ylo = divmod(self._year, 256)\n us2, us3 = divmod(self._microsecond, 256)\n us1, us2 = divmod(us2, 256)\n m = self._month\n if self._fold and protocol > 3:\n m += 128\n basestate = bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])\n if self._tzinfo is None:\n return (basestate,)\n else:\n return (basestate, self._tzinfo)" ], [ "STORE_NAME", " def __setstate(self, string, tzinfo):\n if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class):\n raise TypeError(\"bad tzinfo state arg\")\n (yhi, ylo, m, self._day, self._hour,\n self._minute, self._second, us1, us2, us3) = string\n if m > 127:\n self._fold = 1\n self._month = m - 128\n else:\n self._fold = 0\n self._month = m\n self._year = yhi * 256 + ylo\n self._microsecond = (((us1 << 8) | us2) << 8) | us3\n self._tzinfo = tzinfo" ], [ "STORE_NAME", " def __reduce_ex__(self, protocol):\n return (self.__class__, self._getstate(protocol))" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "STORE_NAME", " def __reduce__(self):\n return self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SLICE", "year[2:3]" ], [ "CALL", "ord(year[2:3])" ], [ "BINARY_OP", "ord(year[2:3])&0x7F" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "COMPARE_OP", "1 <= ord(year[2:3])&0x7F <= 12" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL", "bytes(year, 'latin1')" ], [ "STORE_FAST", "year" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__setstate" ], [ "CALL", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "day" ], [ "CALL", "_check_date_fields(year, month, day)" ], [ "STORE_FAST", "day" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "fold" ], [ "CALL", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_ATTR", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "object.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "STORE_ATTR", "self._month" ], [ "STORE_ATTR", "self._day" ], [ "STORE_ATTR", "self._hour" ], [ "STORE_ATTR", "self._minute" ], [ "STORE_ATTR", "self._second" ], [ "STORE_ATTR", "self._microsecond" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_ATTR", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL", "_math.modf(t)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_OP", "frac * 1e6" ], [ "CALL", "round(frac * 1e6)" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t += 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us -= 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "t -= 1" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "us" ], [ "BINARY_OP", "us += 1000000" ], [ "STORE_FAST", "us" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "STORE_FAST", "converter" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL", "converter(t)" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL", "min(ss, 59)" ], [ "STORE_FAST", "ss" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "utc" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_ATTR", "sys.platform.startswith" ], [ "CALL", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_OP", "t - max_fold_seconds" ], [ "CALL", "converter(t - max_fold_seconds)" ], [ "BINARY_SLICE", "converter(t - max_fold_seconds)[:6]" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe1" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_OP", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL", "timedelta(0, max_fold_seconds)" ], [ "BINARY_OP", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "STORE_FAST", "trans" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "trans // timedelta(0, 1)" ], [ "BINARY_OP", "t + trans // timedelta(0, 1)" ], [ "CALL", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SLICE", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "LOAD_FAST", "cls" ], [ "CALL", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "STORE_FAST", "probe2" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_ATTR", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL", "tz.fromutc(result)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._fromtimestamp" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.fromtimestamp" ], [ "CALL", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.time" ], [ "CALL", "_time.time()" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL_KW", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL", "_find_isoformat_datetime_separator(date_string)" ], [ "STORE_FAST", "separator_location" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SLICE", "date_string[0:separator_location]" ], [ "STORE_FAST", "dstr" ], [ "BINARY_OP", "separator_location+1" ], [ "BINARY_SLICE", "date_string[(separator_location+1):]" ], [ "STORE_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL", "_parse_isoformat_date(dstr)" ], [ "STORE_FAST", "date_components" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL", "_parse_isoformat_time(tstr)" ], [ "STORE_FAST", "time_components" ], [ "STORE_FAST", "time_components" ], [ "LOAD_FAST", "cls" ], [ "BINARY_OP", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "BUILD_STRING", "f'Invalid isoformat string: {date_string!r}'" ], [ "CALL", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.dst" ], [ "CALL", "self.dst()" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "STORE_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "datetime(1970, 1, 1)" ], [ "STORE_DEREF", "epoch" ], [ "STORE_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(self - epoch) // timedelta(0, 1)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", " def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "STORE_FAST", " def local(u):\n y, m, d, hh, mm, ss = _time.localtime(u)[:6]\n return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_OP", "local(t) - t" ], [ "STORE_FAST", "a" ], [ "BINARY_OP", "t - a" ], [ "STORE_FAST", "u1" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL", "local(u1)" ], [ "STORE_FAST", "t1" ], [ "COMPARE_OP", "t1 == t" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_OP", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_OP", "local(u2) - u2" ], [ "STORE_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "BINARY_OP", "t1 - u1" ], [ "STORE_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "BINARY_OP", "t - b" ], [ "STORE_FAST", "u2" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL", "local(u2)" ], [ "STORE_FAST", "t2" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "CALL", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL", "_time.localtime(u)" ], [ "BINARY_SLICE", "_time.localtime(u)[:6]" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_OP", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0, 1)" ], [ "BINARY_OP", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "s" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_OP", "self.microsecond / 1e6" ], [ "BINARY_OP", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_ATTR", "(self - _EPOCH).total_seconds" ], [ "CALL", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "BINARY_OP", "self -= offset" ], [ "STORE_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "y" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "hh" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "CALL", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_KW", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_KW", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "STORE_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "STORE_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "STORE_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "STORE_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "STORE_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "STORE_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "STORE_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "STORE_FAST", "fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_FAST", "fold" ], [ "CALL_KW", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._mktime" ], [ "CALL", "self._mktime()" ], [ "STORE_FAST", "ts" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_OP", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(seconds=1)" ], [ "BINARY_OP", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "STORE_FAST", "ts" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL", "_time.localtime(ts)" ], [ "STORE_FAST", "localtm" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SLICE", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "STORE_FAST", "local" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "STORE_FAST", "gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "STORE_FAST", "zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL_KW", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "tz" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._local_timezone" ], [ "CALL", "self._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "LOAD_FAST", "myoffset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_KW", "self.replace(tzinfo=None)" ], [ "LOAD_ATTR", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL", "self.replace(tzinfo=None)._local_timezone()" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_ATTR", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "mytz.utcoffset(self)" ], [ "STORE_FAST", "myoffset" ], [ "IS_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "BINARY_OP", "self - myoffset" ], [ "LOAD_ATTR", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL_KW", "(self - myoffset).replace(tzinfo=tz)" ], [ "STORE_FAST", "utc" ], [ "LOAD_FAST", "tz" ], [ "LOAD_ATTR", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "BINARY_OP", "self.toordinal() % 7" ], [ "STORE_FAST", "weekday" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_OP", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_OP", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "off" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL", "_format_offset(off)" ], [ "STORE_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "BINARY_OP", "s += tz" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "STORE_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "DELETE_SUBSCR", "L[-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_ATTR", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL", "map(str, L)" ], [ "CALL", "\", \".join(map(str, L))" ], [ "BUILD_STRING", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_OP", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_OP", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SLICE", "s[:-1]" ], [ "BINARY_OP", "s[:-1] + \", fold=1)\"" ], [ "STORE_FAST", "s" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.isoformat" ], [ "CALL_KW", "self.isoformat(sep=' ')" ], [ "STORE_FAST", "import _strptime" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_ATTR", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "format" ], [ "CALL", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.utcoffset(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.tzname(self)" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_ATTR", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL", "self._tzinfo.dst(self)" ], [ "STORE_FAST", "offset" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "CALL", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "STORE_FAST", "mytz" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "STORE_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_ATTR", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL_KW", "self.replace(fold=not self.fold)" ], [ "LOAD_ATTR", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_ATTR", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL_KW", "other.replace(fold=not other.fold)" ], [ "LOAD_ATTR", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "myoff == otoff" ], [ "STORE_FAST", "base_compare" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "BINARY_OP", "self - other" ], [ "STORE_FAST", "diff" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_KW", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "STORE_FAST", "delta" ], [ "BINARY_OP", "delta += other" ], [ "STORE_FAST", "delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL", "divmod(delta.seconds, 3600)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL", "divmod(rem, 60)" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "COMPARE_OP", "0 < delta.days <= _MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL", "type(self)" ], [ "LOAD_ATTR", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_ATTR", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL_KW", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(other, timedelta)" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_OP", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.toordinal" ], [ "CALL", "self.toordinal()" ], [ "STORE_FAST", "days1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.toordinal" ], [ "CALL", "other.toordinal()" ], [ "STORE_FAST", "days2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_OP", "self._minute * 60" ], [ "BINARY_OP", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_OP", "self._hour * 3600" ], [ "BINARY_OP", "self._second + self._minute * 60 + self._hour * 3600" ], [ "STORE_FAST", "secs1" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_OP", "other._minute * 60" ], [ "BINARY_OP", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_OP", "other._hour * 3600" ], [ "BINARY_OP", "other._second + other._minute * 60 + other._hour * 3600" ], [ "STORE_FAST", "secs2" ], [ "LOAD_GLOBAL", "timedelta" ], [ "BINARY_OP", "days1 - days2" ], [ "BINARY_OP", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_OP", "self._microsecond - other._microsecond" ], [ "CALL", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "STORE_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "IS_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utcoffset" ], [ "CALL", "self.utcoffset()" ], [ "STORE_FAST", "myoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.utcoffset" ], [ "CALL", "other.utcoffset()" ], [ "STORE_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "BINARY_OP", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_OP", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_KW", "self.replace(fold=0)" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "self" ], [ "STORE_FAST", "t" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.utcoffset" ], [ "CALL", "t.utcoffset()" ], [ "STORE_FAST", "tzoff" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t._getstate" ], [ "CALL", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL", "_ymd2ord(self.year, self.month, self.day)" ], [ "STORE_FAST", "days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_OP", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_OP", "self.minute * 60" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_OP", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "STORE_FAST", "seconds" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_OP", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "STORE_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m += 128" ], [ "STORE_FAST", "m" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us3" ], [ "CALL", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "STORE_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "STORE_FAST", "us3" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_OP", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_OP", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_OP", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_OP", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OP", "(us1 << 8) | us2" ], [ "BINARY_OP", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OP", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__reduce_ex__" ], [ "CALL", "self.__reduce_ex__(2)" ], [ "STORE_FAST", "THURSDAY" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL", "_ymd2ord(year, 1, 1)" ], [ "STORE_FAST", "firstday" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_OP", "firstday + 6" ], [ "BINARY_OP", "(firstday + 6) % 7" ], [ "STORE_FAST", "firstweekday" ], [ "BINARY_OP", "firstday - firstweekday" ], [ "STORE_FAST", "week1monday" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_OP", "week1monday += 7" ], [ "STORE_FAST", "week1monday" ], [ "LOAD_FAST", "week1monday" ], [ "STORE_NAME", "__slots__" ], [ "LOAD_NAME", "object" ], [ "CALL", "object()" ], [ "STORE_NAME", "_Omitted" ], [ "LOAD_NAME", "_Omitted" ], [ "STORE_NAME", " def __new__(cls, offset, name=_Omitted):\n if not isinstance(offset, timedelta):\n raise TypeError(\"offset must be a timedelta\")\n if name is cls._Omitted:\n if not offset:\n return cls.utc\n name = None\n elif not isinstance(name, str):\n raise TypeError(\"name must be a string\")\n if not cls._minoffset <= offset <= cls._maxoffset:\n raise ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")\n return cls._create(offset, name)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _create(cls, offset, name=None):\n self = tzinfo.__new__(cls)\n self._offset = offset\n self._name = name\n return self" ], [ "STORE_NAME", " def __getinitargs__(self):\n \"\"\"pickle support\"\"\"\n if self._name is None:\n return (self._offset,)\n return (self._offset, self._name)" ], [ "STORE_NAME", " def __eq__(self, other):\n if isinstance(other, timezone):\n return self._offset == other._offset\n return NotImplemented" ], [ "STORE_NAME", " def __hash__(self):\n return hash(self._offset)" ], [ "STORE_NAME", " def __repr__(self):\n \"\"\"Convert to formal string, for repr().\n\n >>> tz = timezone.utc\n >>> repr(tz)\n 'datetime.timezone.utc'\n >>> tz = timezone(timedelta(hours=-5), 'EST')\n >>> repr(tz)\n \"datetime.timezone(datetime.timedelta(-1, 68400), 'EST')\"\n \"\"\"\n if self is self.utc:\n return 'datetime.timezone.utc'\n if self._name is None:\n return \"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)\n return \"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "STORE_NAME", " def __str__(self):\n return self.tzname(None)" ], [ "STORE_NAME", " def utcoffset(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return self._offset\n raise TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def tzname(self, dt):\n if isinstance(dt, datetime) or dt is None:\n if self._name is None:\n return self._name_from_offset(self._offset)\n return self._name\n raise TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def dst(self, dt):\n if isinstance(dt, datetime) or dt is None:\n return None\n raise TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "STORE_NAME", " def fromutc(self, dt):\n if isinstance(dt, datetime):\n if dt.tzinfo is not self:\n raise ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")\n return dt + self._offset\n raise TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_KW", "timedelta(hours=24, microseconds=-1)" ], [ "STORE_NAME", "_maxoffset" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "STORE_NAME", "_minoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "STORE_NAME", " @staticmethod\n def _name_from_offset(delta):\n if not delta:\n return 'UTC'\n if delta < timedelta(0):\n sign = '-'\n delta = -delta\n else:\n sign = '+'\n hours, rest = divmod(delta, timedelta(hours=1))\n minutes, rest = divmod(rest, timedelta(minutes=1))\n seconds = rest.seconds\n microseconds = rest.microseconds\n if microseconds:\n return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}')\n if seconds:\n return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n return f'UTC{sign}{hours:02d}:{minutes:02d}'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "IS_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "STORE_FAST", "name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "COMPARE_OP", "cls._minoffset <= offset <= cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._create" ], [ "CALL", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_ATTR", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL", "tzinfo.__new__(cls)" ], [ "STORE_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "hash(self._offset)" ], [ "LOAD_ATTR", "self.utc" ], [ "IS_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BUILD_STRING", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BUILD_STRING", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzname" ], [ "CALL", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_OP", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "STORE_FAST", "sign" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "STORE_FAST", "delta" ], [ "STORE_FAST", "sign" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(hours=1)" ], [ "CALL", "divmod(delta, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_KW", "timedelta(minutes=1)" ], [ "CALL", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "STORE_FAST", "seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "STORE_FAST", "microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'\n f'.{microseconds:06d}'" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}'" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "BUILD_STRING", "f'UTC{sign}{hours:02d}:{minutes:02d}'" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-3.5.json000066400000000000000000000000041474076367500246660ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-py-3.6.json000066400000000000000000000000041474076367500246670ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-py-3.7.json000066400000000000000000000000041474076367500246700ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-py-3.8.json000066400000000000000000007366161474076367500247220ustar00rootroot00000000000000[ [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[1:]" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_METHOD", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL_METHOD", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dim" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(401)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(101)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(5)" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_MULTIPLY", "4 * _DI100Y" ], [ "BINARY_ADD", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_MULTIPLY", "25 * _DI4Y" ], [ "BINARY_SUBTRACT", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "time" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "CALL_METHOD", "timezone._create(timedelta(0))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL_FUNCTION_KW", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x == y" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year - 1" ], [ "LOAD_FAST", "y" ], [ "BINARY_MULTIPLY", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//4" ], [ "BINARY_ADD", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//100" ], [ "BINARY_SUBTRACT", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//400" ], [ "BINARY_ADD", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_before_month(year, month)" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL_FUNCTION", "divmod(n, _DI400Y)" ], [ "LOAD_FAST", "n400" ], [ "BINARY_MULTIPLY", "n400 * 400" ], [ "BINARY_ADD", "n400 * 400 + 1" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL_FUNCTION", "divmod(n, _DI100Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL_FUNCTION", "divmod(n, _DI4Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "divmod(n, 365)" ], [ "LOAD_FAST", "n100" ], [ "BINARY_MULTIPLY", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_MULTIPLY", "n4 * 4" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4 + n1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n + 50" ], [ "BINARY_RSHIFT", "(n + 50) >> 5" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_ymd2ord(y, m, d)" ], [ "BINARY_ADD", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_MODULO", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "CALL_FUNCTION", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_ADD", "_days_before_month(y, m) + d" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "wday" ], [ "LOAD_FAST", "dnum" ], [ "LOAD_FAST", "dstflag" ], [ "CALL_METHOD", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('Unknown timespec value')" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_METHOD", "fmt.format" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "CALL_METHOD", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_FAST", "off" ], [ "COMPARE_OP", "off is not None" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(off, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(mm, timedelta(minutes=1))" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "BINARY_MODULO", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_MODULO", "\":%02d\" % ss.seconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_MODULO", "'.%06d' % ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL_FUNCTION", "len(format)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "COMPARE_OP", "freplace is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_MODULO", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL_METHOD", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "COMPARE_OP", "zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.utcoffset" ], [ "CALL_METHOD", "object.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "offset is not None" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(offset, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_MODULO", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "BINARY_MODULO", "'%c%02d%02d' % (sign, h, m)" ], [ "LOAD_FAST", "zreplace" ], [ "COMPARE_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL_METHOD", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "COMPARE_OP", "Zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.tzname" ], [ "CALL_METHOD", "object.tzname()" ], [ "LOAD_FAST", "s" ], [ "COMPARE_OP", "s is not None" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace('%', '%%')" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL_METHOD", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_METHOD", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL_METHOD", "\"\".join(newformat)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.strftime" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_METHOD", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "COMPARE_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "idx" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_MODULO", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "COMPARE_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[0:4]" ], [ "CALL_FUNCTION", "int(dtstr[0:4])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_ADD", "4 + has_sep" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 1])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "weekno" ], [ "LOAD_FAST", "dayno" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL_FUNCTION", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(0, 3)" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+2" ], [ "BINARY_SUBSCR", "tstr[pos:pos+2]" ], [ "CALL_FUNCTION", "int(tstr[pos:pos+2])" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "comp" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+1" ], [ "BINARY_SUBSCR", "tstr[pos:pos+1]" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_MODULO", "\"Invalid time separator: %c\" % next_char" ], [ "CALL_FUNCTION", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "pos < len_str" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "COMPARE_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[pos:(pos+to_parse)]" ], [ "CALL_FUNCTION", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_SUBTRACT", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[(pos+to_parse):]" ], [ "CALL_FUNCTION", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL_FUNCTION", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('-')" ], [ "BINARY_ADD", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('+')" ], [ "BINARY_ADD", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('Z')" ], [ "BINARY_ADD", "tstr.find('Z') + 1" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos-1" ], [ "BINARY_SUBSCR", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(timestr)" ], [ "LOAD_FAST", "tz_pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBSCR", "tstr[tz_pos:]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "len(tzstr)" ], [ "COMPARE_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(tzstr)" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL_FUNCTION", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL_FUNCTION_KW", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_FAST", "tzsign" ], [ "LOAD_FAST", "td" ], [ "BINARY_MULTIPLY", "tzsign * td" ], [ "CALL_FUNCTION", "timezone(tzsign * td)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_METHOD", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL_METHOD", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "x" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "BINARY_MODULO", "_ymd2ord(year, 1, 1) % 7" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_SUBTRACT", "week - 1" ], [ "BINARY_MULTIPLY", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_SUBTRACT", "day - 1" ], [ "BINARY_ADD", "(week - 1) * 7 + (day - 1)" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_FAST", "day_1" ], [ "LOAD_FAST", "day_offset" ], [ "BINARY_ADD", "day_1 + day_offset" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL_FUNCTION", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "COMPARE_OP", "name is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "type(name)" ], [ "BINARY_MODULO", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "COMPARE_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "COMPARE_OP", "offset is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "type(offset)" ], [ "BINARY_MODULO", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BINARY_MODULO", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL_FUNCTION", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_index(year)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_index(month)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_index(day)" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_MODULO", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "_index(hour)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "_index(minute)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "_index(second)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "_index(microsecond)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "COMPARE_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "COMPARE_OP", "tz is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BINARY_MODULO", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL_FUNCTION", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "divmod(a, b)" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r > b" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r < b" ], [ "LOAD_FAST", "greater_than_half" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_MODULO", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__mul__" ], [ "LOAD_FAST", "weeks" ], [ "BINARY_MULTIPLY", "weeks*7" ], [ "LOAD_FAST", "minutes" ], [ "BINARY_MULTIPLY", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_MULTIPLY", "hours*3600" ], [ "BINARY_ADD", "minutes*60 + hours*3600" ], [ "LOAD_FAST", "milliseconds" ], [ "BINARY_MULTIPLY", "milliseconds*1000" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL_METHOD", "_math.modf(days)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_MULTIPLY", "dayfrac * (24.*3600.)" ], [ "CALL_METHOD", "_math.modf(dayfrac * (24.*3600.))" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL_FUNCTION", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL_METHOD", "_math.modf(seconds)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_MULTIPLY", "secondsfrac * 1e6" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL_FUNCTION", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "int(microseconds)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "divmod(s, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_MODULO", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL_FUNCTION", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MODULO", "\"days=%d\" % self._days" ], [ "CALL_METHOD", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_MODULO", "\"seconds=%d\" % self._seconds" ], [ "CALL_METHOD", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\"microseconds=%d\" % self._microseconds" ], [ "CALL_METHOD", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "CALL_METHOD", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL_METHOD", "', '.join(args)" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL_FUNCTION", "divmod(self._seconds, 60)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL_FUNCTION", "divmod(mm, 60)" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "BINARY_MODULO", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL_FUNCTION", "plural(self._days)" ], [ "BINARY_MODULO", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_ADD", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\".%06d\" % self._microseconds" ], [ "BINARY_ADD", "s + \".%06d\" % self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_MULTIPLY", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_ADD", "self.days * 86400 + self.seconds" ], [ "BINARY_MULTIPLY", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_ADD", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_TRUE_DIVIDE", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_ADD", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_ADD", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_ADD", "self._microseconds + other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_SUBTRACT", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_SUBTRACT", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_SUBTRACT", "self._microseconds - other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_ADD", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL_FUNCTION", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._microseconds * other" ], [ "CALL_FUNCTION", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "a" ], [ "BINARY_MULTIPLY", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "_divide_and_round(usec * a, b)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MULTIPLY", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_ADD", "self._days * (24*3600) + self._seconds" ], [ "BINARY_MULTIPLY", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_ADD", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_FLOOR_DIVIDE", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "BINARY_FLOOR_DIVIDE", "usec // other" ], [ "CALL_FUNCTION", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_TRUE_DIVIDE", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_divide_and_round(usec, other)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "b" ], [ "LOAD_FAST", "usec" ], [ "BINARY_MULTIPLY", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL_FUNCTION", "_divide_and_round(b * usec, a)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_MODULO", "self._to_microseconds() % other._to_microseconds()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "CALL_FUNCTION", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._getstate" ], [ "CALL_METHOD", "other._getstate()" ], [ "CALL_FUNCTION", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_METHOD", "year.encode" ], [ "CALL_METHOD", "year.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL_METHOD", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_time.localtime(t)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "_ord2ymd(n)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.timetuple" ], [ "CALL_METHOD", "self.timetuple()" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "y2" ], [ "LOAD_FAST", "m2" ], [ "LOAD_FAST", "d2" ], [ "CALL_FUNCTION", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_ADD", "self.toordinal() + other.days" ], [ "LOAD_FAST", "o" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL_METHOD", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL_FUNCTION", "timedelta(-other.days)" ], [ "BINARY_ADD", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "CALL_FUNCTION", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_ADD", "self.toordinal() + 6" ], [ "BINARY_MODULO", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_ADD", "year+1" ], [ "CALL_FUNCTION", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "BINARY_ADD", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "day+1" ], [ "CALL_FUNCTION", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.utcoffset" ], [ "CALL_METHOD", "dt.utcoffset()" ], [ "LOAD_FAST", "dtoff" ], [ "COMPARE_OP", "dtoff is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "COMPARE_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_SUBTRACT", "dtoff - dtdst" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "COMPARE_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_ADD", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "getattr(self, \"__getinitargs__\", None)" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL_FUNCTION", "getinitargs()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__getstate__" ], [ "CALL_METHOD", "self.__getstate__()" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_GLOBAL", "super" ], [ "CALL_FUNCTION", "super()" ], [ "LOAD_METHOD", "super().__new__" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "weekday" ], [ "CALL_METHOD", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "tuple(self)" ], [ "LOAD_FAST", "" ], [ "LOAD_ATTR", "" ], [ "LOAD_ATTR", "" ], [ "LOAD_FAST", "" ], [ "BINARY_SUBSCR", "" ], [ "LOAD_FAST", "" ], [ "BINARY_SUBSCR", "" ], [ "LOAD_FAST", "" ], [ "BINARY_SUBSCR", "" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SUBSCR", "hour[0:1]" ], [ "CALL_FUNCTION", "ord(hour[0:1])" ], [ "BINARY_AND", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_METHOD", "hour.encode" ], [ "CALL_METHOD", "hour.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "CALL_METHOD", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "COMPARE_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "COMPARE_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_ADD", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "myoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_ADD", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "otoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "myhhmm" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "othhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL_FUNCTION_KW", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_MODULO", "m % timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "LOAD_FAST", "h" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "time(h, m, self.second, self.microsecond)" ], [ "CALL_FUNCTION", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_MODULO", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_MODULO", "\", %d\" % self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._tzstr" ], [ "CALL_METHOD", "self._tzstr()" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_METHOD", "time_string.removeprefix" ], [ "CALL_METHOD", "time_string.removeprefix('T')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL_FUNCTION", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "CALL_METHOD", "self._tzinfo.tzname(None)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "CALL_METHOD", "self._tzinfo.dst(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "COMPARE_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "COMPARE_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "COMPARE_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "COMPARE_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "COMPARE_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "COMPARE_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "COMPARE_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_SUBTRACT", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_ADD", "date.__slots__ + time.__slots__" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "BINARY_AND", "ord(year[2:3])&0x7F" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "bytes(year, 'latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_METHOD", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_math.modf(t)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_MULTIPLY", "frac * 1e6" ], [ "CALL_FUNCTION", "round(frac * 1e6)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "converter(t)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "min(ss, 59)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "tz" ], [ "COMPARE_OP", "tz is None" ], [ "LOAD_FAST", "utc" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_METHOD", "sys.platform.startswith" ], [ "CALL_METHOD", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_SUBTRACT", "t - max_fold_seconds" ], [ "CALL_FUNCTION", "converter(t - max_fold_seconds)" ], [ "BINARY_SUBSCR", "converter(t - max_fold_seconds)[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_SUBTRACT", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL_FUNCTION", "timedelta(0, max_fold_seconds)" ], [ "BINARY_SUBTRACT", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "trans // timedelta(0, 1)" ], [ "BINARY_ADD", "t + trans // timedelta(0, 1)" ], [ "CALL_FUNCTION", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SUBSCR", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "tz" ], [ "COMPARE_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL_METHOD", "tz.fromutc(result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "COMPARE_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL_FUNCTION", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL_FUNCTION", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "COMPARE_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL_FUNCTION_KW", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_find_isoformat_datetime_separator(date_string)" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SUBSCR", "date_string[0:separator_location]" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_ADD", "separator_location+1" ], [ "BINARY_SUBSCR", "date_string[(separator_location+1):]" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL_FUNCTION", "_parse_isoformat_date(dstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "_parse_isoformat_time(tstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_components" ], [ "LOAD_FAST", "time_components" ], [ "BINARY_ADD", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.dst" ], [ "CALL_METHOD", "self.dst()" ], [ "LOAD_FAST", "dst" ], [ "COMPARE_OP", "dst is None" ], [ "LOAD_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL_FUNCTION", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "datetime(1970, 1, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBTRACT", "local(t) - t" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "a" ], [ "BINARY_SUBTRACT", "t - a" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL_FUNCTION", "local(u1)" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_ADD", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_SUBTRACT", "local(u2) - u2" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "u1" ], [ "BINARY_SUBTRACT", "t1 - u1" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBTRACT", "t - b" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "t2" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL_METHOD", "_time.localtime(u)" ], [ "BINARY_SUBSCR", "_time.localtime(u)[:6]" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_TRUE_DIVIDE", "self.microsecond / 1e6" ], [ "BINARY_ADD", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_METHOD", "(self - _EPOCH).total_seconds" ], [ "CALL_METHOD", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "COMPARE_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "day" ], [ "COMPARE_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "hour" ], [ "COMPARE_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "COMPARE_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "COMPARE_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "COMPARE_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "COMPARE_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "COMPARE_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "COMPARE_OP", "self.tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL_METHOD", "_time.localtime(ts)" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SUBSCR", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL_FUNCTION", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "COMPARE_OP", "tz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "COMPARE_OP", "mytz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "myoffset" ], [ "COMPARE_OP", "myoffset is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(tzinfo=None)" ], [ "LOAD_METHOD", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL_METHOD", "self.replace(tzinfo=None)._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "mytz" ], [ "COMPARE_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "myoffset" ], [ "BINARY_SUBTRACT", "self - myoffset" ], [ "LOAD_ATTR", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION_KW", "(self - myoffset).replace(tzinfo=tz)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL_METHOD", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_ADD", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL_FUNCTION", "map(str, L)" ], [ "CALL_METHOD", "\", \".join(map(str, L))" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.isoformat" ], [ "CALL_FUNCTION_KW", "self.isoformat(sep=' ')" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_METHOD", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "format" ], [ "CALL_METHOD", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.tzname(self)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.dst(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "COMPARE_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL_FUNCTION_KW", "self.replace(fold=not self.fold)" ], [ "LOAD_METHOD", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL_METHOD", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL_FUNCTION_KW", "other.replace(fold=not other.fold)" ], [ "LOAD_METHOD", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL_METHOD", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "COMPARE_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "BINARY_SUBTRACT", "self - other" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION_KW", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL_FUNCTION", "divmod(delta.seconds, 3600)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL_FUNCTION", "divmod(rem, 60)" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_METHOD", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL_METHOD", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL_FUNCTION_KW", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL_METHOD", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_ADD", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_MULTIPLY", "self._minute * 60" ], [ "BINARY_ADD", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 3600" ], [ "BINARY_ADD", "self._second + self._minute * 60 + self._hour * 3600" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_MULTIPLY", "other._minute * 60" ], [ "BINARY_ADD", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 3600" ], [ "BINARY_ADD", "other._second + other._minute * 60 + other._hour * 3600" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "LOAD_FAST", "secs1" ], [ "LOAD_FAST", "secs2" ], [ "BINARY_SUBTRACT", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_SUBTRACT", "self._microsecond - other._microsecond" ], [ "CALL_FUNCTION", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "COMPARE_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "otoff is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "otoff" ], [ "BINARY_ADD", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_SUBTRACT", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "COMPARE_OP", "tzoff is None" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL_FUNCTION", "_ymd2ord(self.year, self.month, self.day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_MULTIPLY", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_MULTIPLY", "self.minute * 60" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL_FUNCTION", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "COMPARE_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "COMPARE_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_SUBTRACT", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_ADD", "firstday + 6" ], [ "BINARY_MODULO", "(firstday + 6) % 7" ], [ "LOAD_FAST", "firstday" ], [ "LOAD_FAST", "firstweekday" ], [ "BINARY_SUBTRACT", "firstday - firstweekday" ], [ "LOAD_FAST", "firstweekday" ], [ "LOAD_FAST", "THURSDAY" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "object()" ], [ "LOAD_NAME", "_Omitted" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=24, microseconds=-1)" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "COMPARE_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._create" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_METHOD", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "tzinfo.__new__(cls)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "COMPARE_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL_FUNCTION", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_FUNCTION", "hash(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utc" ], [ "COMPARE_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "COMPARE_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_MODULO", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BINARY_MODULO", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.tzname" ], [ "CALL_METHOD", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "COMPARE_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "COMPARE_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "COMPARE_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_METHOD", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "COMPARE_OP", "dt is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_ADD", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(delta, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ], [ "LOAD_FAST", "" ] ]python-executing-2.2.0/tests/sample_results/datetime-py-3.9.json000066400000000000000000007364051474076367500247170ustar00rootroot00000000000000[ [ "LOAD_NAME", "_DAYS_IN_MONTH" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[1:]" ], [ "LOAD_NAME", "_DAYS_BEFORE_MONTH" ], [ "LOAD_METHOD", "_DAYS_BEFORE_MONTH.append" ], [ "LOAD_NAME", "dbm" ], [ "CALL_METHOD", "_DAYS_BEFORE_MONTH.append(dbm)" ], [ "LOAD_NAME", "dim" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(401)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(101)" ], [ "LOAD_NAME", "_days_before_year" ], [ "CALL_FUNCTION", "_days_before_year(5)" ], [ "LOAD_NAME", "_DI4Y" ], [ "COMPARE_OP", "_DI4Y == 4 * 365 + 1" ], [ "LOAD_NAME", "_DI400Y" ], [ "LOAD_NAME", "_DI100Y" ], [ "BINARY_MULTIPLY", "4 * _DI100Y" ], [ "BINARY_ADD", "4 * _DI100Y + 1" ], [ "COMPARE_OP", "_DI400Y == 4 * _DI100Y + 1" ], [ "LOAD_NAME", "_DI100Y" ], [ "LOAD_NAME", "_DI4Y" ], [ "BINARY_MULTIPLY", "25 * _DI4Y" ], [ "BINARY_SUBTRACT", "25 * _DI4Y - 1" ], [ "COMPARE_OP", "_DI100Y == 25 * _DI4Y - 1" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(-999999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.min" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=999999999, hours=23, minutes=59, seconds=59,\n microseconds=999999)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "timedelta" ], [ "STORE_ATTR", "timedelta.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(1, 1, 1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.min" ], [ "LOAD_NAME", "date" ], [ "CALL_FUNCTION", "date(9999, 12, 31)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(days=1)" ], [ "LOAD_NAME", "date" ], [ "STORE_ATTR", "date.resolution" ], [ "LOAD_NAME", "tuple" ], [ "LOAD_NAME", "IsoCalendarDate" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "time" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(0, 0, 0)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.min" ], [ "LOAD_NAME", "time" ], [ "CALL_FUNCTION", "time(23, 59, 59, 999999)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "time" ], [ "STORE_ATTR", "time.resolution" ], [ "LOAD_NAME", "date" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(1, 1, 1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.min" ], [ "LOAD_NAME", "datetime" ], [ "CALL_FUNCTION", "datetime(9999, 12, 31, 23, 59, 59, 999999)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.max" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(microseconds=1)" ], [ "LOAD_NAME", "datetime" ], [ "STORE_ATTR", "datetime.resolution" ], [ "LOAD_NAME", "tzinfo" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "CALL_METHOD", "timezone._create(timedelta(0))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.utc" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "UNARY_NEGATIVE", "-timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(-timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.min" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_METHOD", "timezone._create" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=23, minutes=59)" ], [ "CALL_METHOD", "timezone._create(timedelta(hours=23, minutes=59))" ], [ "LOAD_NAME", "timezone" ], [ "STORE_ATTR", "timezone.max" ], [ "LOAD_NAME", "datetime" ], [ "LOAD_NAME", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "CALL_FUNCTION_KW", "datetime(1970, 1, 1, tzinfo=timezone.utc)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x == y" ], [ "LOAD_FAST", "x" ], [ "LOAD_FAST", "y" ], [ "COMPARE_OP", "x > y" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 4" ], [ "COMPARE_OP", "year % 4 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 100" ], [ "COMPARE_OP", "year % 100 != 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_MODULO", "year % 400" ], [ "COMPARE_OP", "year % 400 == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year - 1" ], [ "LOAD_FAST", "y" ], [ "BINARY_MULTIPLY", "y*365" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//4" ], [ "BINARY_ADD", "y*365 + y//4" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//100" ], [ "BINARY_SUBTRACT", "y*365 + y//4 - y//100" ], [ "LOAD_FAST", "y" ], [ "BINARY_FLOOR_DIVIDE", "y//400" ], [ "BINARY_ADD", "y*365 + y//4 - y//100 + y//400" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year))" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_GLOBAL", "_days_before_year" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_days_before_year(year)" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_before_month(year, month)" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "_days_before_year(year) +\n _days_before_month(year, month) +\n day" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI400Y" ], [ "CALL_FUNCTION", "divmod(n, _DI400Y)" ], [ "LOAD_FAST", "n400" ], [ "BINARY_MULTIPLY", "n400 * 400" ], [ "BINARY_ADD", "n400 * 400 + 1" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI100Y" ], [ "CALL_FUNCTION", "divmod(n, _DI100Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_DI4Y" ], [ "CALL_FUNCTION", "divmod(n, _DI4Y)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "divmod(n, 365)" ], [ "LOAD_FAST", "n100" ], [ "BINARY_MULTIPLY", "n100 * 100" ], [ "LOAD_FAST", "n4" ], [ "BINARY_MULTIPLY", "n4 * 4" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4" ], [ "LOAD_FAST", "n1" ], [ "BINARY_ADD", "n100 * 100 + n4 * 4 + n1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 4" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 4" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBTRACT", "year-1" ], [ "LOAD_FAST", "n1" ], [ "COMPARE_OP", "n1 == 3" ], [ "LOAD_FAST", "n4" ], [ "COMPARE_OP", "n4 != 24" ], [ "LOAD_FAST", "n100" ], [ "COMPARE_OP", "n100 == 3" ], [ "LOAD_FAST", "leapyear" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "COMPARE_OP", "leapyear == _is_leap(year)" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n + 50" ], [ "BINARY_RSHIFT", "(n + 50) >> 5" ], [ "LOAD_GLOBAL", "_DAYS_BEFORE_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_BEFORE_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month > 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "preceding > n" ], [ "LOAD_GLOBAL", "_DAYS_IN_MONTH" ], [ "LOAD_FAST", "month" ], [ "BINARY_SUBSCR", "_DAYS_IN_MONTH[month]" ], [ "LOAD_FAST", "month" ], [ "COMPARE_OP", "month == 2" ], [ "LOAD_FAST", "leapyear" ], [ "BINARY_ADD", "_DAYS_IN_MONTH[month] + (month == 2 and leapyear)" ], [ "LOAD_FAST", "preceding" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "n" ], [ "BINARY_ADD", "n+1" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "_ymd2ord(y, m, d)" ], [ "BINARY_ADD", "_ymd2ord(y, m, d) + 6" ], [ "BINARY_MODULO", "(_ymd2ord(y, m, d) + 6) % 7" ], [ "LOAD_GLOBAL", "_days_before_month" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "CALL_FUNCTION", "_days_before_month(y, m)" ], [ "LOAD_FAST", "d" ], [ "BINARY_ADD", "_days_before_month(y, m) + d" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "wday" ], [ "LOAD_FAST", "dnum" ], [ "LOAD_FAST", "dstflag" ], [ "CALL_METHOD", "_time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag))" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'auto'" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "timespec" ], [ "COMPARE_OP", "timespec == 'milliseconds'" ], [ "LOAD_FAST", "specs" ], [ "LOAD_FAST", "timespec" ], [ "BINARY_SUBSCR", "specs[timespec]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('Unknown timespec value')" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_METHOD", "fmt.format" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "CALL_METHOD", "fmt.format(hh, mm, ss, us)" ], [ "LOAD_FAST", "off" ], [ "IS_OP", "off is not None" ], [ "LOAD_FAST", "off" ], [ "LOAD_ATTR", "off.days" ], [ "COMPARE_OP", "off.days < 0" ], [ "LOAD_FAST", "off" ], [ "UNARY_NEGATIVE", "-off" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "off" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(off, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(mm, timedelta(minutes=1))" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "BINARY_MODULO", "\"%s%02d:%02d\" % (sign, hh, mm)" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.seconds" ], [ "BINARY_MODULO", "\":%02d\" % ss.seconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "LOAD_FAST", "ss" ], [ "LOAD_ATTR", "ss.microseconds" ], [ "BINARY_MODULO", "'.%06d' % ss.microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_ATTR", "newformat.append" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "format" ], [ "CALL_FUNCTION", "len(format)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == '%'" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "format" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "format[i]" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'f'" ], [ "LOAD_FAST", "freplace" ], [ "IS_OP", "freplace is None" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "getattr(object,\n 'microsecond', 0)" ], [ "BINARY_MODULO", "'%06d' % getattr(object,\n 'microsecond', 0)" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "freplace" ], [ "CALL_METHOD", "newformat.append(freplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'z'" ], [ "LOAD_FAST", "zreplace" ], [ "IS_OP", "zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"utcoffset\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.utcoffset" ], [ "CALL_METHOD", "object.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "IS_OP", "offset is not None" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.days" ], [ "COMPARE_OP", "offset.days < 0" ], [ "LOAD_FAST", "offset" ], [ "UNARY_NEGATIVE", "-offset" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(offset, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "offset" ], [ "LOAD_ATTR", "offset.microseconds" ], [ "LOAD_FAST", "u" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "u" ], [ "BINARY_MODULO", "'%c%02d%02d%02d.%06d' % (sign, h, m, s, u)" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "'%c%02d%02d%02d' % (sign, h, m, s)" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "BINARY_MODULO", "'%c%02d%02d' % (sign, h, m)" ], [ "LOAD_FAST", "zreplace" ], [ "CONTAINS_OP", "'%' not in zreplace" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "zreplace" ], [ "CALL_METHOD", "newformat.append(zreplace)" ], [ "LOAD_FAST", "ch" ], [ "COMPARE_OP", "ch == 'Z'" ], [ "LOAD_FAST", "Zreplace" ], [ "IS_OP", "Zreplace is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "object" ], [ "CALL_FUNCTION", "hasattr(object, \"tzname\")" ], [ "LOAD_FAST", "object" ], [ "LOAD_METHOD", "object.tzname" ], [ "CALL_METHOD", "object.tzname()" ], [ "LOAD_FAST", "s" ], [ "IS_OP", "s is not None" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.replace" ], [ "CALL_METHOD", "s.replace('%', '%%')" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_METHOD", "newformat.append" ], [ "LOAD_FAST", "Zreplace" ], [ "CALL_METHOD", "newformat.append(Zreplace)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_FAST", "push" ], [ "CALL_FUNCTION", "push('%')" ], [ "LOAD_FAST", "push" ], [ "LOAD_FAST", "ch" ], [ "CALL_FUNCTION", "push(ch)" ], [ "LOAD_METHOD", "\"\".join" ], [ "LOAD_FAST", "newformat" ], [ "CALL_METHOD", "\"\".join(newformat)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.strftime" ], [ "LOAD_FAST", "newformat" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_METHOD", "_time.strftime(newformat, timetuple)" ], [ "LOAD_FAST", "c" ], [ "CONTAINS_OP", "c in \"0123456789\"" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 7" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 7" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[4] == date_separator" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[5]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[5] == week_indicator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr < 8" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 8" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[8]" ], [ "LOAD_FAST", "date_separator" ], [ "COMPARE_OP", "dtstr[8] == date_separator" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr == 9" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid ISO string\")" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "len_dtstr > 10" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[10]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[10])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "LOAD_FAST", "week_indicator" ], [ "COMPARE_OP", "dtstr[4] == week_indicator" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "len_dtstr" ], [ "COMPARE_OP", "idx < len_dtstr" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "idx" ], [ "BINARY_SUBSCR", "dtstr[idx]" ], [ "CALL_FUNCTION", "_is_ascii_digit(dtstr[idx])" ], [ "LOAD_FAST", "idx" ], [ "COMPARE_OP", "idx < 9" ], [ "LOAD_FAST", "idx" ], [ "LOAD_FAST", "idx" ], [ "BINARY_MODULO", "idx % 2" ], [ "COMPARE_OP", "idx % 2 == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "CONTAINS_OP", "len(dtstr) in (7, 8, 10)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[0:4]" ], [ "CALL_FUNCTION", "int(dtstr[0:4])" ], [ "LOAD_FAST", "dtstr" ], [ "BINARY_SUBSCR", "dtstr[4]" ], [ "COMPARE_OP", "dtstr[4] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "BINARY_ADD", "4 + has_sep" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"W\"" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "dtstr" ], [ "CALL_FUNCTION", "len(dtstr)" ], [ "LOAD_FAST", "pos" ], [ "COMPARE_OP", "len(dtstr) > pos" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == '-'" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == '-') != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 1])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "weekno" ], [ "LOAD_FAST", "dayno" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, weekno, dayno)" ], [ "CALL_FUNCTION", "list(_isoweek_to_gregorian(year, weekno, dayno))" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 1" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 1]" ], [ "COMPARE_OP", "dtstr[pos:pos + 1] == \"-\"" ], [ "LOAD_FAST", "has_sep" ], [ "COMPARE_OP", "(dtstr[pos:pos + 1] == \"-\") != has_sep" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Inconsistent use of dash separator\")" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "dtstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos + 2" ], [ "BINARY_SUBSCR", "dtstr[pos:pos + 2]" ], [ "CALL_FUNCTION", "int(dtstr[pos:pos + 2])" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(0, 3)" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "COMPARE_OP", "(len_str - pos) < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Incomplete time component\")" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+2" ], [ "BINARY_SUBSCR", "tstr[pos:pos+2]" ], [ "CALL_FUNCTION", "int(tstr[pos:pos+2])" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "comp" ], [ "STORE_SUBSCR", "time_comps[comp]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "BINARY_ADD", "pos+1" ], [ "BINARY_SUBSCR", "tstr[pos:pos+1]" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp == 0" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char == ':'" ], [ "LOAD_FAST", "next_char" ], [ "LOAD_FAST", "comp" ], [ "COMPARE_OP", "comp >= 2" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "next_char" ], [ "COMPARE_OP", "next_char != ':'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "next_char" ], [ "BINARY_MODULO", "\"Invalid time separator: %c\" % next_char" ], [ "CALL_FUNCTION", "ValueError(\"Invalid time separator: %c\" % next_char)" ], [ "LOAD_FAST", "has_sep" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "pos < len_str" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBSCR", "tstr[pos]" ], [ "CONTAINS_OP", "tstr[pos] not in '.,'" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Invalid microsecond component\")" ], [ "LOAD_FAST", "len_str" ], [ "LOAD_FAST", "pos" ], [ "BINARY_SUBTRACT", "len_str - pos" ], [ "LOAD_FAST", "len_remainder" ], [ "COMPARE_OP", "len_remainder >= 6" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[pos:(pos+to_parse)]" ], [ "CALL_FUNCTION", "int(tstr[pos:(pos+to_parse)])" ], [ "LOAD_FAST", "time_comps" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "to_parse < 6" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "_FRACTION_CORRECTION" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_SUBTRACT", "to_parse-1" ], [ "BINARY_SUBSCR", "_FRACTION_CORRECTION[to_parse-1]" ], [ "STORE_SUBSCR", "time_comps[3]" ], [ "LOAD_FAST", "len_remainder" ], [ "LOAD_FAST", "to_parse" ], [ "COMPARE_OP", "len_remainder > to_parse" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "_is_ascii_digit" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "pos" ], [ "LOAD_FAST", "to_parse" ], [ "BINARY_ADD", "pos+to_parse" ], [ "BINARY_SUBSCR", "tstr[(pos+to_parse):]" ], [ "CALL_FUNCTION", "map(_is_ascii_digit, tstr[(pos+to_parse):])" ], [ "CALL_FUNCTION", "all(map(_is_ascii_digit, tstr[(pos+to_parse):]))" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Non-digit values in unparsed fraction\")" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "len(tstr)" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "len_str < 2" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Isoformat time too short\")" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('-')" ], [ "BINARY_ADD", "tstr.find('-') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('+')" ], [ "BINARY_ADD", "tstr.find('+') + 1" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_METHOD", "tstr.find" ], [ "CALL_METHOD", "tstr.find('Z')" ], [ "BINARY_ADD", "tstr.find('Z') + 1" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos-1" ], [ "BINARY_SUBSCR", "tstr[:tz_pos-1]" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "timestr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(timestr)" ], [ "LOAD_FAST", "tz_pos" ], [ "LOAD_FAST", "len_str" ], [ "COMPARE_OP", "tz_pos == len_str" ], [ "LOAD_FAST", "tstr" ], [ "BINARY_SUBSCR", "tstr[-1]" ], [ "COMPARE_OP", "tstr[-1] == 'Z'" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tz_pos" ], [ "COMPARE_OP", "tz_pos > 0" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBSCR", "tstr[tz_pos:]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "len(tzstr)" ], [ "CONTAINS_OP", "len(tzstr) in (0, 1, 3)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Malformed time zone string\")" ], [ "LOAD_GLOBAL", "_parse_hh_mm_ss_ff" ], [ "LOAD_FAST", "tzstr" ], [ "CALL_FUNCTION", "_parse_hh_mm_ss_ff(tzstr)" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "tz_comps" ], [ "CALL_FUNCTION", "all(x == 0 for x in tz_comps)" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_ATTR", "timezone.utc" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_FAST", "tz_pos" ], [ "BINARY_SUBTRACT", "tz_pos - 1" ], [ "BINARY_SUBSCR", "tstr[tz_pos - 1]" ], [ "COMPARE_OP", "tstr[tz_pos - 1] == '-'" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[0]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[1]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[2]" ], [ "LOAD_FAST", "tz_comps" ], [ "BINARY_SUBSCR", "tz_comps[3]" ], [ "CALL_FUNCTION_KW", "timedelta(hours=tz_comps[0], minutes=tz_comps[1],\n seconds=tz_comps[2], microseconds=tz_comps[3])" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_FAST", "tzsign" ], [ "LOAD_FAST", "td" ], [ "BINARY_MULTIPLY", "tzsign * td" ], [ "CALL_FUNCTION", "timezone(tzsign * td)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_METHOD", "time_comps.append" ], [ "LOAD_FAST", "tzi" ], [ "CALL_METHOD", "time_comps.append(tzi)" ], [ "LOAD_FAST", "time_comps" ], [ "LOAD_FAST", "x" ], [ "COMPARE_OP", "x == 0" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "ValueError(f\"Year is out of range: {year}\")" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week == 53" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "BINARY_MODULO", "_ymd2ord(year, 1, 1) % 7" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 4" ], [ "LOAD_FAST", "first_weekday" ], [ "COMPARE_OP", "first_weekday == 3" ], [ "LOAD_GLOBAL", "_is_leap" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_is_leap(year)" ], [ "LOAD_FAST", "out_of_range" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "week" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid week: {week}\")" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "ValueError(f\"Invalid weekday: {day} (range is [1, 7])\")" ], [ "LOAD_FAST", "week" ], [ "BINARY_SUBTRACT", "week - 1" ], [ "BINARY_MULTIPLY", "(week - 1) * 7" ], [ "LOAD_FAST", "day" ], [ "BINARY_SUBTRACT", "day - 1" ], [ "BINARY_ADD", "(week - 1) * 7 + (day - 1)" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_FAST", "day_1" ], [ "LOAD_FAST", "day_offset" ], [ "BINARY_ADD", "day_1 + day_offset" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "ord_day" ], [ "CALL_FUNCTION", "_ord2ymd(ord_day)" ], [ "LOAD_FAST", "name" ], [ "IS_OP", "name is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "type(name)" ], [ "BINARY_MODULO", "\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name)" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.tzname() must return None or string, \"\n \"not '%s'\" % type(name))" ], [ "LOAD_FAST", "name" ], [ "CONTAINS_OP", "name in (\"utcoffset\", \"dst\")" ], [ "LOAD_FAST", "offset" ], [ "IS_OP", "offset is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "type(offset)" ], [ "BINARY_MODULO", "\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset))" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo.%s() must return None \"\n \"or timedelta, not '%s'\" % (name, type(offset)))" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "UNARY_NEGATIVE", "-timedelta(1)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "offset" ], [ "BINARY_MODULO", "\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset)" ], [ "CALL_FUNCTION", "ValueError(\"%s()=%s, must be strictly between \"\n \"-timedelta(hours=24) and timedelta(hours=24)\" %\n (name, offset))" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_index(year)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_index(month)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_index(day)" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "MINYEAR" ], [ "LOAD_GLOBAL", "MAXYEAR" ], [ "BINARY_MODULO", "'year must be in %d..%d' % (MINYEAR, MAXYEAR)" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year)" ], [ "LOAD_FAST", "month" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "ValueError('month must be in 1..12', month)" ], [ "LOAD_GLOBAL", "_days_in_month" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_FUNCTION", "_days_in_month(year, month)" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "dim" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "dim" ], [ "BINARY_MODULO", "'day must be in 1..%d' % dim" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "ValueError('day must be in 1..%d' % dim, day)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "_index(hour)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "_index(minute)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "_index(second)" ], [ "LOAD_GLOBAL", "_index" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "_index(microsecond)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "ValueError('hour must be in 0..23', hour)" ], [ "LOAD_FAST", "minute" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "minute" ], [ "CALL_FUNCTION", "ValueError('minute must be in 0..59', minute)" ], [ "LOAD_FAST", "second" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "second" ], [ "CALL_FUNCTION", "ValueError('second must be in 0..59', second)" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "microsecond" ], [ "CALL_FUNCTION", "ValueError('microsecond must be in 0..999999', microsecond)" ], [ "LOAD_FAST", "fold" ], [ "CONTAINS_OP", "fold not in (0, 1)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "ValueError('fold must be either 0 or 1', fold)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzinfo argument must be None or of a tzinfo subclass\")" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "type(x)" ], [ "LOAD_ATTR", "type(x).__name__" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "type(y)" ], [ "LOAD_ATTR", "type(y).__name__" ], [ "BINARY_MODULO", "\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__)" ], [ "CALL_FUNCTION", "TypeError(\"can't compare '%s' to '%s'\" % (\n type(x).__name__, type(y).__name__))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "divmod(a, b)" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "b > 0" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r > b" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r < b" ], [ "LOAD_FAST", "greater_than_half" ], [ "LOAD_FAST", "r" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "r == b" ], [ "LOAD_FAST", "q" ], [ "BINARY_MODULO", "q % 2" ], [ "COMPARE_OP", "q % 2 == 1" ], [ "LOAD_FAST", "q" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__mul__" ], [ "LOAD_FAST", "weeks" ], [ "BINARY_MULTIPLY", "weeks*7" ], [ "LOAD_FAST", "minutes" ], [ "BINARY_MULTIPLY", "minutes*60" ], [ "LOAD_FAST", "hours" ], [ "BINARY_MULTIPLY", "hours*3600" ], [ "BINARY_ADD", "minutes*60 + hours*3600" ], [ "LOAD_FAST", "milliseconds" ], [ "BINARY_MULTIPLY", "milliseconds*1000" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(days, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "days" ], [ "CALL_METHOD", "_math.modf(days)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "dayfrac" ], [ "BINARY_MULTIPLY", "dayfrac * (24.*3600.)" ], [ "CALL_METHOD", "_math.modf(dayfrac * (24.*3600.))" ], [ "LOAD_FAST", "daysecondswhole" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "COMPARE_OP", "daysecondswhole == int(daysecondswhole)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "daysecondswhole" ], [ "CALL_FUNCTION", "int(daysecondswhole)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "COMPARE_OP", "days == int(days)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "days" ], [ "CALL_FUNCTION", "int(days)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(daysecondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "CALL_FUNCTION", "abs(daysecondsfrac)" ], [ "COMPARE_OP", "abs(daysecondsfrac) <= 1.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 24 * 3600" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(seconds, float)" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "seconds" ], [ "CALL_METHOD", "_math.modf(seconds)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "COMPARE_OP", "seconds == int(seconds)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_FAST", "daysecondsfrac" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "secondsfrac" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(secondsfrac, float)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "secondsfrac" ], [ "CALL_FUNCTION", "abs(secondsfrac)" ], [ "COMPARE_OP", "abs(secondsfrac) <= 2.0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(seconds, int)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "int(seconds)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 2 * 24 * 3600" ], [ "LOAD_FAST", "secondsfrac" ], [ "BINARY_MULTIPLY", "secondsfrac * 1e6" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "usdouble" ], [ "CALL_FUNCTION", "abs(usdouble)" ], [ "COMPARE_OP", "abs(usdouble) < 2.1e6" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(microseconds, float)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "int(microseconds)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "seconds" ], [ "CALL_FUNCTION", "divmod(seconds, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "usdouble" ], [ "BINARY_ADD", "microseconds + usdouble" ], [ "CALL_FUNCTION", "round(microseconds + usdouble)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(microseconds, int)" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "abs(s)" ], [ "COMPARE_OP", "abs(s) <= 3 * 24 * 3600" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "abs(microseconds)" ], [ "COMPARE_OP", "abs(microseconds) < 3.1e6" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "microseconds" ], [ "CALL_FUNCTION", "divmod(microseconds, 1000000)" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "divmod(s, 24*3600)" ], [ "LOAD_FAST", "days" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "d" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(d, int)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(s, int)" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(us, int)" ], [ "LOAD_FAST", "us" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "abs(d)" ], [ "COMPARE_OP", "abs(d) > 999999999" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "LOAD_FAST", "d" ], [ "BINARY_MODULO", "\"timedelta # of days is too large: %d\" % d" ], [ "CALL_FUNCTION", "OverflowError(\"timedelta # of days is too large: %d\" % d)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._days" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._seconds" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MODULO", "\"days=%d\" % self._days" ], [ "CALL_METHOD", "args.append(\"days=%d\" % self._days)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_MODULO", "\"seconds=%d\" % self._seconds" ], [ "CALL_METHOD", "args.append(\"seconds=%d\" % self._seconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\"microseconds=%d\" % self._microseconds" ], [ "CALL_METHOD", "args.append(\"microseconds=%d\" % self._microseconds)" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_METHOD", "args.append" ], [ "CALL_METHOD", "args.append('0')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "args" ], [ "CALL_METHOD", "', '.join(args)" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n ', '.join(args))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "CALL_FUNCTION", "divmod(self._seconds, 60)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "mm" ], [ "CALL_FUNCTION", "divmod(mm, 60)" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "BINARY_MODULO", "\"%d:%02d:%02d\" % (hh, mm, ss)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "plural" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "CALL_FUNCTION", "plural(self._days)" ], [ "BINARY_MODULO", "\"%d day%s, \" % plural(self._days)" ], [ "LOAD_FAST", "s" ], [ "BINARY_ADD", "(\"%d day%s, \" % plural(self._days)) + s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_MODULO", "\".%06d\" % self._microseconds" ], [ "BINARY_ADD", "s + \".%06d\" % self._microseconds" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "n" ], [ "LOAD_GLOBAL", "abs" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "abs(n)" ], [ "COMPARE_OP", "abs(n) != 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.days" ], [ "BINARY_MULTIPLY", "self.days * 86400" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.seconds" ], [ "BINARY_ADD", "self.days * 86400 + self.seconds" ], [ "BINARY_MULTIPLY", "(self.days * 86400 + self.seconds) * 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microseconds" ], [ "BINARY_ADD", "(self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds" ], [ "BINARY_TRUE_DIVIDE", "((self.days * 86400 + self.seconds) * 10**6 +\n self.microseconds) / 10**6" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_ADD", "self._days + other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_ADD", "self._seconds + other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_ADD", "self._microseconds + other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days + other._days,\n self._seconds + other._seconds,\n self._microseconds + other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._days" ], [ "BINARY_SUBTRACT", "self._days - other._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._seconds" ], [ "BINARY_SUBTRACT", "self._seconds - other._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microseconds" ], [ "BINARY_SUBTRACT", "self._microseconds - other._microseconds" ], [ "CALL_FUNCTION", "timedelta(self._days - other._days,\n self._seconds - other._seconds,\n self._microseconds - other._microseconds)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "other" ], [ "BINARY_ADD", "-self + other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "UNARY_NEGATIVE", "-self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "UNARY_NEGATIVE", "-self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "UNARY_NEGATIVE", "-self._microseconds" ], [ "CALL_FUNCTION", "timedelta(-self._days,\n -self._seconds,\n -self._microseconds)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days < 0" ], [ "LOAD_FAST", "self" ], [ "UNARY_NEGATIVE", "-self" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._days * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._seconds * other" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "other" ], [ "BINARY_MULTIPLY", "self._microseconds * other" ], [ "CALL_FUNCTION", "timedelta(self._days * other,\n self._seconds * other,\n self._microseconds * other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "a" ], [ "BINARY_MULTIPLY", "usec * a" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "_divide_and_round(usec * a, b)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec * a, b))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "BINARY_MULTIPLY", "self._days * (24*3600)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "BINARY_ADD", "self._days * (24*3600) + self._seconds" ], [ "BINARY_MULTIPLY", "(self._days * (24*3600) + self._seconds) * 1000000" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "BINARY_ADD", "(self._days * (24*3600) + self._seconds) * 1000000 +\n self._microseconds" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_FLOOR_DIVIDE", "usec // other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "BINARY_FLOOR_DIVIDE", "usec // other" ], [ "CALL_FUNCTION", "timedelta(0, 0, usec // other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_GLOBAL", "float" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, (int, float, timedelta))" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_TRUE_DIVIDE", "usec / other._to_microseconds()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "isinstance(other, int)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "usec" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_divide_and_round(usec, other)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(usec, other))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "float" ], [ "CALL_FUNCTION", "isinstance(other, float)" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.as_integer_ratio" ], [ "CALL_METHOD", "other.as_integer_ratio()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_GLOBAL", "_divide_and_round" ], [ "LOAD_FAST", "b" ], [ "LOAD_FAST", "usec" ], [ "BINARY_MULTIPLY", "b * usec" ], [ "LOAD_FAST", "a" ], [ "CALL_FUNCTION", "_divide_and_round(b * usec, a)" ], [ "CALL_FUNCTION", "timedelta(0, 0, _divide_and_round(b * usec, a))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "BINARY_MODULO", "self._to_microseconds() % other._to_microseconds()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._to_microseconds" ], [ "CALL_METHOD", "self._to_microseconds()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._to_microseconds" ], [ "CALL_METHOD", "other._to_microseconds()" ], [ "CALL_FUNCTION", "divmod(self._to_microseconds(),\n other._to_microseconds())" ], [ "LOAD_FAST", "q" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "r" ], [ "CALL_FUNCTION", "timedelta(0, 0, r)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other._getstate" ], [ "CALL_METHOD", "other._getstate()" ], [ "CALL_FUNCTION", "_cmp(self._getstate(), other._getstate())" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "COMPARE_OP", "self._days != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "COMPARE_OP", "self._seconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "COMPARE_OP", "self._microseconds != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._days" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 4" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_FAST", "year" ], [ "LOAD_METHOD", "year.encode" ], [ "CALL_METHOD", "year.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a date object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "CALL_METHOD", "self.__setstate(year)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_time.localtime(t)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.fromtimestamp(t)" ], [ "LOAD_GLOBAL", "_ord2ymd" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "_ord2ymd(n)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "CALL_FUNCTION", "cls(y, m, d)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "CONTAINS_OP", "len(date_string) not in (7, 8, 10)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_parse_isoformat_date(date_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_date(date_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_isoweek_to_gregorian" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_isoweek_to_gregorian(year, week, day)" ], [ "CALL_FUNCTION_EX", "cls(*_isoweek_to_gregorian(year, week, day))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d, %d)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._year,\n self._month,\n self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d 00:00:00 %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day, self._year)" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.timetuple" ], [ "CALL_METHOD", "self.timetuple()" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, self.timetuple())" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d\" % (self._year, self._month, self._day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_build_struct_time(self._year, self._month, self._day,\n 0, 0, 0, -1)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_FAST", "year" ], [ "IS_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "IS_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "type(self)(year, month, day)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "y2" ], [ "LOAD_FAST", "m2" ], [ "LOAD_FAST", "d2" ], [ "CALL_FUNCTION", "_cmp((y, m, d), (y2, m2, d2))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "CALL_FUNCTION", "hash(self._getstate())" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "BINARY_ADD", "self.toordinal() + other.days" ], [ "LOAD_FAST", "o" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).fromordinal" ], [ "LOAD_FAST", "o" ], [ "CALL_METHOD", "type(self).fromordinal(o)" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.days" ], [ "UNARY_NEGATIVE", "-other.days" ], [ "CALL_FUNCTION", "timedelta(-other.days)" ], [ "BINARY_ADD", "self + timedelta(-other.days)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "CALL_FUNCTION", "timedelta(days1 - days2)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_ADD", "self.toordinal() + 6" ], [ "BINARY_MODULO", "(self.toordinal() + 6) % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "_ymd2ord(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week < 0" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_isoweek1monday(year)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "today" ], [ "LOAD_FAST", "week1monday" ], [ "BINARY_SUBTRACT", "today - week1monday" ], [ "CALL_FUNCTION", "divmod(today - week1monday, 7)" ], [ "LOAD_FAST", "week" ], [ "COMPARE_OP", "week >= 52" ], [ "LOAD_FAST", "today" ], [ "LOAD_GLOBAL", "_isoweek1monday" ], [ "LOAD_FAST", "year" ], [ "BINARY_ADD", "year+1" ], [ "CALL_FUNCTION", "_isoweek1monday(year+1)" ], [ "COMPARE_OP", "today >= _isoweek1monday(year+1)" ], [ "LOAD_GLOBAL", "_IsoCalendarDate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "BINARY_ADD", "week+1" ], [ "LOAD_FAST", "day" ], [ "BINARY_ADD", "day+1" ], [ "CALL_FUNCTION", "_IsoCalendarDate(year, week+1, day+1)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, self._month, self._day])" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "CALL_METHOD", "self._getstate()" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override tzname()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override utcoffset()\")" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"tzinfo subclass must override dst()\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() requires a datetime argument\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"dt.tzinfo is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.utcoffset" ], [ "CALL_METHOD", "dt.utcoffset()" ], [ "LOAD_FAST", "dtoff" ], [ "IS_OP", "dtoff is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None utcoffset() \"\n \"result\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "IS_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc() requires a non-None dst() result\")" ], [ "LOAD_FAST", "dtoff" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_SUBTRACT", "dtoff - dtdst" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.dst" ], [ "CALL_METHOD", "dt.dst()" ], [ "LOAD_FAST", "dtdst" ], [ "IS_OP", "dtdst is None" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc(): dt.dst gave inconsistent \"\n \"results; cannot convert\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "dtdst" ], [ "BINARY_ADD", "dt + dtdst" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "getattr(self, \"__getinitargs__\", None)" ], [ "LOAD_FAST", "getinitargs" ], [ "LOAD_FAST", "getinitargs" ], [ "CALL_FUNCTION", "getinitargs()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__getstate__" ], [ "CALL_METHOD", "self.__getstate__()" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_GLOBAL", "super" ], [ "CALL_FUNCTION", "super()" ], [ "LOAD_METHOD", "super().__new__" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "week" ], [ "LOAD_FAST", "weekday" ], [ "CALL_METHOD", "super().__new__(cls, (year, week, weekday))" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "tuple(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__name__" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[0]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[1]" ], [ "LOAD_FAST", "self" ], [ "BINARY_SUBSCR", "self[2]" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "isoformat" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "hour" ], [ "CALL_FUNCTION", "len(hour)" ], [ "COMPARE_OP", "len(hour) == 6" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "hour" ], [ "BINARY_SUBSCR", "hour[0:1]" ], [ "CALL_FUNCTION", "ord(hour[0:1])" ], [ "BINARY_AND", "ord(hour[0:1])&0x7F" ], [ "COMPARE_OP", "ord(hour[0:1])&0x7F < 24" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "hour" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(hour, str)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_METHOD", "hour.encode" ], [ "CALL_METHOD", "hour.encode('latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a time object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "CALL_METHOD", "self.__setstate(hour, minute or None)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "time" ], [ "CALL_FUNCTION", "isinstance(other, time)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._hour, self._minute, self._second,\n self._microsecond),\n (other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware times\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_ADD", "self._hour * 60 + self._minute" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "myoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "self._hour * 60 + self._minute - myoff//timedelta(minutes=1)" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_ADD", "other._hour * 60 + other._minute" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_FLOOR_DIVIDE", "otoff//timedelta(minutes=1)" ], [ "BINARY_SUBTRACT", "other._hour * 60 + other._minute - otoff//timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "myhhmm" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "othhmm" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((myhhmm, self._second, self._microsecond),\n (othhmm, other._second, other._microsecond))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "CALL_FUNCTION_KW", "timedelta(hours=self.hour, minutes=self.minute)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(hours=self.hour, minutes=self.minute) - tzoff" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,\n timedelta(hours=1))" ], [ "LOAD_FAST", "m" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "BINARY_MODULO", "m % timedelta(minutes=1)" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "LOAD_FAST", "h" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "time(h, m, self.second, self.microsecond)" ], [ "CALL_FUNCTION", "hash(time(h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "hash((h, m, self.second, self.microsecond))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "COMPARE_OP", "self._microsecond != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "BINARY_MODULO", "\", %d, %d\" % (self._second, self._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "COMPARE_OP", "self._second != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "BINARY_MODULO", "\", %d\" % self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "s" ], [ "BINARY_MODULO", "\"%s.%s(%d, %d%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._hour, self._minute, s)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._tzstr" ], [ "CALL_METHOD", "self._tzstr()" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(time_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_FAST", "time_string" ], [ "LOAD_METHOD", "time_string.removeprefix" ], [ "CALL_METHOD", "time_string.removeprefix('T')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "time_string" ], [ "CALL_FUNCTION", "_parse_isoformat_time(time_string)" ], [ "CALL_FUNCTION_EX", "cls(*_parse_isoformat_time(time_string))" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "time_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {time_string!r}')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_GLOBAL", "_wrap_strftime" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_FAST", "timetuple" ], [ "CALL_FUNCTION", "_wrap_strftime(self, fmt, timetuple)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "fmt" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(fmt, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "type(fmt)" ], [ "LOAD_ATTR", "type(fmt).__name__" ], [ "BINARY_MODULO", "\"must be str, not %s\" % type(fmt).__name__" ], [ "CALL_FUNCTION", "TypeError(\"must be str, not %s\" % type(fmt).__name__)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "fmt" ], [ "CALL_FUNCTION", "len(fmt)" ], [ "COMPARE_OP", "len(fmt) != 0" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.strftime" ], [ "LOAD_FAST", "fmt" ], [ "CALL_METHOD", "self.strftime(fmt)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "str(self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "CALL_METHOD", "self._tzinfo.tzname(None)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "CALL_METHOD", "self._tzinfo.dst(None)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "hour" ], [ "IS_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "IS_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "IS_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "IS_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "IS_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(hour, minute, second, microsecond, tzinfo, fold=fold)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([h, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "h" ], [ "COMPARE_OP", "h > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "BINARY_SUBTRACT", "h - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_NAME", "date" ], [ "LOAD_ATTR", "date.__slots__" ], [ "LOAD_NAME", "time" ], [ "LOAD_ATTR", "time.__slots__" ], [ "BINARY_ADD", "date.__slots__ + time.__slots__" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, (bytes, str))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "len(year)" ], [ "COMPARE_OP", "len(year) == 10" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "year" ], [ "BINARY_SUBSCR", "year[2:3]" ], [ "CALL_FUNCTION", "ord(year[2:3])" ], [ "BINARY_AND", "ord(year[2:3])&0x7F" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "year" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(year, str)" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "bytes(year, 'latin1')" ], [ "LOAD_GLOBAL", "UnicodeEncodeError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\n \"Failed to encode latin1 string when unpickling \"\n \"a datetime object. \"\n \"pickle.load(data, encoding='latin1') is assumed.\")" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__setstate" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "CALL_METHOD", "self.__setstate(year, month)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_check_date_fields" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "CALL_FUNCTION", "_check_date_fields(year, month, day)" ], [ "LOAD_GLOBAL", "_check_time_fields" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION", "_check_time_fields(\n hour, minute, second, microsecond, fold)" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tzinfo" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tzinfo)" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_METHOD", "object.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "object.__new__(cls)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "fold" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_GLOBAL", "_math" ], [ "LOAD_METHOD", "_math.modf" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "_math.modf(t)" ], [ "LOAD_GLOBAL", "round" ], [ "LOAD_FAST", "frac" ], [ "BINARY_MULTIPLY", "frac * 1e6" ], [ "CALL_FUNCTION", "round(frac * 1e6)" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us >= 1000000" ], [ "LOAD_FAST", "us" ], [ "COMPARE_OP", "us < 0" ], [ "LOAD_FAST", "utc" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.gmtime" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_ATTR", "_time.localtime" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "converter(t)" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "min(ss, 59)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is None" ], [ "LOAD_FAST", "utc" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "COMPARE_OP", "t < max_fold_seconds" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.platform" ], [ "LOAD_METHOD", "sys.platform.startswith" ], [ "CALL_METHOD", "sys.platform.startswith(\"win\")" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "BINARY_SUBTRACT", "t - max_fold_seconds" ], [ "CALL_FUNCTION", "converter(t - max_fold_seconds)" ], [ "BINARY_SUBSCR", "converter(t - max_fold_seconds)[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "probe1" ], [ "BINARY_SUBTRACT", "result - probe1" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "CALL_FUNCTION", "timedelta(0, max_fold_seconds)" ], [ "BINARY_SUBTRACT", "result - probe1 - timedelta(0, max_fold_seconds)" ], [ "LOAD_FAST", "trans" ], [ "LOAD_ATTR", "trans.days" ], [ "COMPARE_OP", "trans.days < 0" ], [ "LOAD_FAST", "converter" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "trans" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "trans // timedelta(0, 1)" ], [ "BINARY_ADD", "t + trans // timedelta(0, 1)" ], [ "CALL_FUNCTION", "converter(t + trans // timedelta(0, 1))" ], [ "BINARY_SUBSCR", "converter(t + trans // timedelta(0, 1))[:6]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "LOAD_FAST", "us" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "cls(y, m, d, hh, mm, ss, us, tz)" ], [ "LOAD_FAST", "probe2" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "probe2 == result" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result._fold" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "result" ], [ "CALL_METHOD", "tz.fromutc(result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "_check_tzinfo_arg" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION", "_check_tzinfo_arg(tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is not None" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls._fromtimestamp(t, tz is not None, tz)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls._fromtimestamp(t, True, None)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.fromtimestamp" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "tz" ], [ "CALL_METHOD", "cls.fromtimestamp(t, tz)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.time" ], [ "CALL_METHOD", "_time.time()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.utcfromtimestamp" ], [ "LOAD_FAST", "t" ], [ "CALL_METHOD", "cls.utcfromtimestamp(t)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date" ], [ "LOAD_GLOBAL", "_date_class" ], [ "CALL_FUNCTION", "isinstance(date, _date_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"date argument must be a date instance\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "time" ], [ "LOAD_GLOBAL", "_time_class" ], [ "CALL_FUNCTION", "isinstance(time, _time_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"time argument must be a time instance\")" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.tzinfo" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.year" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.month" ], [ "LOAD_FAST", "date" ], [ "LOAD_ATTR", "date.day" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.hour" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.minute" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.second" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "time" ], [ "LOAD_ATTR", "time.fold" ], [ "CALL_FUNCTION_KW", "cls(date.year, date.month, date.day,\n time.hour, time.minute, time.second, time.microsecond,\n tzinfo, fold=time.fold)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(date_string, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('fromisoformat: argument must be str')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "len(date_string)" ], [ "COMPARE_OP", "len(date_string) < 7" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_GLOBAL", "_find_isoformat_datetime_separator" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "_find_isoformat_datetime_separator(date_string)" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_SUBSCR", "date_string[0:separator_location]" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "separator_location" ], [ "BINARY_ADD", "separator_location+1" ], [ "BINARY_SUBSCR", "date_string[(separator_location+1):]" ], [ "LOAD_GLOBAL", "_parse_isoformat_date" ], [ "LOAD_FAST", "dstr" ], [ "CALL_FUNCTION", "_parse_isoformat_date(dstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "tstr" ], [ "LOAD_GLOBAL", "_parse_isoformat_time" ], [ "LOAD_FAST", "tstr" ], [ "CALL_FUNCTION", "_parse_isoformat_time(tstr)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_FAST", "date_string" ], [ "CALL_FUNCTION", "ValueError(\n f'Invalid isoformat string: {date_string!r}')" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_components" ], [ "LOAD_FAST", "time_components" ], [ "BINARY_ADD", "date_components + time_components" ], [ "CALL_FUNCTION_EX", "cls(*(date_components + time_components))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.dst" ], [ "CALL_METHOD", "self.dst()" ], [ "LOAD_FAST", "dst" ], [ "IS_OP", "dst is None" ], [ "LOAD_FAST", "dst" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "dst" ], [ "CALL_FUNCTION", "_build_struct_time(self.year, self.month, self.day,\n self.hour, self.minute, self.second,\n dst)" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "datetime(1970, 1, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "self - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "t" ], [ "CALL_FUNCTION", "local(t)" ], [ "LOAD_FAST", "t" ], [ "BINARY_SUBTRACT", "local(t) - t" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "a" ], [ "BINARY_SUBTRACT", "t - a" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u1" ], [ "CALL_FUNCTION", "local(u1)" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "UNARY_NEGATIVE", "-max_fold_seconds" ], [ "LOAD_FAST", "max_fold_seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "BINARY_ADD", "u1 + (-max_fold_seconds, max_fold_seconds)[self.fold]" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "u2" ], [ "BINARY_SUBTRACT", "local(u2) - u2" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a == b" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "u1" ], [ "BINARY_SUBTRACT", "t1 - u1" ], [ "LOAD_FAST", "a" ], [ "LOAD_FAST", "b" ], [ "COMPARE_OP", "a != b" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBTRACT", "t - b" ], [ "LOAD_FAST", "local" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "local(u2)" ], [ "LOAD_FAST", "t2" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t2 == t" ], [ "LOAD_FAST", "u2" ], [ "LOAD_FAST", "t1" ], [ "LOAD_FAST", "t" ], [ "COMPARE_OP", "t1 == t" ], [ "LOAD_FAST", "u1" ], [ "LOAD_GLOBAL", "max" ], [ "LOAD_GLOBAL", "min" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "BINARY_SUBSCR", "(max, min)[self.fold]" ], [ "LOAD_FAST", "u1" ], [ "LOAD_FAST", "u2" ], [ "CALL_FUNCTION", "(max, min)[self.fold](u1, u2)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "u" ], [ "CALL_METHOD", "_time.localtime(u)" ], [ "BINARY_SUBSCR", "_time.localtime(u)[:6]" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "datetime(y, m, d, hh, mm, ss)" ], [ "LOAD_DEREF", "epoch" ], [ "BINARY_SUBTRACT", "datetime(y, m, d, hh, mm, ss) - epoch" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0, 1)" ], [ "BINARY_FLOOR_DIVIDE", "(datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "BINARY_TRUE_DIVIDE", "self.microsecond / 1e6" ], [ "BINARY_ADD", "s + self.microsecond / 1e6" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_METHOD", "(self - _EPOCH).total_seconds" ], [ "CALL_METHOD", "(self - _EPOCH).total_seconds()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_GLOBAL", "_build_struct_time" ], [ "LOAD_FAST", "y" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "d" ], [ "LOAD_FAST", "hh" ], [ "LOAD_FAST", "mm" ], [ "LOAD_FAST", "ss" ], [ "CALL_FUNCTION", "_build_struct_time(y, m, d, hh, mm, ss, 0)" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "CALL_FUNCTION", "date(self._year, self._month, self._day)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "CALL_FUNCTION_KW", "time(self.hour, self.minute, self.second, self.microsecond,\n self._tzinfo, fold=self.fold)" ], [ "LOAD_FAST", "year" ], [ "IS_OP", "year is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "month" ], [ "IS_OP", "month is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "day" ], [ "IS_OP", "day is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "LOAD_FAST", "hour" ], [ "IS_OP", "hour is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "LOAD_FAST", "minute" ], [ "IS_OP", "minute is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "LOAD_FAST", "second" ], [ "IS_OP", "second is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "LOAD_FAST", "microsecond" ], [ "IS_OP", "microsecond is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "fold" ], [ "IS_OP", "fold is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_FAST", "year" ], [ "LOAD_FAST", "month" ], [ "LOAD_FAST", "day" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "fold" ], [ "CALL_FUNCTION_KW", "type(self)(year, month, day, hour, minute, second,\n microsecond, tzinfo, fold=fold)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "IS_OP", "self.tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._mktime" ], [ "CALL_METHOD", "self._mktime()" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "_EPOCH" ], [ "BINARY_SUBTRACT", "self - _EPOCH" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=1)" ], [ "BINARY_FLOOR_DIVIDE", "(self - _EPOCH) // timedelta(seconds=1)" ], [ "LOAD_GLOBAL", "_time" ], [ "LOAD_METHOD", "_time.localtime" ], [ "LOAD_FAST", "ts" ], [ "CALL_METHOD", "_time.localtime(ts)" ], [ "LOAD_GLOBAL", "datetime" ], [ "LOAD_FAST", "localtm" ], [ "BINARY_SUBSCR", "localtm[:6]" ], [ "CALL_FUNCTION_EX", "datetime(*localtm[:6])" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_gmtoff" ], [ "LOAD_FAST", "localtm" ], [ "LOAD_ATTR", "localtm.tm_zone" ], [ "LOAD_GLOBAL", "timezone" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "gmtoff" ], [ "CALL_FUNCTION_KW", "timedelta(seconds=gmtoff)" ], [ "LOAD_FAST", "zone" ], [ "CALL_FUNCTION", "timezone(timedelta(seconds=gmtoff), zone)" ], [ "LOAD_FAST", "tz" ], [ "IS_OP", "tz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tz" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "CALL_FUNCTION", "isinstance(tz, tzinfo)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tz argument must be an instance of tzinfo\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "mytz is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._local_timezone" ], [ "CALL_METHOD", "self._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "myoffset" ], [ "IS_OP", "myoffset is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(tzinfo=None)" ], [ "LOAD_METHOD", "self.replace(tzinfo=None)._local_timezone" ], [ "CALL_METHOD", "self.replace(tzinfo=None)._local_timezone()" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_METHOD", "mytz.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "mytz.utcoffset(self)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "mytz" ], [ "IS_OP", "tz is mytz" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "myoffset" ], [ "BINARY_SUBTRACT", "self - myoffset" ], [ "LOAD_ATTR", "(self - myoffset).replace" ], [ "LOAD_FAST", "tz" ], [ "CALL_FUNCTION_KW", "(self - myoffset).replace(tzinfo=tz)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_METHOD", "tz.fromutc" ], [ "LOAD_FAST", "utc" ], [ "CALL_METHOD", "tz.fromutc(utc)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "BINARY_MODULO", "self.toordinal() % 7" ], [ "LOAD_GLOBAL", "_DAYNAMES" ], [ "LOAD_FAST", "weekday" ], [ "BINARY_SUBSCR", "_DAYNAMES[weekday]" ], [ "LOAD_GLOBAL", "_MONTHNAMES" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "BINARY_SUBSCR", "_MONTHNAMES[self._month]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "BINARY_MODULO", "\"%s %s %2d %02d:%02d:%02d %04d\" % (\n _DAYNAMES[weekday],\n _MONTHNAMES[self._month],\n self._day,\n self._hour, self._minute, self._second,\n self._year)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "sep" ], [ "BINARY_MODULO", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep)" ], [ "LOAD_GLOBAL", "_format_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "timespec" ], [ "CALL_FUNCTION", "_format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "BINARY_ADD", "\"%04d-%02d-%02d%c\" % (self._year, self._month, self._day, sep) +\n _format_time(self._hour, self._minute, self._second,\n self._microsecond, timespec)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_GLOBAL", "_format_offset" ], [ "LOAD_FAST", "off" ], [ "CALL_FUNCTION", "_format_offset(off)" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "tz" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "L" ], [ "BINARY_SUBSCR", "L[-1]" ], [ "COMPARE_OP", "L[-1] == 0" ], [ "LOAD_FAST", "L" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_METHOD", "\", \".join" ], [ "LOAD_GLOBAL", "map" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "L" ], [ "CALL_FUNCTION", "map(str, L)" ], [ "CALL_METHOD", "\", \".join(map(str, L))" ], [ "BINARY_MODULO", "\"%s.%s(%s)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n \", \".join(map(str, L)))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is not None" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "BINARY_MODULO", "\", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo" ], [ "BINARY_ADD", "s[:-1] + \", tzinfo=%r\" % self._tzinfo + \")\"" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[-1:]" ], [ "COMPARE_OP", "s[-1:] == \")\"" ], [ "LOAD_FAST", "s" ], [ "BINARY_SUBSCR", "s[:-1]" ], [ "BINARY_ADD", "s[:-1] + \", fold=1)\"" ], [ "LOAD_FAST", "s" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.isoformat" ], [ "CALL_FUNCTION_KW", "self.isoformat(sep=' ')" ], [ "LOAD_FAST", "_strptime" ], [ "LOAD_METHOD", "_strptime._strptime_datetime" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "date_string" ], [ "LOAD_FAST", "format" ], [ "CALL_METHOD", "_strptime._strptime_datetime(cls, date_string, format)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.utcoffset" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.utcoffset(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"utcoffset\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.tzname" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.tzname(self)" ], [ "LOAD_GLOBAL", "_check_tzname" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "_check_tzname(name)" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_METHOD", "self._tzinfo.dst" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self._tzinfo.dst(self)" ], [ "LOAD_GLOBAL", "_check_utc_offset" ], [ "LOAD_FAST", "offset" ], [ "CALL_FUNCTION", "_check_utc_offset(\"dst\", offset)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION_KW", "self._cmp(other, allow_mixed=True)" ], [ "COMPARE_OP", "self._cmp(other, allow_mixed=True) == 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) <= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) < 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) >= 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._cmp" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self._cmp(other)" ], [ "COMPARE_OP", "self._cmp(other) > 0" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "date" ], [ "CALL_FUNCTION", "isinstance(other, date)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "_cmperror" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "_cmperror(self, other)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "LOAD_FAST", "mytz" ], [ "LOAD_FAST", "ottz" ], [ "IS_OP", "mytz is ottz" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "UNARY_NOT", "not self.fold" ], [ "CALL_FUNCTION_KW", "self.replace(fold=not self.fold)" ], [ "LOAD_METHOD", "self.replace(fold=not self.fold).utcoffset" ], [ "CALL_METHOD", "self.replace(fold=not self.fold).utcoffset()" ], [ "COMPARE_OP", "myoff != self.replace(fold=not self.fold).utcoffset()" ], [ "LOAD_FAST", "otoff" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.replace" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other.fold" ], [ "UNARY_NOT", "not other.fold" ], [ "CALL_FUNCTION_KW", "other.replace(fold=not other.fold)" ], [ "LOAD_METHOD", "other.replace(fold=not other.fold).utcoffset" ], [ "CALL_METHOD", "other.replace(fold=not other.fold).utcoffset()" ], [ "COMPARE_OP", "otoff != other.replace(fold=not other.fold).utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base_compare" ], [ "LOAD_GLOBAL", "_cmp" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._year" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._month" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._day" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "CALL_FUNCTION", "_cmp((self._year, self._month, self._day,\n self._hour, self._minute, self._second,\n self._microsecond),\n (other._year, other._month, other._day,\n other._hour, other._minute, other._second,\n other._microsecond))" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_FAST", "allow_mixed" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot compare naive and aware datetimes\")" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "BINARY_SUBTRACT", "self - other" ], [ "LOAD_FAST", "diff" ], [ "LOAD_ATTR", "diff.days" ], [ "COMPARE_OP", "diff.days < 0" ], [ "LOAD_FAST", "diff" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION_KW", "timedelta(self.toordinal(),\n hours=self._hour,\n minutes=self._minute,\n seconds=self._second,\n microseconds=self._microsecond)" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.seconds" ], [ "CALL_FUNCTION", "divmod(delta.seconds, 3600)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rem" ], [ "CALL_FUNCTION", "divmod(rem, 60)" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "LOAD_GLOBAL", "_MAXORDINAL" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "type(self)" ], [ "LOAD_METHOD", "type(self).combine" ], [ "LOAD_GLOBAL", "date" ], [ "LOAD_METHOD", "date.fromordinal" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.days" ], [ "CALL_METHOD", "date.fromordinal(delta.days)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_FAST", "hour" ], [ "LOAD_FAST", "minute" ], [ "LOAD_FAST", "second" ], [ "LOAD_FAST", "delta" ], [ "LOAD_ATTR", "delta.microseconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "CALL_FUNCTION_KW", "time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo)" ], [ "CALL_METHOD", "type(self).combine(date.fromordinal(delta.days),\n time(hour, minute, second,\n delta.microseconds,\n tzinfo=self._tzinfo))" ], [ "LOAD_GLOBAL", "OverflowError" ], [ "CALL_FUNCTION", "OverflowError(\"result out of range\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(other, datetime)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(other, timedelta)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "other" ], [ "UNARY_NEGATIVE", "-other" ], [ "BINARY_ADD", "self + -other" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.toordinal" ], [ "CALL_METHOD", "self.toordinal()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.toordinal" ], [ "CALL_METHOD", "other.toordinal()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "BINARY_MULTIPLY", "self._minute * 60" ], [ "BINARY_ADD", "self._second + self._minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "BINARY_MULTIPLY", "self._hour * 3600" ], [ "BINARY_ADD", "self._second + self._minute * 60 + self._hour * 3600" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._second" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._minute" ], [ "BINARY_MULTIPLY", "other._minute * 60" ], [ "BINARY_ADD", "other._second + other._minute * 60" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._hour" ], [ "BINARY_MULTIPLY", "other._hour * 3600" ], [ "BINARY_ADD", "other._second + other._minute * 60 + other._hour * 3600" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days1" ], [ "LOAD_FAST", "days2" ], [ "BINARY_SUBTRACT", "days1 - days2" ], [ "LOAD_FAST", "secs1" ], [ "LOAD_FAST", "secs2" ], [ "BINARY_SUBTRACT", "secs1 - secs2" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._microsecond" ], [ "BINARY_SUBTRACT", "self._microsecond - other._microsecond" ], [ "CALL_FUNCTION", "timedelta(days1 - days2,\n secs1 - secs2,\n self._microsecond - other._microsecond)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._tzinfo" ], [ "IS_OP", "self._tzinfo is other._tzinfo" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.utcoffset" ], [ "CALL_METHOD", "self.utcoffset()" ], [ "LOAD_FAST", "other" ], [ "LOAD_METHOD", "other.utcoffset" ], [ "CALL_METHOD", "other.utcoffset()" ], [ "LOAD_FAST", "myoff" ], [ "LOAD_FAST", "otoff" ], [ "COMPARE_OP", "myoff == otoff" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "myoff" ], [ "IS_OP", "myoff is None" ], [ "LOAD_FAST", "otoff" ], [ "IS_OP", "otoff is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"cannot mix naive and timezone-aware time\")" ], [ "LOAD_FAST", "base" ], [ "LOAD_FAST", "otoff" ], [ "BINARY_ADD", "base + otoff" ], [ "LOAD_FAST", "myoff" ], [ "BINARY_SUBTRACT", "base + otoff - myoff" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "COMPARE_OP", "self._hashcode == -1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.fold" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.replace" ], [ "CALL_FUNCTION_KW", "self.replace(fold=0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t.utcoffset" ], [ "CALL_METHOD", "t.utcoffset()" ], [ "LOAD_FAST", "tzoff" ], [ "IS_OP", "tzoff is None" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "t" ], [ "LOAD_METHOD", "t._getstate" ], [ "CALL_METHOD", "t._getstate()" ], [ "BINARY_SUBSCR", "t._getstate()[0]" ], [ "CALL_FUNCTION", "hash(t._getstate()[0])" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.year" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.day" ], [ "CALL_FUNCTION", "_ymd2ord(self.year, self.month, self.day)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.hour" ], [ "BINARY_MULTIPLY", "self.hour * 3600" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.minute" ], [ "BINARY_MULTIPLY", "self.minute * 60" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.second" ], [ "BINARY_ADD", "self.hour * 3600 + self.minute * 60 + self.second" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_GLOBAL", "timedelta" ], [ "LOAD_FAST", "days" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.microsecond" ], [ "CALL_FUNCTION", "timedelta(days, seconds, self.microsecond)" ], [ "LOAD_FAST", "tzoff" ], [ "BINARY_SUBTRACT", "timedelta(days, seconds, self.microsecond) - tzoff" ], [ "CALL_FUNCTION", "hash(timedelta(days, seconds, self.microsecond) - tzoff)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hashcode" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hashcode" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._year" ], [ "CALL_FUNCTION", "divmod(self._year, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._microsecond" ], [ "CALL_FUNCTION", "divmod(self._microsecond, 256)" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "us2" ], [ "CALL_FUNCTION", "divmod(us2, 256)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._fold" ], [ "LOAD_FAST", "protocol" ], [ "COMPARE_OP", "protocol > 3" ], [ "LOAD_GLOBAL", "bytes" ], [ "LOAD_FAST", "yhi" ], [ "LOAD_FAST", "ylo" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._second" ], [ "LOAD_FAST", "us1" ], [ "LOAD_FAST", "us2" ], [ "LOAD_FAST", "us3" ], [ "CALL_FUNCTION", "bytes([yhi, ylo, m, self._day,\n self._hour, self._minute, self._second,\n us1, us2, us3])" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "IS_OP", "self._tzinfo is None" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "basestate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "tzinfo" ], [ "IS_OP", "tzinfo is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_GLOBAL", "_tzinfo_class" ], [ "CALL_FUNCTION", "isinstance(tzinfo, _tzinfo_class)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"bad tzinfo state arg\")" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._day" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._hour" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._minute" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._second" ], [ "LOAD_FAST", "m" ], [ "COMPARE_OP", "m > 127" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "BINARY_SUBTRACT", "m - 128" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._fold" ], [ "LOAD_FAST", "m" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._month" ], [ "LOAD_FAST", "yhi" ], [ "BINARY_MULTIPLY", "yhi * 256" ], [ "LOAD_FAST", "ylo" ], [ "BINARY_ADD", "yhi * 256 + ylo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._year" ], [ "LOAD_FAST", "us1" ], [ "BINARY_LSHIFT", "us1 << 8" ], [ "LOAD_FAST", "us2" ], [ "BINARY_OR", "(us1 << 8) | us2" ], [ "BINARY_LSHIFT", "((us1 << 8) | us2) << 8" ], [ "LOAD_FAST", "us3" ], [ "BINARY_OR", "(((us1 << 8) | us2) << 8) | us3" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._microsecond" ], [ "LOAD_FAST", "tzinfo" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._tzinfo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._getstate" ], [ "LOAD_FAST", "protocol" ], [ "CALL_METHOD", "self._getstate(protocol)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.__reduce_ex__" ], [ "CALL_METHOD", "self.__reduce_ex__(2)" ], [ "LOAD_GLOBAL", "_ymd2ord" ], [ "LOAD_FAST", "year" ], [ "CALL_FUNCTION", "_ymd2ord(year, 1, 1)" ], [ "LOAD_FAST", "firstday" ], [ "BINARY_ADD", "firstday + 6" ], [ "BINARY_MODULO", "(firstday + 6) % 7" ], [ "LOAD_FAST", "firstday" ], [ "LOAD_FAST", "firstweekday" ], [ "BINARY_SUBTRACT", "firstday - firstweekday" ], [ "LOAD_FAST", "firstweekday" ], [ "LOAD_FAST", "THURSDAY" ], [ "COMPARE_OP", "firstweekday > THURSDAY" ], [ "LOAD_FAST", "week1monday" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "object()" ], [ "LOAD_NAME", "_Omitted" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=24, microseconds=-1)" ], [ "LOAD_NAME", "_maxoffset" ], [ "UNARY_NEGATIVE", "-_maxoffset" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "offset" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "isinstance(offset, timedelta)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"offset must be a timedelta\")" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._Omitted" ], [ "IS_OP", "name is cls._Omitted" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.utc" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "name" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "isinstance(name, str)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"name must be a string\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._minoffset" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._maxoffset" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"offset must be a timedelta \"\n \"strictly between -timedelta(hours=24) and \"\n \"timedelta(hours=24).\")" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._create" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "cls._create(offset, name)" ], [ "LOAD_GLOBAL", "tzinfo" ], [ "LOAD_METHOD", "tzinfo.__new__" ], [ "LOAD_FAST", "cls" ], [ "CALL_METHOD", "tzinfo.__new__(cls)" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._offset" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._name" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "other" ], [ "LOAD_GLOBAL", "timezone" ], [ "CALL_FUNCTION", "isinstance(other, timezone)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "other" ], [ "LOAD_ATTR", "other._offset" ], [ "COMPARE_OP", "self._offset == other._offset" ], [ "LOAD_GLOBAL", "NotImplemented" ], [ "LOAD_GLOBAL", "hash" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_FUNCTION", "hash(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.utc" ], [ "IS_OP", "self is self.utc" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_MODULO", "\"%s.%s(%r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__module__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.__class__" ], [ "LOAD_ATTR", "self.__class__.__qualname__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "BINARY_MODULO", "\"%s.%s(%r, %r)\" % (self.__class__.__module__,\n self.__class__.__qualname__,\n self._offset, self._name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.tzname" ], [ "CALL_METHOD", "self.tzname(None)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"utcoffset() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "IS_OP", "self._name is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._name_from_offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "CALL_METHOD", "self._name_from_offset(self._offset)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._name" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"tzname() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "IS_OP", "dt is None" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"dst() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "datetime" ], [ "CALL_FUNCTION", "isinstance(dt, datetime)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.tzinfo" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "dt.tzinfo is not self" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"fromutc: dt.tzinfo \"\n \"is not self\")" ], [ "LOAD_FAST", "dt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._offset" ], [ "BINARY_ADD", "dt + self._offset" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError(\"fromutc() argument must be a datetime instance\"\n \" or None\")" ], [ "LOAD_FAST", "delta" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION", "timedelta(0)" ], [ "COMPARE_OP", "delta < timedelta(0)" ], [ "LOAD_FAST", "delta" ], [ "UNARY_NEGATIVE", "-delta" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "delta" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(hours=1)" ], [ "CALL_FUNCTION", "divmod(delta, timedelta(hours=1))" ], [ "LOAD_GLOBAL", "divmod" ], [ "LOAD_FAST", "rest" ], [ "LOAD_GLOBAL", "timedelta" ], [ "CALL_FUNCTION_KW", "timedelta(minutes=1)" ], [ "CALL_FUNCTION", "divmod(rest, timedelta(minutes=1))" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.seconds" ], [ "LOAD_FAST", "rest" ], [ "LOAD_ATTR", "rest.microseconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "microseconds" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ], [ "LOAD_FAST", "seconds" ], [ "LOAD_FAST", "sign" ], [ "LOAD_FAST", "hours" ], [ "LOAD_FAST", "minutes" ] ]python-executing-2.2.0/tests/sample_results/datetime-pypy-2.7.json000066400000000000000000000000041474076367500252400ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-pypy-3.5.json000066400000000000000000000000041474076367500252370ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/datetime-pypy-3.6.json000066400000000000000000000000041474076367500252400ustar00rootroot00000000000000nullpython-executing-2.2.0/tests/sample_results/db-py-2.7.json000066400000000000000000000652341474076367500235000ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL_FUNCTION", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.expanduser" ], [ "CALL_FUNCTION", "os.path.expanduser('~')" ], [ "CALL_FUNCTION", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_ATTR", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "self.table_exists(KeyValue)" ], [ "UNARY_NOT", "not self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_ATTR", "cls.__name__.lower" ], [ "CALL_FUNCTION", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_FUNCTION", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION", "KeyValue(key=key, value=str(value))" ], [ "CALL_FUNCTION", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=32)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_FUNCTION", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.strftime" ], [ "CALL_FUNCTION", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "UNARY_NOT", "not self.traceback" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_FUNCTION", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_KW", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_ATTR", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_FUNCTION", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_FUNCTION", "session.query(self.Function.file)" ], [ "LOAD_ATTR", "session.query(self.Function.file).distinct" ], [ "CALL_FUNCTION", "session.query(self.Function.file).distinct()" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.sort" ], [ "CALL_FUNCTION", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_FUNCTION", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_ATTR", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_FUNCTION", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Session" ], [ "CALL_FUNCTION", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.rollback" ], [ "CALL_FUNCTION", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL_FUNCTION", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.10.json000066400000000000000000000637371474076367500235610ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION_KW", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION_KW", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=32)" ], [ "CALL_FUNCTION_KW", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION_KW", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOAD_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "CONTAINS_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.11.json000066400000000000000000002043101474076367500235420ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "from typing import List" ], [ "STORE_NAME", "from contextlib import contextmanager" ], [ "STORE_NAME", "from humanize import naturaltime" ], [ "STORE_NAME", "from markupsafe import Markup" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql import LONGTEXT" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql.base import RESERVED_WORDS" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL", "RESERVED_WORDS.add('function')" ], [ "STORE_NAME", "DB_VERSION" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "STORE_NAME", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "STORE_NAME", "retry_db" ], [ "STORE_NAME", " def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "STORE_NAME", " def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "STORE_NAME", " def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths" ], [ "STORE_NAME", " def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL", "contextmanager" ], [ "STORE_NAME", " @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()" ], [ "STORE_NAME", " def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.expanduser" ], [ "CALL", "os.path.expanduser('~')" ], [ "CALL", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "STORE_FAST", "kwargs" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_OP", "'sqlite:///' + db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "STORE_FAST", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL", "declarative_base(cls=Base)" ], [ "STORE_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "STORE_DEREF", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "LOAD_FAST", "self" ], [ "STORE_DEREF", "db_self" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "STORE_FAST", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "STORE_DEREF", "LongText" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "STORE_FAST", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "STORE_FAST", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "STORE_FAST", "kv" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL", "declared_attr" ], [ "STORE_NAME", " @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_METHOD", "cls.__name__.lower" ], [ "CALL", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(50)" ], [ "CALL", "Column(String(50), primary_key=True)" ], [ "STORE_NAME", "key" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "value" ], [ "STORE_NAME", " def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "STORE_NAME", " def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "__getitem__" ], [ "STORE_NAME", "__getattr__" ], [ "LOAD_NAME", "__setitem__" ], [ "STORE_NAME", "__setattr__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL", "session\n .query(KeyValue.value)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "CALL", " with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "session.query(KeyValue)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL", "str(value)" ], [ "CALL", "KeyValue(key=key, value=str(value))" ], [ "CALL", "session.add(KeyValue(key=key, value=str(value)))" ], [ "CALL", " with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=32)" ], [ "CALL", "Column(String(length=32), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL", "ForeignKey('function.id')" ], [ "CALL", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "STORE_NAME", "function_id" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL", "backref('calls', lazy='dynamic')" ], [ "CALL", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "STORE_NAME", "function" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "arguments" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "return_value" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "exception" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "traceback" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL", "Column(DateTime, index=True)" ], [ "STORE_NAME", "start_time" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def arguments_list(self):\n return json.loads(self.arguments)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.strftime" ], [ "CALL", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL", "naturaltime(dt)" ], [ "BUILD_STRING", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_OP", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL", "Sequence('function_id_seq')" ], [ "CALL", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "file" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "name" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "type" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "html_body" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL", "Column(Integer)" ], [ "STORE_NAME", "lineno" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=64)" ], [ "CALL", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "hash" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=64)" ], [ "CALL", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "body_hash" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL", "Index('idx_name', 'name', mysql_length=32)" ], [ "STORE_NAME", "__table_args__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL", "session.query(self.Function.file)" ], [ "LOAD_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL", "session.query(self.Function.file).distinct()" ], [ "CALL", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "STORE_FAST", "paths" ], [ "CALL", " with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.sort" ], [ "CALL", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "CONTAINS_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_FAST", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "STORE_FAST", "f" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "STORE_FAST", "model" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.Session" ], [ "CALL", "self.Session()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.rollback" ], [ "CALL", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ], [ "CALL", " with self.session_scope() as session:\n return func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.12.json000066400000000000000000002055761474076367500235620ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "from typing import List" ], [ "STORE_NAME", "from contextlib import contextmanager" ], [ "STORE_NAME", "from humanize import naturaltime" ], [ "STORE_NAME", "from markupsafe import Markup" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql import LONGTEXT" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql.base import RESERVED_WORDS" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL", "RESERVED_WORDS.add('function')" ], [ "STORE_NAME", "DB_VERSION" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "STORE_NAME", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "STORE_NAME", "retry_db" ], [ "STORE_NAME", " def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "STORE_NAME", " def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "STORE_NAME", " def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths" ], [ "STORE_NAME", " def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL", "contextmanager" ], [ "STORE_NAME", " @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()" ], [ "STORE_NAME", " def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.expanduser" ], [ "CALL", "os.path.expanduser('~')" ], [ "CALL", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "STORE_FAST", "kwargs" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "STORE_FAST", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL", "declarative_base(cls=Base)" ], [ "STORE_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "STORE_DEREF", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "LOAD_FAST", "self" ], [ "STORE_DEREF", "db_self" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "STORE_FAST", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "STORE_DEREF", "LongText" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "STORE_FAST", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "STORE_FAST", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "STORE_FAST", "kv" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_ATTR", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_OP", "'sqlite:///' + db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL", "declared_attr" ], [ "STORE_NAME", " @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_ATTR", "cls.__name__.lower" ], [ "CALL", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(50)" ], [ "CALL", "Column(String(50), primary_key=True)" ], [ "STORE_NAME", "key" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "value" ], [ "STORE_NAME", " def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "STORE_NAME", " def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "__getitem__" ], [ "STORE_NAME", "__getattr__" ], [ "LOAD_NAME", "__setitem__" ], [ "STORE_NAME", "__setattr__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "CALL", " with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL", "str(value)" ], [ "CALL", "KeyValue(key=key, value=str(value))" ], [ "CALL", "session.add(KeyValue(key=key, value=str(value)))" ], [ "CALL", " with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=32)" ], [ "CALL", "Column(String(length=32), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL", "ForeignKey('function.id')" ], [ "CALL", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "STORE_NAME", "function_id" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL", "backref('calls', lazy='dynamic')" ], [ "CALL", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "STORE_NAME", "function" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "arguments" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "return_value" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "exception" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "traceback" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL", "Column(DateTime, index=True)" ], [ "STORE_NAME", "start_time" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def arguments_list(self):\n return json.loads(self.arguments)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.strftime" ], [ "CALL", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL", "naturaltime(dt)" ], [ "BUILD_STRING", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_OP", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "BINARY_OP", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL", "Sequence('function_id_seq')" ], [ "CALL", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "file" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "name" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "type" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "html_body" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL", "Column(Integer)" ], [ "STORE_NAME", "lineno" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=64)" ], [ "CALL", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "hash" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(length=64)" ], [ "CALL", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "body_hash" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL", "Index('idx_name', 'name', mysql_length=32)" ], [ "STORE_NAME", "__table_args__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_ATTR", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL", "session.query(self.Function.file)" ], [ "LOAD_ATTR", "session.query(self.Function.file).distinct" ], [ "CALL", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST_AND_CLEAR", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "STORE_FAST", "f" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "STORE_FAST", "paths" ], [ "STORE_FAST", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "CALL", " with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "LOAD_FAST_CHECK", "paths" ], [ "LOAD_ATTR", "paths.sort" ], [ "CALL", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "CONTAINS_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "STORE_FAST", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "STORE_FAST", "model" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_ATTR", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Session" ], [ "CALL", "self.Session()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.rollback" ], [ "CALL", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ], [ "CALL", " with self.session_scope() as session:\n return func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.13.json000066400000000000000000002234311474076367500235510ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "STORE_NAME", "from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "from typing import List" ], [ "STORE_NAME", "from contextlib import contextmanager" ], [ "STORE_NAME", "from humanize import naturaltime" ], [ "STORE_NAME", "from markupsafe import Markup" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \\\n Index" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.ext.declarative import declarative_base, declared_attr" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.orm import backref, relationship, sessionmaker" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql import LONGTEXT" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from littleutils import select_attrs, retry" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell" ], [ "STORE_NAME", "from sqlalchemy.dialects.mysql.base import RESERVED_WORDS" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL", "RESERVED_WORDS.add('function')" ], [ "STORE_NAME", "DB_VERSION" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "STORE_NAME", "class Database(object):\n def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')\n\n def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)\n\n def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths\n\n def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)\n\n @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()\n\n def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "STORE_NAME", "retry_db" ], [ "STORE_NAME", " def __init__(self, db_uri=None, _skip_version_check=False):\n self.db_uri = db_uri = (\n db_uri\n or os.environ.get('BIRDSEYE_DB')\n or os.path.join(os.path.expanduser('~'),\n '.birdseye.db'))\n\n kwargs = dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )\n\n try:\n engine = create_engine(db_uri, **kwargs)\n except ArgumentError:\n db_uri = 'sqlite:///' + db_uri\n engine = create_engine(db_uri, **kwargs)\n\n self.engine = engine\n\n self.Session = sessionmaker(bind=engine)\n\n class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()\n\n Base = declarative_base(cls=Base) # type: ignore\n\n class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)\n\n db_self = self\n\n class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__\n\n LongText = LONGTEXT if engine.name == 'mysql' else Text\n\n class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)\n\n class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)\n\n self.Call = Call\n self.Function = Function\n self._KeyValue = KeyValue\n\n self.key_value_store = kv = KeyValueStore()\n\n if _skip_version_check:\n return\n\n if not self.table_exists(Function):\n Base.metadata.create_all(engine)\n kv.version = DB_VERSION\n elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION:\n sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "STORE_NAME", " def table_exists(self, table):\n return self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "STORE_NAME", " def all_file_paths(self):\n # type: () -> List[str]\n with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]\n paths.sort()\n if IPYTHON_FILE_PATH in paths:\n paths.remove(IPYTHON_FILE_PATH)\n paths.insert(0, IPYTHON_FILE_PATH)\n return paths" ], [ "STORE_NAME", " def clear(self):\n for model in [self.Call, self.Function, self._KeyValue]:\n if self.table_exists(model):\n model.__table__.drop(self.engine)" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL", "contextmanager" ], [ "STORE_NAME", " @contextmanager\n def session_scope(self):\n \"\"\"Provide a transactional scope around a series of operations.\"\"\"\n session = self.Session()\n try:\n yield session\n session.commit()\n except:\n session.rollback()\n raise\n finally:\n session.close()" ], [ "STORE_NAME", " def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "STORE_NAME", " def provide_session(self, func):\n @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)\n\n return retry_db(wrapper)" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.expanduser" ], [ "CALL", "os.path.expanduser('~')" ], [ "CALL", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "STORE_FAST", "kwargs" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "STORE_FAST", " class Base(object):\n @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_KW", "declarative_base(cls=Base)" ], [ "STORE_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "STORE_DEREF", " class KeyValue(Base):\n key = Column(String(50), primary_key=True)\n value = Column(Text)" ], [ "LOAD_FAST", "self" ], [ "STORE_DEREF", "db_self" ], [ "LOAD_FAST", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "LOAD_FAST", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "LOAD_GLOBAL", "object" ], [ "CALL", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "STORE_FAST", " class KeyValueStore(object):\n def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())\n\n def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))\n\n __getattr__ = __getitem__\n __setattr__ = __setitem__" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "STORE_DEREF", "LongText" ], [ "LOAD_FAST", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "STORE_FAST", " class Call(Base):\n id = Column(String(length=32), primary_key=True)\n function_id = Column(Integer, ForeignKey('function.id'), index=True)\n function = relationship('Function', backref=backref('calls', lazy='dynamic'))\n arguments = Column(Text)\n return_value = Column(Text)\n exception = Column(Text)\n traceback = Column(Text)\n data = Column(LongText)\n start_time = Column(DateTime, index=True)\n\n @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)\n\n @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))\n\n @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))\n\n @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True\n\n @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)\n\n @property\n def arguments_list(self):\n return json.loads(self.arguments)\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))\n\n basic_columns = (id, function_id, return_value,\n traceback, exception, start_time, arguments)" ], [ "LOAD_FAST", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "LOAD_FAST", "Base" ], [ "CALL", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "STORE_FAST", " class Function(Base):\n id = Column(Integer, Sequence('function_id_seq'), primary_key=True)\n file = Column(Text)\n name = Column(Text)\n type = Column(Text) # function or module\n html_body = Column(LongText)\n lineno = Column(Integer)\n data = Column(LongText)\n hash = Column(String(length=64), index=True)\n body_hash = Column(String(length=64), index=True)\n\n __table_args__ = (\n UniqueConstraint('hash',\n name='everything_unique'),\n Index('idx_file', 'file', mysql_length=256),\n Index('idx_name', 'name', mysql_length=32),\n )\n\n @property\n def parsed_data(self):\n return json.loads(self.data)\n\n @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')\n\n basic_columns = (file, name, lineno, hash, body_hash, type)" ], [ "STORE_ATTR", "self.Call" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "STORE_FAST", "kv" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_ATTR", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_OP", "'sqlite:///' + db_uri" ], [ "STORE_FAST", "db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "STORE_FAST", "engine" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL", "declared_attr" ], [ "STORE_NAME", " @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "STORE_NAME", " @declared_attr\n def __tablename__(cls):\n return cls.__name__.lower()" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_ATTR", "cls.__name__.lower" ], [ "CALL", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL", "String(50)" ], [ "CALL_KW", "Column(String(50), primary_key=True)" ], [ "STORE_NAME", "key" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "value" ], [ "STORE_NAME", "value" ], [ "LOAD_FAST", " def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "LOAD_FAST", " def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "STORE_NAME", " def __getitem__(self, item):\n with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "LOAD_FAST", " def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_FAST", " def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "STORE_NAME", " def __setitem__(self, key, value):\n with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "__getitem__" ], [ "STORE_NAME", "__getattr__" ], [ "LOAD_NAME", "__setitem__" ], [ "STORE_NAME", "__setattr__" ], [ "STORE_NAME", "__setattr__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "CALL", " with db_self.session_scope() as session:\n return (session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar())" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL", "db_self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL", "str(value)" ], [ "CALL_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL", "session.add(KeyValue(key=key, value=str(value)))" ], [ "CALL", " with db_self.session_scope() as session:\n session.query(KeyValue).filter_by(key=key).delete()\n session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_KW", "String(length=32)" ], [ "CALL_KW", "Column(String(length=32), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL", "ForeignKey('function.id')" ], [ "CALL_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "STORE_NAME", "function_id" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "STORE_NAME", "function" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "arguments" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "return_value" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "exception" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "traceback" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_KW", "Column(DateTime, index=True)" ], [ "STORE_NAME", "start_time" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def pretty_start_time(self):\n return self._pretty_time(self.start_time)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _pretty_time(dt):\n if not dt:\n return ''\n return Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def state_icon(self):\n return Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def success(self):\n if self.exception:\n assert self.traceback\n assert self.return_value == 'None'\n return False\n else:\n assert not self.traceback\n return True" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def result(self):\n if self.success:\n return str(self.return_value)\n else:\n return str(self.exception)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def arguments_list(self):\n return json.loads(self.arguments)" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(call):\n return dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "STORE_NAME", "basic_columns" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.strftime" ], [ "CALL", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL", "naturaltime(dt)" ], [ "BUILD_STRING", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_OP", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "BINARY_OP", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL", "Sequence('function_id_seq')" ], [ "CALL_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "STORE_NAME", "id" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "file" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "name" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL", "Column(Text)" ], [ "STORE_NAME", "type" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "html_body" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL", "Column(Integer)" ], [ "STORE_NAME", "lineno" ], [ "LOAD_NAME", "Column" ], [ "LOAD_FROM_DICT_OR_DEREF", "LongText" ], [ "CALL", "Column(LongText)" ], [ "STORE_NAME", "data" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_KW", "String(length=64)" ], [ "CALL_KW", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "hash" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_KW", "String(length=64)" ], [ "CALL_KW", "Column(String(length=64), index=True)" ], [ "STORE_NAME", "body_hash" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "STORE_NAME", "__table_args__" ], [ "LOAD_NAME", "property" ], [ "CALL", "property" ], [ "STORE_NAME", " @property\n def parsed_data(self):\n return json.loads(self.data)" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def basic_dict(func):\n return select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "basic_columns" ], [ "STORE_NAME", "basic_columns" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_ATTR", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL", "session.query(self.Function.file)" ], [ "LOAD_ATTR", "session.query(self.Function.file).distinct" ], [ "CALL", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST_AND_CLEAR", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "STORE_FAST", "f" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "STORE_FAST", "paths" ], [ "STORE_FAST", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "CALL", " with self.session_scope() as session:\n paths = [f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "LOAD_FAST_CHECK", "paths" ], [ "LOAD_ATTR", "paths.sort" ], [ "CALL", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "CONTAINS_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "STORE_FAST", "[f[0] for f in session.query(self.Function.file).distinct()\n if not is_ipython_cell(f[0])]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "STORE_FAST", "model" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_ATTR", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Session" ], [ "CALL", "self.Session()" ], [ "STORE_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.rollback" ], [ "CALL", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args, **kwargs):\n with self.session_scope() as session:\n return func(session, *args, **kwargs)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL", "self.session_scope()" ], [ "STORE_FAST", "session" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ], [ "CALL", " with self.session_scope() as session:\n return func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.5.json000066400000000000000000000625061474076367500234760ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL_FUNCTION", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.expanduser" ], [ "CALL_FUNCTION", "os.path.expanduser('~')" ], [ "CALL_FUNCTION", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_ATTR", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "self.table_exists(KeyValue)" ], [ "UNARY_NOT", "not self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_ATTR", "cls.__name__.lower" ], [ "CALL_FUNCTION", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_FUNCTION", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION", "KeyValue(key=key, value=str(value))" ], [ "CALL_FUNCTION", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=32)" ], [ "CALL_FUNCTION", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_FUNCTION", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.strftime" ], [ "CALL_FUNCTION", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "UNARY_NOT", "not self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_FUNCTION", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_KW", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_ATTR", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_FUNCTION", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_FUNCTION", "session.query(self.Function.file)" ], [ "LOAD_ATTR", "session.query(self.Function.file).distinct" ], [ "CALL_FUNCTION", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.sort" ], [ "CALL_FUNCTION", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_FUNCTION", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_ATTR", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_FUNCTION", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Session" ], [ "CALL_FUNCTION", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.rollback" ], [ "CALL_FUNCTION", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL_FUNCTION", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.6.json000066400000000000000000000626011474076367500234730ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_ATTR", "RESERVED_WORDS.add" ], [ "CALL_FUNCTION", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.expanduser" ], [ "CALL_FUNCTION", "os.path.expanduser('~')" ], [ "CALL_FUNCTION", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION_KW", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_FUNCTION", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_ATTR", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "self.table_exists(KeyValue)" ], [ "UNARY_NOT", "not self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.exit" ], [ "CALL_FUNCTION", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_ATTR", "cls.__name__.lower" ], [ "CALL_FUNCTION", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION_KW", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_FUNCTION", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_ATTR", "db_self.session_scope" ], [ "CALL_FUNCTION", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_FUNCTION", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_FUNCTION", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL_FUNCTION", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=32)" ], [ "CALL_FUNCTION_KW", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION_KW", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_FUNCTION", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_ATTR", "dt.strftime" ], [ "CALL_FUNCTION", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "UNARY_NOT", "not self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_FUNCTION", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_FUNCTION", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_ATTR", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_FUNCTION", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_FUNCTION", "session.query(self.Function.file)" ], [ "LOAD_ATTR", "session.query(self.Function.file).distinct" ], [ "CALL_FUNCTION", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.sort" ], [ "CALL_FUNCTION", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_ATTR", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_FUNCTION", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_FUNCTION", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_ATTR", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_FUNCTION", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Session" ], [ "CALL_FUNCTION", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.commit" ], [ "CALL_FUNCTION", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.rollback" ], [ "CALL_FUNCTION", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.close" ], [ "CALL_FUNCTION", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.session_scope" ], [ "CALL_FUNCTION", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.7.json000066400000000000000000000623661474076367500235040ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION_KW", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION_KW", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=32)" ], [ "CALL_FUNCTION_KW", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION_KW", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOAD_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.8.json000066400000000000000000000623661474076367500235050ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION_KW", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION_KW", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=32)" ], [ "CALL_FUNCTION_KW", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION_KW", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOAD_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-py-3.9.json000066400000000000000000000626451474076367500235060ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOAD_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION_KW", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION_KW", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION_KW", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOAD_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOAD_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION_KW", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOAD_ATTR", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION_KW", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOAD_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOAD_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOAD_ATTR", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION_KW", "session.query(KeyValue).filter_by(key=key)" ], [ "LOAD_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION_KW", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=32)" ], [ "CALL_FUNCTION_KW", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION_KW", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION_KW", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION_KW", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION_KW", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOAD_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_EX", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION_KW", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION_KW", "String(length=64)" ], [ "CALL_FUNCTION_KW", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION_KW", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION_KW", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOAD_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOAD_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "CONTAINS_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOAD_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-pypy-2.7.json000066400000000000000000000651331474076367500240470ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOOKUP_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOOKUP_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOOKUP_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=32)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOOKUP_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_KW", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_DEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOOKUP_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOOKUP_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOOKUP_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-pypy-3.5.json000066400000000000000000000624111474076367500240420ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOOKUP_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOOKUP_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOOKUP_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=32)" ], [ "CALL_FUNCTION", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOOKUP_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_KW", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOOKUP_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOOKUP_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOOKUP_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/db-pypy-3.6.json000066400000000000000000000624111474076367500240430ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "RESERVED_WORDS" ], [ "LOOKUP_METHOD", "RESERVED_WORDS.add" ], [ "CALL_METHOD", "RESERVED_WORDS.add('function')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "retry" ], [ "LOAD_NAME", "InterfaceError" ], [ "LOAD_NAME", "OperationalError" ], [ "LOAD_NAME", "InternalError" ], [ "LOAD_NAME", "ProgrammingError" ], [ "CALL_FUNCTION", "retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError))" ], [ "LOAD_NAME", "contextmanager" ], [ "CALL_FUNCTION", "contextmanager" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_DB')" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.expanduser" ], [ "CALL_METHOD", "os.path.expanduser('~')" ], [ "CALL_METHOD", "os.path.join(os.path.expanduser('~'),\n '.birdseye.db')" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.db_uri" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_FUNCTION", "dict(\n pool_recycle=280,\n echo=False, # for convenience when debugging\n )" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_GLOBAL", "ArgumentError" ], [ "LOAD_FAST", "db_uri" ], [ "BINARY_ADD", "'sqlite:///' + db_uri" ], [ "LOAD_GLOBAL", "create_engine" ], [ "LOAD_FAST", "db_uri" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_KW", "create_engine(db_uri, **kwargs)" ], [ "LOAD_FAST", "engine" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.engine" ], [ "LOAD_GLOBAL", "sessionmaker" ], [ "LOAD_FAST", "engine" ], [ "CALL_FUNCTION", "sessionmaker(bind=engine)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Session" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_GLOBAL", "declarative_base" ], [ "LOAD_FAST", "Base" ], [ "CALL_FUNCTION", "declarative_base(cls=Base)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "self" ], [ "LOAD_GLOBAL", "object" ], [ "LOAD_FAST", "engine" ], [ "LOAD_ATTR", "engine.name" ], [ "COMPARE_OP", "engine.name == 'mysql'" ], [ "LOAD_GLOBAL", "LONGTEXT" ], [ "LOAD_GLOBAL", "Text" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Base" ], [ "LOAD_FAST", "Call" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Call" ], [ "LOAD_FAST", "Function" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.Function" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "KeyValueStore" ], [ "CALL_FUNCTION", "KeyValueStore()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.key_value_store" ], [ "LOAD_FAST", "_skip_version_check" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "Function" ], [ "CALL_METHOD", "self.table_exists(Function)" ], [ "LOAD_FAST", "Base" ], [ "LOAD_ATTR", "Base.metadata" ], [ "LOOKUP_METHOD", "Base.metadata.create_all" ], [ "LOAD_FAST", "engine" ], [ "CALL_METHOD", "Base.metadata.create_all(engine)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "LOAD_FAST", "kv" ], [ "STORE_ATTR", "kv.version" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "self.table_exists(KeyValue)" ], [ "LOAD_GLOBAL", "int" ], [ "LOAD_FAST", "kv" ], [ "LOAD_ATTR", "kv.version" ], [ "CALL_FUNCTION", "int(kv.version)" ], [ "LOAD_GLOBAL", "DB_VERSION" ], [ "COMPARE_OP", "int(kv.version) < DB_VERSION" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.exit" ], [ "CALL_METHOD", "sys.exit('The birdseye database schema is out of date. '\n 'Run \"python -m birdseye.clear_db\" to delete the existing tables.')" ], [ "LOAD_NAME", "declared_attr" ], [ "CALL_FUNCTION", "declared_attr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__name__" ], [ "LOOKUP_METHOD", "cls.__name__.lower" ], [ "CALL_METHOD", "cls.__name__.lower()" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(50)" ], [ "CALL_FUNCTION", "Column(String(50), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "__getitem__" ], [ "LOAD_NAME", "__setitem__" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session\n .query" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_ATTR", "KeyValue.value" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)" ], [ "LOOKUP_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar" ], [ "CALL_METHOD", "session\n .query(KeyValue.value)\n .filter_by(key=item)\n .scalar()" ], [ "LOAD_DEREF", "db_self" ], [ "LOOKUP_METHOD", "db_self.session_scope" ], [ "CALL_METHOD", "db_self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_DEREF", "KeyValue" ], [ "CALL_METHOD", "session.query(KeyValue)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key)" ], [ "LOOKUP_METHOD", "session.query(KeyValue).filter_by(key=key).delete" ], [ "CALL_METHOD", "session.query(KeyValue).filter_by(key=key).delete()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.add" ], [ "LOAD_DEREF", "KeyValue" ], [ "LOAD_FAST", "key" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "str(value)" ], [ "CALL_FUNCTION", "KeyValue(key=key, value=str(value))" ], [ "CALL_METHOD", "session.add(KeyValue(key=key, value=str(value)))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=32)" ], [ "CALL_FUNCTION", "Column(String(length=32), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "ForeignKey" ], [ "CALL_FUNCTION", "ForeignKey('function.id')" ], [ "CALL_FUNCTION", "Column(Integer, ForeignKey('function.id'), index=True)" ], [ "LOAD_NAME", "relationship" ], [ "LOAD_NAME", "backref" ], [ "CALL_FUNCTION", "backref('calls', lazy='dynamic')" ], [ "CALL_FUNCTION", "relationship('Function', backref=backref('calls', lazy='dynamic'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "DateTime" ], [ "CALL_FUNCTION", "Column(DateTime, index=True)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "id" ], [ "LOAD_NAME", "function_id" ], [ "LOAD_NAME", "return_value" ], [ "LOAD_NAME", "traceback" ], [ "LOAD_NAME", "exception" ], [ "LOAD_NAME", "start_time" ], [ "LOAD_NAME", "arguments" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._pretty_time" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.start_time" ], [ "CALL_METHOD", "self._pretty_time(self.start_time)" ], [ "LOAD_FAST", "dt" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "dt" ], [ "LOOKUP_METHOD", "dt.strftime" ], [ "CALL_METHOD", "dt.strftime('%Y-%m-%d %H:%M:%S')" ], [ "LOAD_GLOBAL", "naturaltime" ], [ "LOAD_FAST", "dt" ], [ "CALL_FUNCTION", "naturaltime(dt)" ], [ "BINARY_MODULO", "'%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt))" ], [ "CALL_FUNCTION", "Markup('%s (%s)' % (\n dt.strftime('%Y-%m-%d %H:%M:%S'),\n naturaltime(dt)))" ], [ "LOAD_GLOBAL", "Markup" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "BINARY_MODULO", "'' % (\n ('ok', 'green') if self.success else\n ('remove', 'red'))" ], [ "CALL_FUNCTION", "Markup('' % (\n ('ok', 'green') if self.success else\n ('remove', 'red')))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "COMPARE_OP", "self.return_value == 'None'" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.traceback" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.success" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.return_value" ], [ "CALL_FUNCTION", "str(self.return_value)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.exception" ], [ "CALL_FUNCTION", "str(self.exception)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.arguments" ], [ "CALL_METHOD", "json.loads(self.arguments)" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.arguments_list" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time')" ], [ "CALL_FUNCTION_KW", "dict(arguments=call.arguments_list,\n **select_attrs(call, 'id function_id return_value traceback '\n 'exception start_time'))" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "LOAD_NAME", "Sequence" ], [ "CALL_FUNCTION", "Sequence('function_id_seq')" ], [ "CALL_FUNCTION", "Column(Integer, Sequence('function_id_seq'), primary_key=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Text" ], [ "CALL_FUNCTION", "Column(Text)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "Integer" ], [ "CALL_FUNCTION", "Column(Integer)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_CLASSDEREF", "LongText" ], [ "CALL_FUNCTION", "Column(LongText)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "Column" ], [ "LOAD_NAME", "String" ], [ "CALL_FUNCTION", "String(length=64)" ], [ "CALL_FUNCTION", "Column(String(length=64), index=True)" ], [ "LOAD_NAME", "UniqueConstraint" ], [ "CALL_FUNCTION", "UniqueConstraint('hash',\n name='everything_unique')" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_file', 'file', mysql_length=256)" ], [ "LOAD_NAME", "Index" ], [ "CALL_FUNCTION", "Index('idx_name', 'name', mysql_length=32)" ], [ "LOAD_NAME", "property" ], [ "CALL_FUNCTION", "property" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "file" ], [ "LOAD_NAME", "name" ], [ "LOAD_NAME", "lineno" ], [ "LOAD_NAME", "hash" ], [ "LOAD_NAME", "body_hash" ], [ "LOAD_NAME", "type" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.data" ], [ "CALL_METHOD", "json.loads(self.data)" ], [ "LOAD_GLOBAL", "select_attrs" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "select_attrs(func, 'file name lineno hash body_hash type')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_ATTR", "self.engine.dialect" ], [ "LOOKUP_METHOD", "self.engine.dialect.has_table" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "LOAD_FAST", "table" ], [ "LOAD_ATTR", "table.__name__" ], [ "CALL_METHOD", "self.engine.dialect.has_table(self.engine, table.__name__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_ATTR", "self.Function.file" ], [ "CALL_METHOD", "session.query(self.Function.file)" ], [ "LOOKUP_METHOD", "session.query(self.Function.file).distinct" ], [ "CALL_METHOD", "session.query(self.Function.file).distinct()" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.sort" ], [ "CALL_METHOD", "paths.sort()" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "paths" ], [ "COMPARE_OP", "IPYTHON_FILE_PATH in paths" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.remove" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.remove(IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOOKUP_METHOD", "paths.insert" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "CALL_METHOD", "paths.insert(0, IPYTHON_FILE_PATH)" ], [ "LOAD_FAST", "paths" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "CALL_FUNCTION", "is_ipython_cell(f[0])" ], [ "LOAD_FAST", "f" ], [ "BINARY_SUBSCR", "f[0]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.Function" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._KeyValue" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.table_exists" ], [ "LOAD_FAST", "model" ], [ "CALL_METHOD", "self.table_exists(model)" ], [ "LOAD_FAST", "model" ], [ "LOAD_ATTR", "model.__table__" ], [ "LOOKUP_METHOD", "model.__table__.drop" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.engine" ], [ "CALL_METHOD", "model.__table__.drop(self.engine)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.Session" ], [ "CALL_METHOD", "self.Session()" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.commit" ], [ "CALL_METHOD", "session.commit()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.rollback" ], [ "CALL_METHOD", "session.rollback()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.close" ], [ "CALL_METHOD", "session.close()" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_GLOBAL", "retry_db" ], [ "LOAD_FAST", "wrapper" ], [ "CALL_FUNCTION", "retry_db(wrapper)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.session_scope" ], [ "CALL_METHOD", "self.session_scope()" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "func(session, *args, **kwargs)" ] ]python-executing-2.2.0/tests/sample_results/executing-py-2.7.json000066400000000000000000001364031474076367500251030ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "text.splitlines" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_ATTR", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_FUNCTION", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_FUNCTION", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_ATTR", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_FUNCTION", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_ATTR", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_FUNCTION", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_ATTR", "super(QualnameVisitor, self).__init__" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_ATTR", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_ATTR", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_FUNCTION", "\".\".join(self.stack)" ], [ "CALL_FUNCTION", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "CALL_FUNCTION", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_FUNCTION", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_FUNCTION", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL_FUNCTION", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile_instructions" ], [ "CALL_FUNCTION", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_FUNCTION", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_ATTR", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_FUNCTION", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.10.json000066400000000000000000001351771474076367500251650ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION_KW", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "CONTAINS_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "CONTAINS_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "CONTAINS_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION_KW", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.11.json000066400000000000000000002740011474076367500251540ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nGet information about what a frame is currently doing. Typical usage:\n\n import executing\n\n node = executing.Source.executing(frame).node\n # node will be an AST node or None\n\"\"\"" ], [ "STORE_NAME", "import __future__" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import dis" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import io" ], [ "STORE_NAME", "import linecache" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from itertools import islice" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import cookie_re as encoding_pattern" ], [ "STORE_NAME", "from operator import attrgetter" ], [ "STORE_NAME", "from threading import RLock" ], [ "STORE_NAME", "__all__" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "STORE_NAME", "PY3" ], [ "LOAD_NAME", "PY3" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "STORE_NAME", "from tokenize import detect_encoding" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache(maxsize=None)" ], [ "STORE_NAME", "cache" ], [ "LOAD_NAME", "str" ], [ "STORE_NAME", "text_type" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import detect_encoding" ], [ "STORE_NAME", " def cache(func):\n d = {}\n\n @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result\n\n return wrapper" ], [ "LOAD_NAME", "unicode" ], [ "STORE_NAME", "text_type" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "STORE_NAME", "get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('Instruction', 'offset argval opname')" ], [ "STORE_NAME", "Instruction" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", " def get_instructions(co):\n code = co.co_code\n n = len(code)\n i = 0\n extended_arg = 0\n while i < n:\n offset = i\n c = code[i]\n op = ord(c)\n argval = None\n i = i + 1\n if op >= HAVE_ARGUMENT:\n oparg = ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg\n extended_arg = 0\n i = i + 2\n if op == EXTENDED_ARG:\n extended_arg = oparg * 65536\n\n if op in hasconst:\n argval = co.co_consts[oparg]\n yield Instruction(offset, argval, opname[op])" ], [ "LOAD_NAME", "Exception" ], [ "CALL", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "def only(it):\n if isinstance(it, Sized):\n if len(it) != 1:\n raise NotOneValueFound('Expected one value, found %s' % len(it))\n # noinspection PyTypeChecker\n return list(it)[0]\n\n lst = tuple(islice(it, 2))\n if len(lst) == 0:\n raise NotOneValueFound('Expected one value, found 0')\n if len(lst) > 1:\n raise NotOneValueFound('Expected one value, found several')\n return lst[0]" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "CALL", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "STORE_NAME", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "CALL", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_NAME", "future_flags" ], [ "STORE_NAME", "def compile_similar_to(source, matching_code):\n return compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", "sentinel" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "def get_setter(node):\n parent = node.parent\n for name, field in ast.iter_fields(parent):\n if field is node:\n return lambda new_node: setattr(parent, name, new_node)\n elif isinstance(field, list):\n for i, item in enumerate(field):\n if item is node:\n def setter(new_node):\n field[i] = new_node\n\n return setter" ], [ "LOAD_NAME", "RLock" ], [ "CALL", "RLock()" ], [ "STORE_NAME", "lock" ], [ "STORE_NAME", "def find_codes(root_code, matching):\n def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )\n\n code_options = []\n if matches(root_code):\n code_options.append(root_code)\n\n def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)\n\n finder(root_code)\n return code_options" ], [ "STORE_NAME", "def code_names(code):\n return frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", "@cache\ndef statement_containing_node(node):\n while not isinstance(node, ast.stmt):\n node = node.parent\n return node" ], [ "STORE_DEREF", "d" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "CONTAINS_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL", "len(code)" ], [ "STORE_FAST", "n" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "STORE_FAST", "op" ], [ "STORE_FAST", "argval" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL", "ord(code[i + 1])" ], [ "BINARY_OP", "ord(code[i + 1]) * 256" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "STORE_FAST", "oparg" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 2" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_OP", "oparg * 65536" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "CONTAINS_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "STORE_FAST", "argval" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL", "Instruction(offset, argval, opname[op])" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "BINARY_OP", "'Expected one value, found %s' % len(it)" ], [ "CALL", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL", "islice(it, 2)" ], [ "CALL", "tuple(islice(it, 2))" ], [ "STORE_FAST", "lst" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "STORE_NAME", "\"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source" ], [ "STORE_NAME", " def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.decode_source(text)" ], [ "STORE_FAST", "text" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "text.splitlines" ], [ "CALL", "text.splitlines(True)" ], [ "CALL", "enumerate(text.splitlines(True))" ], [ "CALL", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "CALL", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "ast.walk(self.tree)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL", "QualnameVisitor()" ], [ "STORE_FAST", "visitor" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL", "cls._class_local('__source_cache', {})" ], [ "STORE_FAST", "source_cache" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL", "linecache.getlines(filename, module_globals)" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "''.join(lines)" ], [ "CALL", "cls(filename, ''.join(lines))" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL", "cls._class_local('__executing_cache', {})" ], [ "STORE_FAST", "executing_cache" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "cls.for_frame(frame)" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL", "source.statements_at_line(frame.f_lineno)" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "new_stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL", "cls.__dict__.get(name, default)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "CALL", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "LOAD_FAST", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "from asttokens import ASTTokens" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL", "detect_encoding(io.BytesIO(source).readline)" ], [ "STORE_FAST", "encoding" ], [ "STORE_FAST", "_" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.decode(encoding)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "\"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts" ], [ "STORE_NAME", " def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)" ], [ "STORE_NAME", " def text(self):\n return self.source.asttokens().get_text(self.node)" ], [ "STORE_NAME", " def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", " def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}" ], [ "STORE_NAME", " def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)" ], [ "STORE_NAME", " def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')" ], [ "STORE_NAME", " def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(QualnameVisitor, self)" ], [ "LOAD_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL", "\".\".join(self.stack)" ], [ "CALL", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "CALL", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "children" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_fields(node)" ], [ "STORE_FAST", "field" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "STORE_FAST", "grandchild" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_FAST", "fname" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_OP", "future_flags & matching_code.co_flags" ], [ "CALL", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", " def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "STORE_NAME", " def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr" ], [ "STORE_NAME", " def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL", "ord(b)" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "STORE_FAST", "op_name" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "STORE_DEREF", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "STORE_DEREF", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "STORE_DEREF", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "STORE_DEREF", "typ" ], [ "LOAD_FAST", "op_name" ], [ "CONTAINS_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "STORE_DEREF", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "STORE_DEREF", "typ" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "CALL", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "exprs" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "self.matching_nodes(exprs)" ], [ "CALL", "list(self.matching_nodes(exprs))" ], [ "CALL", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "CALL", " with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "ast.walk(stmt)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "enumerate(exprs)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "expr" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "get_setter(expr)" ], [ "STORE_FAST", "setter" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL", "ast.Str(s=sentinel)" ], [ "CALL", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "STORE_FAST", "replacement" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile_instructions" ], [ "CALL", "self.compile_instructions()" ], [ "STORE_FAST", "instructions" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL", "enumerate(instructions)" ], [ "CALL", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "indices" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL", "only(indices)" ], [ "BINARY_OP", "only(indices) - 1" ], [ "STORE_FAST", "arg_index" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_OP", "arg_index -= 1" ], [ "STORE_FAST", "arg_index" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "instruction" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "STORE_FAST", "module_code" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "find_codes(module_code, self.frame.f_code)" ], [ "CALL", "only(find_codes(module_code, self.frame.f_code))" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "CALL", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_DEREF", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL", "ast.iter_fields(parent)" ], [ "STORE_DEREF", "name" ], [ "STORE_DEREF", "field" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL", "enumerate(field)" ], [ "STORE_DEREF", "i" ], [ "STORE_FAST", "item" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "item is node" ], [ "STORE_FAST", " def setter(new_node):\n field[i] = new_node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "STORE_DEREF", " def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_DEREF", "code_options" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "code_options.append(root_code)" ], [ "STORE_DEREF", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "CALL", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL", "frozenset()" ], [ "LOAD_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.12.json000066400000000000000000003015721474076367500251610ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nGet information about what a frame is currently doing. Typical usage:\n\n import executing\n\n node = executing.Source.executing(frame).node\n # node will be an AST node or None\n\"\"\"" ], [ "STORE_NAME", "import __future__" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import dis" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import io" ], [ "STORE_NAME", "import linecache" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from itertools import islice" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import cookie_re as encoding_pattern" ], [ "STORE_NAME", "from operator import attrgetter" ], [ "STORE_NAME", "from threading import RLock" ], [ "STORE_NAME", "__all__" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "STORE_NAME", "PY3" ], [ "LOAD_NAME", "PY3" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "STORE_NAME", "from tokenize import detect_encoding" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache(maxsize=None)" ], [ "STORE_NAME", "cache" ], [ "LOAD_NAME", "str" ], [ "STORE_NAME", "text_type" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import detect_encoding" ], [ "STORE_NAME", " def cache(func):\n d = {}\n\n @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result\n\n return wrapper" ], [ "LOAD_NAME", "unicode" ], [ "STORE_NAME", "text_type" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "STORE_NAME", "get_instructions" ], [ "LOAD_NAME", "Exception" ], [ "CALL", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "def only(it):\n if isinstance(it, Sized):\n if len(it) != 1:\n raise NotOneValueFound('Expected one value, found %s' % len(it))\n # noinspection PyTypeChecker\n return list(it)[0]\n\n lst = tuple(islice(it, 2))\n if len(lst) == 0:\n raise NotOneValueFound('Expected one value, found 0')\n if len(lst) > 1:\n raise NotOneValueFound('Expected one value, found several')\n return lst[0]" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "CALL", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "STORE_NAME", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "CALL", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_NAME", "future_flags" ], [ "STORE_NAME", "def compile_similar_to(source, matching_code):\n return compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", "sentinel" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "def get_setter(node):\n parent = node.parent\n for name, field in ast.iter_fields(parent):\n if field is node:\n return lambda new_node: setattr(parent, name, new_node)\n elif isinstance(field, list):\n for i, item in enumerate(field):\n if item is node:\n def setter(new_node):\n field[i] = new_node\n\n return setter" ], [ "LOAD_NAME", "RLock" ], [ "CALL", "RLock()" ], [ "STORE_NAME", "lock" ], [ "STORE_NAME", "def find_codes(root_code, matching):\n def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )\n\n code_options = []\n if matches(root_code):\n code_options.append(root_code)\n\n def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)\n\n finder(root_code)\n return code_options" ], [ "STORE_NAME", "def code_names(code):\n return frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", "@cache\ndef statement_containing_node(node):\n while not isinstance(node, ast.stmt):\n node = node.parent\n return node" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('Instruction', 'offset argval opname')" ], [ "STORE_NAME", "Instruction" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", " def get_instructions(co):\n code = co.co_code\n n = len(code)\n i = 0\n extended_arg = 0\n while i < n:\n offset = i\n c = code[i]\n op = ord(c)\n argval = None\n i = i + 1\n if op >= HAVE_ARGUMENT:\n oparg = ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg\n extended_arg = 0\n i = i + 2\n if op == EXTENDED_ARG:\n extended_arg = oparg * 65536\n\n if op in hasconst:\n argval = co.co_consts[oparg]\n yield Instruction(offset, argval, opname[op])" ], [ "STORE_DEREF", "d" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "CONTAINS_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "BINARY_OP", "'Expected one value, found %s' % len(it)" ], [ "CALL", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL", "islice(it, 2)" ], [ "CALL", "tuple(islice(it, 2))" ], [ "STORE_FAST", "lst" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "STORE_NAME", "\"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source" ], [ "STORE_NAME", " def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.decode_source(text)" ], [ "STORE_FAST", "text" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "text.splitlines" ], [ "CALL", "text.splitlines(True)" ], [ "CALL", "enumerate(text.splitlines(True))" ], [ "LOAD_FAST_AND_CLEAR", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "CALL", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "ast.walk(self.tree)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_ATTR", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL", "QualnameVisitor()" ], [ "STORE_FAST", "visitor" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL", "cls._class_local('__source_cache', {})" ], [ "STORE_FAST", "source_cache" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL", "linecache.getlines(filename, module_globals)" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "''.join(lines)" ], [ "CALL", "cls(filename, ''.join(lines))" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL", "cls._class_local('__executing_cache', {})" ], [ "STORE_FAST", "executing_cache" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "cls.for_frame(frame)" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "node" ], [ "STORE_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL", "source.statements_at_line(frame.f_lineno)" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "new_stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_ATTR", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL", "cls.__dict__.get(name, default)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_FAST_AND_CLEAR", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "from asttokens import ASTTokens" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL", "detect_encoding(io.BytesIO(source).readline)" ], [ "STORE_FAST", "encoding" ], [ "STORE_FAST", "_" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.decode(encoding)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_ATTR", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "\"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts" ], [ "STORE_NAME", " def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)" ], [ "STORE_NAME", " def text(self):\n return self.source.asttokens().get_text(self.node)" ], [ "STORE_NAME", " def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", " def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}" ], [ "STORE_NAME", " def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)" ], [ "STORE_NAME", " def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')" ], [ "STORE_NAME", " def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(QualnameVisitor, self).__init__" ], [ "CALL", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_ATTR", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_ATTR", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL", "\".\".join(self.stack)" ], [ "CALL", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "CALL", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "children" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_fields(node)" ], [ "STORE_FAST", "field" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "STORE_FAST", "grandchild" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_FAST", "fname" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_OP", "future_flags & matching_code.co_flags" ], [ "CALL", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", " def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "STORE_NAME", " def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr" ], [ "STORE_NAME", " def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL", "ord(b)" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "STORE_FAST", "op_name" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "CONTAINS_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "STORE_FAST", "typ" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST_AND_CLEAR", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "ast.walk(stmt)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "exprs" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "self.matching_nodes(exprs)" ], [ "CALL", "list(self.matching_nodes(exprs))" ], [ "CALL", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "CALL", " with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "enumerate(exprs)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "expr" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "get_setter(expr)" ], [ "STORE_FAST", "setter" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL", "ast.Str(s=sentinel)" ], [ "CALL", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "STORE_FAST", "replacement" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile_instructions" ], [ "CALL", "self.compile_instructions()" ], [ "STORE_FAST", "instructions" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL", "enumerate(instructions)" ], [ "LOAD_FAST_AND_CLEAR", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "instruction" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "STORE_FAST", "indices" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL", "only(indices)" ], [ "BINARY_OP", "only(indices) - 1" ], [ "STORE_FAST", "arg_index" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_OP", "arg_index -= 1" ], [ "STORE_FAST", "arg_index" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "STORE_FAST", "module_code" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "find_codes(module_code, self.frame.f_code)" ], [ "CALL", "only(find_codes(module_code, self.frame.f_code))" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "CALL", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_DEREF", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL", "ast.iter_fields(parent)" ], [ "STORE_DEREF", "name" ], [ "STORE_DEREF", "field" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL", "enumerate(field)" ], [ "STORE_DEREF", "i" ], [ "STORE_FAST", "item" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "item is node" ], [ "STORE_FAST", " def setter(new_node):\n field[i] = new_node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "STORE_DEREF", " def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_DEREF", "code_options" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "code_options.append(root_code)" ], [ "STORE_DEREF", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "CALL", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL", "frozenset()" ], [ "LOAD_ATTR", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL", "len(code)" ], [ "STORE_FAST", "n" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "STORE_FAST", "offset" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "STORE_FAST", "op" ], [ "STORE_FAST", "argval" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL", "ord(code[i + 1])" ], [ "BINARY_OP", "ord(code[i + 1]) * 256" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "STORE_FAST", "oparg" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 2" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_OP", "oparg * 65536" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "CONTAINS_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "STORE_FAST", "argval" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL", "Instruction(offset, argval, opname[op])" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.13.json000066400000000000000000003021661474076367500251620ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nGet information about what a frame is currently doing. Typical usage:\n\n import executing\n\n node = executing.Source.executing(frame).node\n # node will be an AST node or None\n\"\"\"" ], [ "STORE_NAME", "import __future__" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import dis" ], [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import io" ], [ "STORE_NAME", "import linecache" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from collections import defaultdict, namedtuple, Sized" ], [ "STORE_NAME", "from itertools import islice" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import cookie_re as encoding_pattern" ], [ "STORE_NAME", "from operator import attrgetter" ], [ "STORE_NAME", "from threading import RLock" ], [ "STORE_NAME", "__all__" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "STORE_NAME", "PY3" ], [ "LOAD_NAME", "PY3" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "STORE_NAME", "from tokenize import detect_encoding" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_KW", "lru_cache(maxsize=None)" ], [ "STORE_NAME", "cache" ], [ "LOAD_NAME", "str" ], [ "STORE_NAME", "text_type" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import detect_encoding" ], [ "STORE_NAME", " def cache(func):\n d = {}\n\n @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result\n\n return wrapper" ], [ "LOAD_NAME", "unicode" ], [ "STORE_NAME", "text_type" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "STORE_NAME", "get_instructions" ], [ "LOAD_NAME", "Exception" ], [ "CALL", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "class NotOneValueFound(Exception):\n pass" ], [ "STORE_NAME", "def only(it):\n if isinstance(it, Sized):\n if len(it) != 1:\n raise NotOneValueFound('Expected one value, found %s' % len(it))\n # noinspection PyTypeChecker\n return list(it)[0]\n\n lst = tuple(islice(it, 2))\n if len(lst) == 0:\n raise NotOneValueFound('Expected one value, found 0')\n if len(lst) > 1:\n raise NotOneValueFound('Expected one value, found several')\n return lst[0]" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "class Source(object):\n \"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"\n\n def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames\n\n @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})\n\n @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result\n\n @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)\n\n @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)\n\n @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result\n\n @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }\n\n @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )\n\n @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source\n\n def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", "class Executing(object):\n \"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"\n\n def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts\n\n def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)\n\n def text(self):\n return self.source.asttokens().get_text(self.node)\n\n def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "CALL", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "STORE_NAME", "class QualnameVisitor(ast.NodeVisitor):\n def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}\n\n def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)\n\n def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')\n\n def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "CALL", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_NAME", "future_flags" ], [ "STORE_NAME", "def compile_similar_to(source, matching_code):\n return compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", "sentinel" ], [ "LOAD_NAME", "object" ], [ "CALL", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "class NodeFinder(object):\n def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))\n\n def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr\n\n def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", "def get_setter(node):\n parent = node.parent\n for name, field in ast.iter_fields(parent):\n if field is node:\n return lambda new_node: setattr(parent, name, new_node)\n elif isinstance(field, list):\n for i, item in enumerate(field):\n if item is node:\n def setter(new_node):\n field[i] = new_node\n\n return setter" ], [ "LOAD_NAME", "RLock" ], [ "CALL", "RLock()" ], [ "STORE_NAME", "lock" ], [ "STORE_NAME", "def find_codes(root_code, matching):\n def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )\n\n code_options = []\n if matches(root_code):\n code_options.append(root_code)\n\n def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)\n\n finder(root_code)\n return code_options" ], [ "STORE_NAME", "def code_names(code):\n return frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", "@cache\ndef statement_containing_node(node):\n while not isinstance(node, ast.stmt):\n node = node.parent\n return node" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('Instruction', 'offset argval opname')" ], [ "STORE_NAME", "Instruction" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", "from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname" ], [ "STORE_NAME", " def get_instructions(co):\n code = co.co_code\n n = len(code)\n i = 0\n extended_arg = 0\n while i < n:\n offset = i\n c = code[i]\n op = ord(c)\n argval = None\n i = i + 1\n if op >= HAVE_ARGUMENT:\n oparg = ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg\n extended_arg = 0\n i = i + 2\n if op == EXTENDED_ARG:\n extended_arg = oparg * 65536\n\n if op in hasconst:\n argval = co.co_consts[oparg]\n yield Instruction(offset, argval, opname[op])" ], [ "STORE_DEREF", "d" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*args):\n if args in d:\n return d[args]\n result = d[args] = func(*args)\n return result" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "CONTAINS_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "STORE_NAME", "pass" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL", "len(it)" ], [ "BINARY_OP", "'Expected one value, found %s' % len(it)" ], [ "CALL", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL", "islice(it, 2)" ], [ "CALL", "tuple(islice(it, 2))" ], [ "STORE_FAST", "lst" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "STORE_NAME", "\"\"\"\n The source code of a single file and associated metadata.\n\n The main method of interest is the classmethod `executing(frame)`.\n\n If you want an instance of this class, don't construct it.\n Ideally use the classmethod `for_frame(frame)`.\n If you don't have a frame, use `for_filename(filename [, module_globals])`.\n These methods cache instances by filename, so at most one instance exists per filename.\n\n Attributes:\n - filename\n - text\n - tree: AST parsed from text, or None if text is not valid Python\n All nodes in the tree have an extra `parent` attribute\n\n Other methods of interest:\n - statements_at_line\n - asttokens\n - code_qualname\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, filename, text):\n \"\"\"\n Don't call this constructor, see the class docstring.\n \"\"\"\n\n self.filename = filename\n\n if not isinstance(text, text_type):\n text = self.decode_source(text)\n self.text = text\n\n if PY3:\n ast_text = text\n else:\n # In python 2 it's a syntax error to parse unicode\n # with an encoding declaration, so we remove it but\n # leave empty lines in its place to keep line numbers the same\n ast_text = ''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])\n\n self._nodes_by_line = defaultdict(list)\n self.tree = None\n self._qualnames = {}\n\n if text:\n try:\n self.tree = ast.parse(ast_text, filename=filename)\n except SyntaxError:\n pass\n else:\n for node in ast.walk(self.tree):\n for child in ast.iter_child_nodes(node):\n child.parent = node\n if hasattr(node, 'lineno'):\n self._nodes_by_line[node.lineno].append(node)\n\n visitor = QualnameVisitor()\n visitor.visit(self.tree)\n self._qualnames = visitor.qualnames" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_frame(cls, frame):\n \"\"\"\n Returns the `Source` object corresponding to the file the frame is executing in.\n \"\"\"\n return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def for_filename(cls, filename, module_globals=None):\n source_cache = cls._class_local('__source_cache', {})\n try:\n return source_cache[filename]\n except KeyError:\n pass\n\n lines = linecache.getlines(filename, module_globals)\n result = source_cache[filename] = cls(filename, ''.join(lines))\n return result" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def lazycache(cls, frame):\n if hasattr(linecache, 'lazycache'):\n linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def executing(cls, frame):\n \"\"\"\n Returns an `Executing` object representing the operation\n currently executing in the given frame.\n \"\"\"\n key = (frame.f_code, frame.f_lasti)\n executing_cache = cls._class_local('__executing_cache', {})\n\n try:\n args = executing_cache[key]\n except KeyError:\n source = cls.for_frame(frame)\n node = stmts = None\n if source.tree:\n stmts = source.statements_at_line(frame.f_lineno)\n try:\n node = NodeFinder(frame, stmts, source.tree).result\n except Exception:\n raise\n else:\n new_stmts = {statement_containing_node(node)}\n assert new_stmts <= stmts\n stmts = new_stmts\n\n args = source, node, stmts\n executing_cache[key] = args\n\n return Executing(frame, *args)" ], [ "LOAD_NAME", "classmethod" ], [ "CALL", "classmethod" ], [ "STORE_NAME", " @classmethod\n def _class_local(cls, name, default):\n \"\"\"\n Returns an attribute directly associated with this class\n (as opposed to subclasses), setting default if necessary\n \"\"\"\n # classes have a mappingproxy preventing us from using setdefault\n result = cls.__dict__.get(name, default)\n setattr(cls, name, result)\n return result" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def statements_at_line(self, lineno):\n \"\"\"\n Returns the statement nodes overlapping the given line.\n\n Returns at most one statement unless semicolons are present.\n\n If the `text` attribute is not valid python, meaning\n `tree` is None, returns an empty set.\n\n Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)`\n should return at least one statement.\n \"\"\"\n\n return {\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "LOAD_NAME", "cache" ], [ "CALL", "cache" ], [ "STORE_NAME", " @cache\n def asttokens(self):\n \"\"\"\n Returns an ASTTokens object for getting the source of specific AST nodes.\n\n See http://asttokens.readthedocs.io/en/latest/api-index.html\n \"\"\"\n from asttokens import ASTTokens # must be installed separately\n return ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def decode_source(source):\n if isinstance(source, bytes):\n encoding, _ = detect_encoding(io.BytesIO(source).readline)\n source = source.decode(encoding)\n return source" ], [ "STORE_NAME", " def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", " def code_qualname(self, code):\n \"\"\"\n Imitates the __qualname__ attribute of functions for code objects.\n Given:\n\n - A function `func`\n - A frame `frame` for an execution of `func`, meaning:\n `frame.f_code is func.__code__`\n\n `Source.for_frame(frame).code_qualname(frame.f_code)`\n will be equal to `func.__qualname__`*. Works for Python 2 as well,\n where of course no `__qualname__` attribute exists.\n\n Falls back to `code.co_name` if there is no appropriate qualname.\n\n Based on https://github.com/wbolster/qualname\n\n (* unless `func` is a lambda\n nested inside another lambda on the same line, in which case\n the outer lambda's qualname will be returned for the codes\n of both lambdas)\n \"\"\"\n assert code.co_filename == self.filename\n return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.decode_source(text)" ], [ "STORE_FAST", "text" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "text.splitlines" ], [ "CALL", "text.splitlines(True)" ], [ "CALL", "enumerate(text.splitlines(True))" ], [ "LOAD_FAST_AND_CLEAR", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "CALL", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "STORE_FAST", "ast_text" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "CALL_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "ast.walk(self.tree)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_ATTR", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL", "QualnameVisitor()" ], [ "STORE_FAST", "visitor" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "STORE_FAST", "[\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ]" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL", "cls._class_local('__source_cache', {})" ], [ "STORE_FAST", "source_cache" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "CALL", "linecache.getlines(filename, module_globals)" ], [ "STORE_FAST", "lines" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL", "''.join(lines)" ], [ "CALL", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "STORE_FAST", "key" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL", "cls._class_local('__executing_cache', {})" ], [ "STORE_FAST", "executing_cache" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "cls.for_frame(frame)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL", "source.statements_at_line(frame.f_lineno)" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "new_stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "STORE_FAST", "stmts" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "stmts" ], [ "STORE_FAST", "args" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_ATTR", "cls.__dict__.get" ], [ "CALL", "cls.__dict__.get(name, default)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "result" ], [ "CALL", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_FAST_AND_CLEAR", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL", "statement_containing_node(node)" ], [ "STORE_FAST", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "{\n statement_containing_node(node)\n for node in\n self._nodes_by_line[lineno]\n }" ], [ "STORE_FAST", "from asttokens import ASTTokens" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.decode(encoding)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_ATTR", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "STORE_NAME", "\"\"\"\n Information about the operation a frame is currently executing.\n\n Generally you will just want `node`, which is the AST node being executed,\n or None if it's unknown.\n Currently `node` can only be an `ast.Call` object, other operations\n will be supported in future.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self, frame, source, node, stmts):\n self.frame = frame\n self.source = source\n self.node = node\n self.statements = stmts" ], [ "STORE_NAME", " def code_qualname(self):\n return self.source.code_qualname(self.frame.f_code)" ], [ "STORE_NAME", " def text(self):\n return self.source.asttokens().get_text(self.node)" ], [ "STORE_NAME", " def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", " def text_range(self):\n return self.source.asttokens().get_text_range(self.node)" ], [ "STORE_ATTR", "self.frame" ], [ "STORE_ATTR", "self.source" ], [ "STORE_ATTR", "self.node" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL", "self.source.asttokens().get_text_range(self.node)" ], [ "STORE_NAME", " def __init__(self):\n super(QualnameVisitor, self).__init__()\n self.stack = []\n self.qualnames = {}" ], [ "STORE_NAME", " def visit_FunctionDef(self, node, name=None):\n name = name or node.name\n self.stack.append(name)\n self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))\n\n self.stack.append('')\n if isinstance(node, ast.Lambda):\n children = [node.body]\n else:\n children = node.body\n for child in children:\n self.visit(child)\n self.stack.pop()\n self.stack.pop()\n\n # Find lambdas in the function definition outside the body,\n # e.g. decorators or default arguments\n # Based on iter_child_nodes\n for field, child in ast.iter_fields(node):\n if field == 'body':\n continue\n if isinstance(child, ast.AST):\n self.visit(child)\n elif isinstance(child, list):\n for grandchild in child:\n if isinstance(grandchild, ast.AST):\n self.visit(grandchild)" ], [ "STORE_NAME", " def visit_Lambda(self, node):\n self.visit_FunctionDef(node, '')" ], [ "STORE_NAME", " def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "STORE_NAME", " def visit_ClassDef(self, node):\n self.stack.append(node.name)\n self.generic_visit(node)\n self.stack.pop()" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(QualnameVisitor, self).__init__" ], [ "CALL", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "STORE_FAST", "name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_ATTR", "self.qualnames.setdefault" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_ATTR", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL", "\".\".join(self.stack)" ], [ "CALL", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "CALL", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "children" ], [ "LOAD_FAST", "children" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "STORE_FAST", "grandchild" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL", "self.stack.pop()" ], [ "LOAD_FAST", "(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "STORE_FAST", "fname" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_OP", "future_flags & matching_code.co_flags" ], [ "CALL_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "STORE_NAME", " def __init__(self, frame, stmts, tree):\n self.frame = frame\n self.tree = tree\n\n b = frame.f_code.co_code[frame.f_lasti]\n if not PY3:\n b = ord(b)\n op_name = dis.opname[b]\n\n if op_name.startswith('CALL_'):\n typ = ast.Call\n elif op_name == 'BINARY_SUBSCR':\n typ = ast.Subscript\n elif op_name.startswith('BINARY_'):\n typ = ast.BinOp\n elif op_name.startswith('UNARY_'):\n typ = ast.UnaryOp\n elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'):\n typ = ast.Attribute\n elif op_name == 'COMPARE_OP':\n typ = ast.Compare\n else:\n raise RuntimeError(op_name)\n\n with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "STORE_NAME", " def matching_nodes(self, exprs):\n for i, expr in enumerate(exprs):\n setter = get_setter(expr)\n replacement = ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )\n ast.fix_missing_locations(replacement)\n setter(replacement)\n try:\n instructions = self.compile_instructions()\n except SyntaxError:\n continue\n finally:\n setter(expr)\n indices = [\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]\n if not indices:\n continue\n arg_index = only(indices) - 1\n while instructions[arg_index].opname == 'EXTENDED_ARG':\n arg_index -= 1\n\n if instructions[arg_index].offset == self.frame.f_lasti:\n yield expr" ], [ "STORE_NAME", " def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_NAME", " def compile_instructions(self):\n module_code = compile_similar_to(self.tree, self.frame.f_code)\n code = only(find_codes(module_code, self.frame.f_code))\n return list(get_instructions(code))" ], [ "STORE_ATTR", "self.frame" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL", "ord(b)" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "STORE_FAST", "op_name" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "CONTAINS_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "STORE_FAST", "typ" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "STORE_FAST", "typ" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST_AND_CLEAR", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_FAST_AND_CLEAR", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "ast.walk(stmt)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "exprs" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "self.matching_nodes(exprs)" ], [ "CALL", "list(self.matching_nodes(exprs))" ], [ "CALL", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "CALL", " with lock:\n exprs = {\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }\n\n self.result = only(list(self.matching_nodes(exprs)))" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "STORE_FAST", "{\n node\n for stmt in stmts\n for node in ast.walk(stmt)\n if isinstance(node, typ)\n if not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))\n }" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "get_setter(expr)" ], [ "STORE_FAST", "setter" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_KW", "ast.Str(s=sentinel)" ], [ "CALL_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "STORE_FAST", "replacement" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile_instructions" ], [ "CALL", "self.compile_instructions()" ], [ "STORE_FAST", "instructions" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL", "enumerate(instructions)" ], [ "LOAD_FAST_AND_CLEAR", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "STORE_FAST", "indices" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL", "only(indices)" ], [ "BINARY_OP", "only(indices) - 1" ], [ "STORE_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_OP", "arg_index -= 1" ], [ "STORE_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL", "setter(expr)" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "STORE_FAST", "[\n i\n for i, instruction in enumerate(instructions)\n if instruction.argval == sentinel\n ]" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "STORE_FAST", "module_code" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL", "find_codes(module_code, self.frame.f_code)" ], [ "CALL", "only(find_codes(module_code, self.frame.f_code))" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "CALL", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_DEREF", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL", "ast.iter_fields(parent)" ], [ "STORE_DEREF", "name" ], [ "STORE_DEREF", "field" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "field is node" ], [ "LOAD_FAST", "lambda new_node: setattr(parent, name, new_node)" ], [ "LOAD_FAST", "lambda new_node: setattr(parent, name, new_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL", "enumerate(field)" ], [ "STORE_DEREF", "i" ], [ "STORE_FAST", "item" ], [ "IS_OP", "item is node" ], [ "LOAD_FAST", " def setter(new_node):\n field[i] = new_node" ], [ "LOAD_FAST", " def setter(new_node):\n field[i] = new_node" ], [ "STORE_FAST", " def setter(new_node):\n field[i] = new_node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_FAST", " def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_DEREF", " def matches(c):\n return all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_DEREF", "code_options" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "code_options.append(root_code)" ], [ "LOAD_FAST", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "LOAD_FAST", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "LOAD_FAST", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "STORE_DEREF", " def finder(code):\n for const in code.co_consts:\n if not inspect.iscode(const):\n continue\n\n if matches(const):\n code_options.append(const)\n finder(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_FAST", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "CALL", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL", "frozenset()" ], [ "LOAD_ATTR", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL", "len(code)" ], [ "STORE_FAST", "n" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "extended_arg" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "STORE_FAST", "offset" ], [ "BINARY_SUBSCR", "code[i]" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "STORE_FAST", "op" ], [ "STORE_FAST", "argval" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL", "ord(code[i + 1])" ], [ "BINARY_OP", "ord(code[i + 1]) * 256" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_OP", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "STORE_FAST", "oparg" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 2" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_OP", "oparg * 65536" ], [ "STORE_FAST", "extended_arg" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "CONTAINS_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "STORE_FAST", "argval" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL", "Instruction(offset, argval, opname[op])" ], [ "COMPARE_OP", "i < n" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.5.json000066400000000000000000001331701474076367500251000ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "text.splitlines" ], [ "CALL_FUNCTION", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_FUNCTION", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_ATTR", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_FUNCTION", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_FUNCTION", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_ATTR", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_FUNCTION", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_ATTR", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_FUNCTION", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_ATTR", "super(QualnameVisitor, self).__init__" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_ATTR", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_ATTR", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_FUNCTION", "\".\".join(self.stack)" ], [ "CALL_FUNCTION", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "CALL_FUNCTION", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_FUNCTION", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_FUNCTION", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL_FUNCTION", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile_instructions" ], [ "CALL_FUNCTION", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_FUNCTION", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_ATTR", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_FUNCTION", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.6.json000066400000000000000000001332101474076367500250740ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION_KW", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_ATTR", "text.splitlines" ], [ "CALL_FUNCTION", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_FUNCTION", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_ATTR", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_FUNCTION", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_ATTR", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_FUNCTION", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_FUNCTION", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_ATTR", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_FUNCTION", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls._class_local" ], [ "CALL_FUNCTION", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_FUNCTION", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_ATTR", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_FUNCTION", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_ATTR", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_FUNCTION", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_ATTR", "self.source.asttokens" ], [ "CALL_FUNCTION", "self.source.asttokens()" ], [ "LOAD_ATTR", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_FUNCTION", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_ATTR", "super(QualnameVisitor, self).__init__" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_ATTR", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_ATTR", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_FUNCTION", "\".\".join(self.stack)" ], [ "CALL_FUNCTION", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "CALL_FUNCTION", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_FUNCTION", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_FUNCTION", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_FUNCTION", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_ATTR", "self.stack.pop" ], [ "CALL_FUNCTION", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_ATTR", "op_name.startswith" ], [ "CALL_FUNCTION", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Pow" ], [ "CALL_FUNCTION", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION_KW", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile_instructions" ], [ "CALL_FUNCTION", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_FUNCTION", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_ATTR", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_FUNCTION", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.7.json000066400000000000000000001330711474076367500251020ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION_KW", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION_KW", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.8.json000066400000000000000000001330711474076367500251030ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION_KW", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION_KW", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-py-3.9.json000066400000000000000000001335641474076367500251130ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION_KW", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "CONTAINS_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "CONTAINS_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOAD_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION_KW", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOAD_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOAD_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOAD_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOAD_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION_KW", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOAD_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOAD_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOAD_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOAD_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOAD_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION_KW", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOAD_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "CONTAINS_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_FUNCTION_KW", "ast.Str(s=sentinel)" ], [ "CALL_FUNCTION_KW", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOAD_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-pypy-2.7.json000066400000000000000000001364441474076367500254610ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "text.splitlines" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOOKUP_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOOKUP_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOOKUP_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOOKUP_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOOKUP_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOOKUP_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOOKUP_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOOKUP_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOOKUP_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_METHOD", "ast.Str(s=sentinel)" ], [ "CALL_METHOD", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOOKUP_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-pypy-3.5.json000066400000000000000000001332331474076367500254510ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOOKUP_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOOKUP_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOOKUP_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOOKUP_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOOKUP_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOOKUP_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOOKUP_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOOKUP_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOOKUP_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_METHOD", "ast.Str(s=sentinel)" ], [ "CALL_METHOD", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOOKUP_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/executing-pypy-3.6.json000066400000000000000000001332331474076367500254520ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[0]" ], [ "COMPARE_OP", "sys.version_info[0] == 3" ], [ "LOAD_NAME", "PY3" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache(maxsize=None)" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "dis" ], [ "LOAD_ATTR", "dis.get_instructions" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('Instruction', 'offset argval opname')" ], [ "LOAD_NAME", "Exception" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeVisitor" ], [ "LOAD_NAME", "sum" ], [ "LOAD_NAME", "__future__" ], [ "LOAD_ATTR", "__future__.all_feature_names" ], [ "CALL_FUNCTION", "sum(\n getattr(__future__, fname).compiler_flag\n for fname in __future__.all_feature_names\n)" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "RLock" ], [ "CALL_FUNCTION", "RLock()" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "args" ], [ "LOAD_DEREF", "d" ], [ "COMPARE_OP", "args in d" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "d[args]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "func(*args)" ], [ "LOAD_DEREF", "d" ], [ "LOAD_FAST", "args" ], [ "STORE_SUBSCR", "d[args]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_code" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "len(code)" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "i < n" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "HAVE_ARGUMENT" ], [ "COMPARE_OP", "op >= HAVE_ARGUMENT" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "code[i]" ], [ "CALL_FUNCTION", "ord(code[i])" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "code[i + 1]" ], [ "CALL_FUNCTION", "ord(code[i + 1])" ], [ "BINARY_MULTIPLY", "ord(code[i + 1]) * 256" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256" ], [ "LOAD_FAST", "extended_arg" ], [ "BINARY_ADD", "ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 2" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "EXTENDED_ARG" ], [ "COMPARE_OP", "op == EXTENDED_ARG" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_MULTIPLY", "oparg * 65536" ], [ "LOAD_FAST", "op" ], [ "LOAD_GLOBAL", "hasconst" ], [ "COMPARE_OP", "op in hasconst" ], [ "LOAD_FAST", "co" ], [ "LOAD_ATTR", "co.co_consts" ], [ "LOAD_FAST", "oparg" ], [ "BINARY_SUBSCR", "co.co_consts[oparg]" ], [ "LOAD_GLOBAL", "Instruction" ], [ "LOAD_FAST", "offset" ], [ "LOAD_FAST", "argval" ], [ "LOAD_GLOBAL", "opname" ], [ "LOAD_FAST", "op" ], [ "BINARY_SUBSCR", "opname[op]" ], [ "CALL_FUNCTION", "Instruction(offset, argval, opname[op])" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "it" ], [ "LOAD_GLOBAL", "Sized" ], [ "CALL_FUNCTION", "isinstance(it, Sized)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "COMPARE_OP", "len(it) != 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "len(it)" ], [ "BINARY_MODULO", "'Expected one value, found %s' % len(it)" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found %s' % len(it))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "list(it)" ], [ "BINARY_SUBSCR", "list(it)[0]" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_GLOBAL", "islice" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "islice(it, 2)" ], [ "CALL_FUNCTION", "tuple(islice(it, 2))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 0" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found 0')" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) > 1" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "NotOneValueFound('Expected one value, found several')" ], [ "LOAD_FAST", "lst" ], [ "BINARY_SUBSCR", "lst[0]" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "classmethod" ], [ "CALL_FUNCTION", "classmethod" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "cache" ], [ "CALL_FUNCTION", "cache" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "text_type" ], [ "CALL_FUNCTION", "isinstance(text, text_type)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.decode_source" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.decode_source(text)" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.text" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "text" ], [ "LOOKUP_METHOD", "text.splitlines" ], [ "CALL_METHOD", "text.splitlines(True)" ], [ "CALL_FUNCTION", "enumerate(text.splitlines(True))" ], [ "CALL_METHOD", "''.join([\n '\\n' if i < 2 and encoding_pattern.match(line)\n else line\n for i, line in enumerate(text.splitlines(True))\n ])" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "text" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "ast_text" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "ast.parse(ast_text, filename=filename)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "ast.walk(self.tree)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, 'lineno')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[node.lineno]" ], [ "LOOKUP_METHOD", "self._nodes_by_line[node.lineno].append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._nodes_by_line[node.lineno].append(node)" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "CALL_FUNCTION", "QualnameVisitor()" ], [ "LOAD_FAST", "visitor" ], [ "LOOKUP_METHOD", "visitor.visit" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "CALL_METHOD", "visitor.visit(self.tree)" ], [ "LOAD_FAST", "visitor" ], [ "LOAD_ATTR", "visitor.qualnames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._qualnames" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_GLOBAL", "encoding_pattern" ], [ "LOOKUP_METHOD", "encoding_pattern.match" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "encoding_pattern.match(line)" ], [ "LOAD_FAST", "line" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "cls.for_filename(frame.f_code.co_filename, frame.f_globals or {})" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__source_cache', {})" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "source_cache[filename]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.getlines" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "module_globals" ], [ "CALL_METHOD", "linecache.getlines(filename, module_globals)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "filename" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "lines" ], [ "CALL_METHOD", "''.join(lines)" ], [ "CALL_FUNCTION", "cls(filename, ''.join(lines))" ], [ "LOAD_FAST", "source_cache" ], [ "LOAD_FAST", "filename" ], [ "STORE_SUBSCR", "source_cache[filename]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "linecache" ], [ "CALL_FUNCTION", "hasattr(linecache, 'lazycache')" ], [ "LOAD_GLOBAL", "linecache" ], [ "LOOKUP_METHOD", "linecache.lazycache" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "CALL_METHOD", "linecache.lazycache(frame.f_code.co_filename, frame.f_globals)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls._class_local" ], [ "CALL_METHOD", "cls._class_local('__executing_cache', {})" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "KeyError" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "cls.for_frame(frame)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.statements_at_line" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "CALL_METHOD", "source.statements_at_line(frame.f_lineno)" ], [ "LOAD_GLOBAL", "NodeFinder" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "NodeFinder(frame, stmts, source.tree)" ], [ "LOAD_ATTR", "NodeFinder(frame, stmts, source.tree).result" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "stmts" ], [ "COMPARE_OP", "new_stmts <= stmts" ], [ "LOAD_FAST", "new_stmts" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "executing_cache" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "executing_cache[key]" ], [ "LOAD_GLOBAL", "Executing" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "Executing(frame, *args)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.__dict__" ], [ "LOOKUP_METHOD", "cls.__dict__.get" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "default" ], [ "CALL_METHOD", "cls.__dict__.get(name, default)" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_FAST", "cls" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "setattr(cls, name, result)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._nodes_by_line" ], [ "LOAD_FAST", "lineno" ], [ "BINARY_SUBSCR", "self._nodes_by_line[lineno]" ], [ "LOAD_GLOBAL", "statement_containing_node" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "statement_containing_node(node)" ], [ "LOAD_FAST", "ASTTokens" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "CALL_FUNCTION", "ASTTokens(\n self.text,\n tree=self.tree,\n filename=self.filename,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "bytes" ], [ "CALL_FUNCTION", "isinstance(source, bytes)" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_GLOBAL", "io" ], [ "LOOKUP_METHOD", "io.BytesIO" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "io.BytesIO(source)" ], [ "LOAD_ATTR", "io.BytesIO(source).readline" ], [ "CALL_FUNCTION", "detect_encoding(io.BytesIO(source).readline)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.decode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.decode(encoding)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.filename" ], [ "COMPARE_OP", "code.co_filename == self.filename" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._qualnames" ], [ "LOOKUP_METHOD", "self._qualnames.get" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_firstlineno" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "CALL_METHOD", "self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statements" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.code_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_METHOD", "self.source.code_qualname(self.frame.f_code)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text(self.node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOOKUP_METHOD", "self.source.asttokens" ], [ "CALL_METHOD", "self.source.asttokens()" ], [ "LOOKUP_METHOD", "self.source.asttokens().get_text_range" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "CALL_METHOD", "self.source.asttokens().get_text_range(self.node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "QualnameVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(QualnameVisitor, self)" ], [ "LOOKUP_METHOD", "super(QualnameVisitor, self).__init__" ], [ "CALL_METHOD", "super(QualnameVisitor, self).__init__()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.qualnames" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.stack.append(name)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.qualnames" ], [ "LOOKUP_METHOD", "self.qualnames.setdefault" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.lineno" ], [ "LOOKUP_METHOD", "\".\".join" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "CALL_METHOD", "\".\".join(self.stack)" ], [ "CALL_METHOD", "self.qualnames.setdefault((name, node.lineno), \".\".join(self.stack))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "CALL_METHOD", "self.stack.append('')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, ast.Lambda)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_FAST", "children" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_fields(node)" ], [ "LOAD_FAST", "field" ], [ "COMPARE_OP", "field == 'body'" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(child, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "child" ], [ "CALL_METHOD", "self.visit(child)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(child, list)" ], [ "LOAD_FAST", "child" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "grandchild" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "CALL_FUNCTION", "isinstance(grandchild, ast.AST)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit" ], [ "LOAD_FAST", "grandchild" ], [ "CALL_METHOD", "self.visit(grandchild)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_FunctionDef" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_FunctionDef(node, '')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.append" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.name" ], [ "CALL_METHOD", "self.stack.append(node.name)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOOKUP_METHOD", "self.stack.pop" ], [ "CALL_METHOD", "self.stack.pop()" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "__future__" ], [ "LOAD_FAST", "fname" ], [ "CALL_FUNCTION", "getattr(__future__, fname)" ], [ "LOAD_ATTR", "getattr(__future__, fname).compiler_flag" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_filename" ], [ "LOAD_GLOBAL", "future_flags" ], [ "LOAD_FAST", "matching_code" ], [ "LOAD_ATTR", "matching_code.co_flags" ], [ "BINARY_AND", "future_flags & matching_code.co_flags" ], [ "CALL_FUNCTION", "compile(\n source,\n matching_code.co_filename,\n 'exec',\n flags=future_flags & matching_code.co_flags,\n dont_inherit=True,\n )" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "tree" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tree" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_code" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lasti" ], [ "BINARY_SUBSCR", "frame.f_code.co_code[frame.f_lasti]" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "b" ], [ "CALL_FUNCTION", "ord(b)" ], [ "LOAD_GLOBAL", "dis" ], [ "LOAD_ATTR", "dis.opname" ], [ "LOAD_FAST", "b" ], [ "BINARY_SUBSCR", "dis.opname[b]" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('CALL_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'BINARY_SUBSCR'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('BINARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "LOAD_FAST", "op_name" ], [ "LOOKUP_METHOD", "op_name.startswith" ], [ "CALL_METHOD", "op_name.startswith('UNARY_')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD')" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "LOAD_FAST", "op_name" ], [ "COMPARE_OP", "op_name == 'COMPARE_OP'" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "op_name" ], [ "CALL_FUNCTION", "RuntimeError(op_name)" ], [ "LOAD_GLOBAL", "lock" ], [ "LOAD_FAST", "stmts" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.matching_nodes" ], [ "LOAD_FAST", "exprs" ], [ "CALL_METHOD", "self.matching_nodes(exprs)" ], [ "CALL_FUNCTION", "list(self.matching_nodes(exprs))" ], [ "CALL_FUNCTION", "only(list(self.matching_nodes(exprs)))" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.result" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "stmt" ], [ "CALL_METHOD", "ast.walk(stmt)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "exprs" ], [ "CALL_FUNCTION", "enumerate(exprs)" ], [ "LOAD_GLOBAL", "get_setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "get_setter(expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.BinOp" ], [ "LOAD_FAST", "expr" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Pow" ], [ "CALL_METHOD", "ast.Pow()" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Str" ], [ "LOAD_GLOBAL", "sentinel" ], [ "CALL_METHOD", "ast.Str(s=sentinel)" ], [ "CALL_METHOD", "ast.BinOp(\n left=expr,\n op=ast.Pow(),\n right=ast.Str(s=sentinel),\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "replacement" ], [ "CALL_METHOD", "ast.fix_missing_locations(replacement)" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "replacement" ], [ "CALL_FUNCTION", "setter(replacement)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile_instructions" ], [ "CALL_METHOD", "self.compile_instructions()" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "setter" ], [ "LOAD_FAST", "expr" ], [ "CALL_FUNCTION", "setter(expr)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "instructions" ], [ "CALL_FUNCTION", "enumerate(instructions)" ], [ "LOAD_FAST", "indices" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "indices" ], [ "CALL_FUNCTION", "only(indices)" ], [ "BINARY_SUBTRACT", "only(indices) - 1" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].opname" ], [ "COMPARE_OP", "instructions[arg_index].opname == 'EXTENDED_ARG'" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "arg_index" ], [ "BINARY_SUBSCR", "instructions[arg_index]" ], [ "LOAD_ATTR", "instructions[arg_index].offset" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lasti" ], [ "COMPARE_OP", "instructions[arg_index].offset == self.frame.f_lasti" ], [ "LOAD_FAST", "expr" ], [ "LOAD_FAST", "instruction" ], [ "LOAD_ATTR", "instruction.argval" ], [ "LOAD_GLOBAL", "sentinel" ], [ "COMPARE_OP", "instruction.argval == sentinel" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "compile_similar_to" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tree" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "compile_similar_to(self.tree, self.frame.f_code)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_GLOBAL", "find_codes" ], [ "LOAD_FAST", "module_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_code" ], [ "CALL_FUNCTION", "find_codes(module_code, self.frame.f_code)" ], [ "CALL_FUNCTION", "only(find_codes(module_code, self.frame.f_code))" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "CALL_FUNCTION", "list(get_instructions(code))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_fields" ], [ "LOAD_DEREF", "parent" ], [ "CALL_METHOD", "ast.iter_fields(parent)" ], [ "LOAD_DEREF", "field" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "field is node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "field" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(field, list)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_DEREF", "field" ], [ "CALL_FUNCTION", "enumerate(field)" ], [ "LOAD_FAST", "item" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "item is node" ], [ "LOAD_FAST", "setter" ], [ "LOAD_GLOBAL", "setattr" ], [ "LOAD_DEREF", "parent" ], [ "LOAD_DEREF", "name" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "setattr(parent, name, new_node)" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_DEREF", "field" ], [ "LOAD_DEREF", "i" ], [ "STORE_SUBSCR", "field[i]" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "matches(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "root_code" ], [ "CALL_METHOD", "code_options.append(root_code)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "root_code" ], [ "CALL_FUNCTION", "finder(root_code)" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_GLOBAL", "all" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_firstlineno')" ], [ "LOAD_GLOBAL", "attrgetter" ], [ "CALL_FUNCTION", "attrgetter('co_name')" ], [ "LOAD_GLOBAL", "code_names" ], [ "CALL_FUNCTION", "all(\n f(c) == f(matching)\n for f in [\n attrgetter('co_firstlineno'),\n attrgetter('co_name'),\n code_names,\n ]\n )" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "c" ], [ "CALL_FUNCTION", "f(c)" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "matching" ], [ "CALL_FUNCTION", "f(matching)" ], [ "COMPARE_OP", "f(c) == f(matching)" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_DEREF", "matches" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "matches(const)" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "finder" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "finder(const)" ], [ "LOAD_GLOBAL", "frozenset" ], [ "CALL_FUNCTION", "frozenset()" ], [ "LOOKUP_METHOD", "frozenset().union" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_names" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "CALL_METHOD", "frozenset().union(\n code.co_names,\n code.co_varnames,\n code.co_freevars,\n code.co_cellvars,\n )" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "node" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-2.7.json000066400000000000000000000244421474076367500254410ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "UNARY_NOT", "not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source))" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "UNARY_NOT", "not source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.10.json000066400000000000000000000231421474076367500255100ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "CONTAINS_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION_KW", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "IS_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "IS_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "CONTAINS_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.11.json000066400000000000000000000502521474076367500255130ustar00rootroot00000000000000[ [ "STORE_NAME", "import logging" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from importlib.util import spec_from_loader" ], [ "STORE_NAME", "import ast" ], [ "CALL", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "def should_trace(source):\n trace_stmt = None\n deep = False\n for stmt in ast.parse(source).body:\n if isinstance(stmt, ast.Import):\n for alias in stmt.names:\n if alias.name.startswith('birdseye.trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n\n if isinstance(stmt, ast.ImportFrom) and stmt.module == 'birdseye':\n for alias in stmt.names:\n if alias.name.startswith('trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n return deep, trace_stmt" ], [ "STORE_NAME", " def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep" ], [ "STORE_NAME", " def create_module(self, spec):\n pass" ], [ "STORE_NAME", " def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "STORE_NAME", " def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)" ], [ "STORE_NAME", " def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "STORE_FAST", "from birdseye.bird import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_METHOD", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "\"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"" ], [ "STORE_NAME", " def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec" ], [ "STORE_NAME", " def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "STORE_FAST", "finder" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "CONTAINS_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_METHOD", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL", "finder.find_spec(fullname, path, target=target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL", "spec_from_loader(fullname, finder)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL", "self._find_plain_spec(fullname, path, target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "spec.loader.get_source(fullname)" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "CONTAINS_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL", "should_trace(source)" ], [ "STORE_FAST", "deep" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL", "BirdsEyeLoader(spec, source, deep)" ], [ "STORE_FAST", "loader" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL", "spec_from_loader(fullname, loader)" ], [ "STORE_FAST", "trace_stmt" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.12.json000066400000000000000000000502261474076367500255150ustar00rootroot00000000000000[ [ "STORE_NAME", "import logging" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from importlib.util import spec_from_loader" ], [ "STORE_NAME", "import ast" ], [ "CALL", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "def should_trace(source):\n trace_stmt = None\n deep = False\n for stmt in ast.parse(source).body:\n if isinstance(stmt, ast.Import):\n for alias in stmt.names:\n if alias.name.startswith('birdseye.trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n\n if isinstance(stmt, ast.ImportFrom) and stmt.module == 'birdseye':\n for alias in stmt.names:\n if alias.name.startswith('trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n return deep, trace_stmt" ], [ "STORE_NAME", " def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep" ], [ "STORE_NAME", " def create_module(self, spec):\n pass" ], [ "STORE_NAME", " def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "STORE_NAME", " def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)" ], [ "STORE_NAME", " def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "STORE_FAST", "from birdseye.bird import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "\"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"" ], [ "STORE_NAME", " def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec" ], [ "STORE_NAME", " def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "STORE_FAST", "finder" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "CONTAINS_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL", "finder.find_spec(fullname, path, target=target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL", "spec_from_loader(fullname, finder)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL", "self._find_plain_spec(fullname, path, target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "spec.loader.get_source(fullname)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "CONTAINS_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL", "should_trace(source)" ], [ "STORE_FAST", "deep" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL", "BirdsEyeLoader(spec, source, deep)" ], [ "STORE_FAST", "loader" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.exception('Loader for %s raised an error', fullname)" ], [ "STORE_FAST", "trace_stmt" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.13.json000066400000000000000000000506361474076367500255230ustar00rootroot00000000000000[ [ "STORE_NAME", "import logging" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from importlib.util import spec_from_loader" ], [ "STORE_NAME", "import ast" ], [ "CALL", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "class BirdsEyeLoader:\n\n def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep\n\n def create_module(self, spec):\n pass\n\n def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )\n\n def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)\n\n def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "LOAD_NAME", "object" ], [ "CALL", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "class BirdsEyeFinder(object):\n \"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"\n\n def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec\n\n def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", "def should_trace(source):\n trace_stmt = None\n deep = False\n for stmt in ast.parse(source).body:\n if isinstance(stmt, ast.Import):\n for alias in stmt.names:\n if alias.name.startswith('birdseye.trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n\n if isinstance(stmt, ast.ImportFrom) and stmt.module == 'birdseye':\n for alias in stmt.names:\n if alias.name.startswith('trace_module'):\n trace_stmt = stmt\n if alias.name.endswith('deep'):\n deep = True\n return deep, trace_stmt" ], [ "STORE_NAME", " def __init__(self, spec, source, deep):\n self._spec = spec\n self.source = source\n self.deep = deep" ], [ "STORE_NAME", " def create_module(self, spec):\n pass" ], [ "STORE_NAME", " def exec_module(self, module):\n from birdseye.bird import eye\n eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "STORE_NAME", " def get_filename(self, fullname):\n return self._spec.loader.get_filename(fullname)" ], [ "STORE_NAME", " def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", " def is_package(self, fullname):\n return self._spec.loader.is_package(fullname)" ], [ "STORE_ATTR", "self._spec" ], [ "STORE_ATTR", "self.source" ], [ "STORE_ATTR", "self.deep" ], [ "STORE_FAST", "from birdseye.bird import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "self._spec.loader.is_package(fullname)" ], [ "STORE_NAME", "\"\"\"Loads a module and looks for tracing inside, only providing a loader\n if it finds some.\n \"\"\"" ], [ "STORE_NAME", " def _find_plain_spec(self, fullname, path, target):\n \"\"\"Try to find the original module using all the\n remaining meta_path finders.\"\"\"\n spec = None\n for finder in sys.meta_path:\n # when testing with pytest, it installs a finder that for\n # some yet unknown reasons makes birdseye\n # fail. For now it will just avoid using it and pass to\n # the next one\n if finder is self or 'pytest' in finder.__module__:\n continue\n if hasattr(finder, 'find_spec'):\n spec = finder.find_spec(fullname, path, target=target)\n elif hasattr(finder, 'load_module'):\n spec = spec_from_loader(fullname, finder)\n\n if spec is not None and spec.origin != 'builtin':\n return spec" ], [ "STORE_NAME", " def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_NAME", " def find_spec(self, fullname, path, target=None):\n spec = self._find_plain_spec(fullname, path, target)\n if spec is None or not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source)): # noqa: E128\n if fullname != 'org':\n # stdlib pickle.py at line 94 contains a ``from\n # org.python.core for Jython which is always failing,\n # of course\n logging.debug('Failed finding spec for %s', fullname)\n return\n\n try:\n source = spec.loader.get_source(fullname)\n except ImportError:\n logging.debug('Loader for %s was unable to find the sources',\n fullname)\n return\n except Exception:\n logging.exception('Loader for %s raised an error', fullname)\n return\n\n if not source or 'birdseye' not in source:\n return\n\n deep, trace_stmt = should_trace(source)\n\n if not trace_stmt:\n return\n\n loader = BirdsEyeLoader(spec, source, deep)\n return spec_from_loader(fullname, loader)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "STORE_FAST", "finder" ], [ "IS_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "CONTAINS_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "target" ], [ "CALL_KW", "finder.find_spec(fullname, path, target=target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "CALL", "spec_from_loader(fullname, finder)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._find_plain_spec" ], [ "LOAD_FAST", "target" ], [ "CALL", "self._find_plain_spec(fullname, path, target)" ], [ "STORE_FAST", "spec" ], [ "LOAD_FAST", "spec" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "spec.loader.get_source(fullname)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "CONTAINS_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "deep" ], [ "CALL", "BirdsEyeLoader(spec, source, deep)" ], [ "STORE_FAST", "loader" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "CALL", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL", "logging.exception('Loader for %s raised an error', fullname)" ], [ "STORE_FAST", "trace_stmt" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "STORE_FAST", "alias" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "STORE_FAST", "trace_stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL", "alias.name.endswith('deep')" ], [ "STORE_FAST", "deep" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.5.json000066400000000000000000000234731474076367500254430ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "UNARY_NOT", "not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source))" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "UNARY_NOT", "not source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.6.json000066400000000000000000000235011474076367500254340ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_ATTR", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION_KW", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "UNARY_NOT", "not (hasattr(spec.loader, 'get_source') and\n callable(spec.loader.get_source))" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_ATTR", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_FUNCTION", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "UNARY_NOT", "not source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.startswith" ], [ "CALL_FUNCTION", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_ATTR", "alias.name.endswith" ], [ "CALL_FUNCTION", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.7.json000066400000000000000000000231571474076367500254440ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION_KW", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.8.json000066400000000000000000000231571474076367500254450ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION_KW", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-py-3.9.json000066400000000000000000000231421474076367500254400ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOAD_ATTR", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_FUNCTION_KW", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOAD_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "IS_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "CONTAINS_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_FUNCTION_KW", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "IS_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "IS_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOAD_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "CONTAINS_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOAD_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-pypy-2.7.json000066400000000000000000000241501474076367500260060ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOOKUP_METHOD", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_METHOD", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOOKUP_METHOD", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOOKUP_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-pypy-3.5.json000066400000000000000000000232051474076367500260050ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOOKUP_METHOD", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_METHOD", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOOKUP_METHOD", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOOKUP_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/import_hook-pypy-3.6.json000066400000000000000000000232051474076367500260060ustar00rootroot00000000000000[ [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self._spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.deep" ], [ "LOAD_FAST", "eye" ], [ "LOOKUP_METHOD", "eye.exec_string" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.origin" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "module" ], [ "LOAD_ATTR", "module.__dict__" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.deep" ], [ "CALL_METHOD", "eye.exec_string(\n source=self.source,\n filename=self._spec.origin,\n globs=module.__dict__,\n locs=module.__dict__,\n deep=self.deep,\n )" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.get_filename" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.get_filename(fullname)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._spec" ], [ "LOAD_ATTR", "self._spec.loader" ], [ "LOOKUP_METHOD", "self._spec.loader.is_package" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "self._spec.loader.is_package(fullname)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.meta_path" ], [ "LOAD_FAST", "finder" ], [ "LOAD_FAST", "self" ], [ "COMPARE_OP", "finder is self" ], [ "LOAD_FAST", "finder" ], [ "LOAD_ATTR", "finder.__module__" ], [ "COMPARE_OP", "'pytest' in finder.__module__" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'find_spec')" ], [ "LOAD_FAST", "finder" ], [ "LOOKUP_METHOD", "finder.find_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "finder.find_spec(fullname, path, target=target)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "hasattr(finder, 'load_module')" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "finder" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, finder)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is not None" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.origin" ], [ "COMPARE_OP", "spec.origin != 'builtin'" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._find_plain_spec" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "target" ], [ "CALL_METHOD", "self._find_plain_spec(fullname, path, target)" ], [ "LOAD_FAST", "spec" ], [ "COMPARE_OP", "spec is None" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "CALL_FUNCTION", "hasattr(spec.loader, 'get_source')" ], [ "LOAD_GLOBAL", "callable" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOAD_ATTR", "spec.loader.get_source" ], [ "CALL_FUNCTION", "callable(spec.loader.get_source)" ], [ "LOAD_FAST", "fullname" ], [ "COMPARE_OP", "fullname != 'org'" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Failed finding spec for %s', fullname)" ], [ "LOAD_FAST", "spec" ], [ "LOAD_ATTR", "spec.loader" ], [ "LOOKUP_METHOD", "spec.loader.get_source" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "spec.loader.get_source(fullname)" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.debug" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.debug('Loader for %s was unable to find the sources',\n fullname)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_GLOBAL", "logging" ], [ "LOOKUP_METHOD", "logging.exception" ], [ "LOAD_FAST", "fullname" ], [ "CALL_METHOD", "logging.exception('Loader for %s raised an error', fullname)" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "source" ], [ "COMPARE_OP", "'birdseye' not in source" ], [ "LOAD_GLOBAL", "should_trace" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "should_trace(source)" ], [ "LOAD_FAST", "trace_stmt" ], [ "LOAD_GLOBAL", "BirdsEyeLoader" ], [ "LOAD_FAST", "spec" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "deep" ], [ "CALL_FUNCTION", "BirdsEyeLoader(spec, source, deep)" ], [ "LOAD_GLOBAL", "spec_from_loader" ], [ "LOAD_FAST", "fullname" ], [ "LOAD_FAST", "loader" ], [ "CALL_FUNCTION", "spec_from_loader(fullname, loader)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.parse" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "ast.parse(source)" ], [ "LOAD_ATTR", "ast.parse(source).body" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Import" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.Import)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('birdseye.trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ImportFrom" ], [ "CALL_FUNCTION", "isinstance(stmt, ast.ImportFrom)" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.module" ], [ "COMPARE_OP", "stmt.module == 'birdseye'" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_ATTR", "stmt.names" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.startswith" ], [ "CALL_METHOD", "alias.name.startswith('trace_module')" ], [ "LOAD_FAST", "stmt" ], [ "LOAD_FAST", "alias" ], [ "LOAD_ATTR", "alias.name" ], [ "LOOKUP_METHOD", "alias.name.endswith" ], [ "CALL_METHOD", "alias.name.endswith('deep')" ], [ "LOAD_FAST", "deep" ], [ "LOAD_FAST", "trace_stmt" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-2.7.json000066400000000000000000000261411474076367500245770ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_ATTR", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_FUNCTION", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_ATTR", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_FUNCTION", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_ATTR", "templates_env.get_template" ], [ "CALL_FUNCTION", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_ATTR", "self.server_url.rstrip" ], [ "CALL_FUNCTION", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.10.json000066400000000000000000000247541474076367500246620ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "IS_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.11.json000066400000000000000000000511121474076367500246470ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import socket" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from werkzeug.local import LocalProxy" ], [ "STORE_NAME", "from werkzeug.serving import ThreadingMixIn" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "STORE_NAME", "fake_stream" ], [ "STORE_NAME", "thread_proxies" ], [ "STORE_NAME", "def stream_proxy(original):\n def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)\n\n return LocalProxy(p)" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "STORE_NAME", "def run_server(port, bind_host, show_server_output):\n if not show_server_output:\n thread_proxies[current_thread().ident] = fake_stream()\n try:\n server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )\n except socket.error:\n pass" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL", "select_autoescape(['html', 'xml'])" ], [ "CALL", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "STORE_NAME", "templates_env" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "CALL", "magics_class" ], [ "STORE_NAME", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "STORE_FAST", " def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_METHOD", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "STORE_NAME", "server_url" ], [ "LOAD_NAME", "Int" ], [ "CALL", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "STORE_NAME", "port" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "STORE_NAME", "bind_host" ], [ "LOAD_NAME", "Bool" ], [ "CALL", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "STORE_NAME", "show_server_output" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "STORE_NAME", "db_url" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL", "cell_magic" ], [ "STORE_NAME", " @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "STORE_FAST", " def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL", "eye.exec_ipython_cell(cell, callback)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_METHOD", "templates_env.get_template" ], [ "CALL", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_METHOD", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_METHOD", "self.server_url.rstrip" ], [ "CALL", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "STORE_FAST", "html" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.12.json000066400000000000000000000510761474076367500246610ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import socket" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from werkzeug.local import LocalProxy" ], [ "STORE_NAME", "from werkzeug.serving import ThreadingMixIn" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "STORE_NAME", "fake_stream" ], [ "STORE_NAME", "thread_proxies" ], [ "STORE_NAME", "def stream_proxy(original):\n def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)\n\n return LocalProxy(p)" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "STORE_NAME", "def run_server(port, bind_host, show_server_output):\n if not show_server_output:\n thread_proxies[current_thread().ident] = fake_stream()\n try:\n server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )\n except socket.error:\n pass" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL", "select_autoescape(['html', 'xml'])" ], [ "CALL", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "STORE_NAME", "templates_env" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "CALL", "magics_class" ], [ "STORE_NAME", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "STORE_FAST", " def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_ATTR", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "STORE_NAME", "server_url" ], [ "LOAD_NAME", "Int" ], [ "CALL", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "STORE_NAME", "port" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "STORE_NAME", "bind_host" ], [ "LOAD_NAME", "Bool" ], [ "CALL", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "STORE_NAME", "show_server_output" ], [ "LOAD_NAME", "Unicode" ], [ "CALL", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "STORE_NAME", "db_url" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL", "cell_magic" ], [ "STORE_NAME", " @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_ATTR", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "STORE_FAST", " def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL", "eye.exec_ipython_cell(cell, callback)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_ATTR", "templates_env.get_template" ], [ "CALL", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_ATTR", "self.server_url.rstrip" ], [ "CALL", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "STORE_FAST", "html" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.13.json000066400000000000000000000554631474076367500246660ustar00rootroot00000000000000[ [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import socket" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from io import BytesIO, StringIO" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from threading import current_thread, Thread" ], [ "STORE_NAME", "from uuid import uuid4" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.display import HTML, display" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from IPython.core.magic import Magics, cell_magic, magics_class" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from jinja2 import Environment, PackageLoader, select_autoescape" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from traitlets import Unicode, Int, Bool" ], [ "STORE_NAME", "from werkzeug.local import LocalProxy" ], [ "STORE_NAME", "from werkzeug.serving import ThreadingMixIn" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye.bird import PY2, Database" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "STORE_NAME", "from birdseye import server, eye" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "STORE_NAME", "fake_stream" ], [ "STORE_NAME", "thread_proxies" ], [ "STORE_NAME", "def stream_proxy(original):\n def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)\n\n return LocalProxy(p)" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "STORE_NAME", "def run_server(port, bind_host, show_server_output):\n if not show_server_output:\n thread_proxies[current_thread().ident] = fake_stream()\n try:\n server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )\n except socket.error:\n pass" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL", "select_autoescape(['html', 'xml'])" ], [ "CALL_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "STORE_NAME", "templates_env" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "CALL", "magics_class" ], [ "STORE_NAME", "@magics_class\nclass BirdsEyeMagics(Magics):\n server_url = Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )\n\n port = Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )\n\n bind_host = Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )\n\n show_server_output = Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )\n\n db_url = Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )\n\n @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "LOAD_FAST", " def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)" ], [ "STORE_FAST", " def p():\n frame = inspect.currentframe()\n while frame:\n if frame.f_code == ThreadingMixIn.process_request_thread.__code__:\n return fake_stream()\n frame = frame.f_back\n return thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_ATTR", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "STORE_NAME", "server_url" ], [ "LOAD_NAME", "Int" ], [ "CALL_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "STORE_NAME", "port" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "STORE_NAME", "bind_host" ], [ "LOAD_NAME", "Bool" ], [ "CALL_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "STORE_NAME", "show_server_output" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "STORE_NAME", "db_url" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL", "cell_magic" ], [ "STORE_NAME", " @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "STORE_NAME", " @cell_magic\n def eye(self, _line, cell):\n if not self.server_url:\n server.db = Database(self.db_url)\n server.Function = server.db.Function\n server.Call = server.db.Call\n server.Session = server.db.Session\n Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()\n\n eye.db = Database(self.db_url)\n\n def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)\n\n value = eye.exec_ipython_cell(cell, callback)\n # Display the value as would happen if the %eye magic wasn't there\n return value" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_ATTR", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_FAST", " def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)" ], [ "STORE_FAST", " def callback(call_id):\n \"\"\"\n Always executes after the cell, whether or not an exception is raised\n in the user code.\n \"\"\"\n if call_id is None: # probably means a bug\n return\n\n html = HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))\n\n # noinspection PyTypeChecker\n display(html)" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "CALL", "eye.exec_ipython_cell(cell, callback)" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_ATTR", "templates_env.get_template" ], [ "CALL", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_ATTR", "self.server_url.rstrip" ], [ "CALL", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "STORE_FAST", "html" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.5.json000066400000000000000000000246441474076367500246040ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_ATTR", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_FUNCTION", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_ATTR", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_FUNCTION", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_ATTR", "templates_env.get_template" ], [ "CALL_FUNCTION", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_ATTR", "self.server_url.rstrip" ], [ "CALL_FUNCTION", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.6.json000066400000000000000000000246771474076367500246130ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_ATTR", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_FUNCTION", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_ATTR", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_ATTR", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_FUNCTION", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_ATTR", "templates_env.get_template" ], [ "CALL_FUNCTION", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_ATTR", "self.server_url.rstrip" ], [ "CALL_FUNCTION", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.7.json000066400000000000000000000246771474076367500246140ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.8.json000066400000000000000000000246771474076367500246150ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-py-3.9.json000066400000000000000000000246721474076367500246110ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION_KW", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOAD_ATTR", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_FUNCTION_KW", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION_KW", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION_KW", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION_KW", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION_KW", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOAD_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOAD_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "IS_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOAD_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOAD_ATTR", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_FUNCTION_KW", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-pypy-2.7.json000066400000000000000000000261611474076367500251520ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOOKUP_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOOKUP_METHOD", "server.app.run" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "LOAD_NAME", "True" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOOKUP_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOOKUP_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOOKUP_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOOKUP_METHOD", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOOKUP_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-pypy-3.5.json000066400000000000000000000246641474076367500251570ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOOKUP_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOOKUP_METHOD", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_METHOD", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOOKUP_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOOKUP_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOOKUP_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOOKUP_METHOD", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOOKUP_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/ipython-pypy-3.6.json000066400000000000000000000246641474076367500251600ustar00rootroot00000000000000[ [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "BytesIO" ], [ "LOAD_NAME", "StringIO" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stderr" ], [ "CALL_FUNCTION", "stream_proxy(sys.stderr)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stderr" ], [ "LOAD_NAME", "stream_proxy" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.stdout" ], [ "CALL_FUNCTION", "stream_proxy(sys.stdout)" ], [ "LOAD_NAME", "sys" ], [ "STORE_ATTR", "sys.stdout" ], [ "LOAD_NAME", "Environment" ], [ "LOAD_NAME", "PackageLoader" ], [ "CALL_FUNCTION", "PackageLoader('birdseye', 'templates')" ], [ "LOAD_NAME", "select_autoescape" ], [ "CALL_FUNCTION", "select_autoescape(['html', 'xml'])" ], [ "CALL_FUNCTION", "Environment(\n loader=PackageLoader('birdseye', 'templates'),\n autoescape=select_autoescape(['html', 'xml'])\n)" ], [ "LOAD_NAME", "magics_class" ], [ "LOAD_NAME", "Magics" ], [ "CALL_FUNCTION", "magics_class" ], [ "LOAD_GLOBAL", "LocalProxy" ], [ "LOAD_FAST", "p" ], [ "CALL_FUNCTION", "LocalProxy(p)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "ThreadingMixIn" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread" ], [ "LOAD_ATTR", "ThreadingMixIn.process_request_thread.__code__" ], [ "COMPARE_OP", "frame.f_code == ThreadingMixIn.process_request_thread.__code__" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOOKUP_METHOD", "thread_proxies.get" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "LOAD_DEREF", "original" ], [ "CALL_METHOD", "thread_proxies.get(current_thread().ident,\n original)" ], [ "LOAD_FAST", "show_server_output" ], [ "LOAD_GLOBAL", "fake_stream" ], [ "CALL_FUNCTION", "fake_stream()" ], [ "LOAD_GLOBAL", "thread_proxies" ], [ "LOAD_GLOBAL", "current_thread" ], [ "CALL_FUNCTION", "current_thread()" ], [ "LOAD_ATTR", "current_thread().ident" ], [ "STORE_SUBSCR", "thread_proxies[current_thread().ident]" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.app" ], [ "LOOKUP_METHOD", "server.app.run" ], [ "LOAD_FAST", "port" ], [ "LOAD_FAST", "bind_host" ], [ "CALL_METHOD", "server.app.run(\n debug=True,\n port=port,\n host=bind_host,\n use_reloader=False,\n )" ], [ "LOAD_GLOBAL", "socket" ], [ "LOAD_ATTR", "socket.error" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='If set, a server will not be automatically started by %%eye. '\n 'The iframe containing birdseye output will use this value as the base '\n 'of its URL.'\n )" ], [ "LOAD_NAME", "Int" ], [ "CALL_FUNCTION", "Int(\n 7777, config=True,\n help='Port number for the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n '127.0.0.1', config=True,\n help='Host that the server started by %%eye listens on. '\n 'Set to 0.0.0.0 to make it accessible anywhere.'\n )" ], [ "LOAD_NAME", "Bool" ], [ "CALL_FUNCTION", "Bool(\n False, config=True,\n help='Set to True to show stdout and stderr from the server started by %%eye.'\n )" ], [ "LOAD_NAME", "Unicode" ], [ "CALL_FUNCTION", "Unicode(\n u'', config=True,\n help='The database URL that the server started by %%eye reads from. '\n 'Equivalent to the environment variable BIRDSEYE_DB.'\n )" ], [ "LOAD_NAME", "cell_magic" ], [ "CALL_FUNCTION", "cell_magic" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.db" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Function" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Function" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Call" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Call" ], [ "LOAD_GLOBAL", "server" ], [ "LOAD_ATTR", "server.db" ], [ "LOAD_ATTR", "server.db.Session" ], [ "LOAD_GLOBAL", "server" ], [ "STORE_ATTR", "server.Session" ], [ "LOAD_GLOBAL", "Thread" ], [ "LOAD_GLOBAL", "run_server" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.bind_host" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.show_server_output" ], [ "CALL_FUNCTION", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n )" ], [ "LOOKUP_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start" ], [ "CALL_METHOD", "Thread(\n target=run_server,\n args=(\n self.port,\n self.bind_host,\n self.show_server_output,\n ),\n ).start()" ], [ "LOAD_GLOBAL", "Database" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.db_url" ], [ "CALL_FUNCTION", "Database(self.db_url)" ], [ "LOAD_GLOBAL", "eye" ], [ "STORE_ATTR", "eye.db" ], [ "LOAD_GLOBAL", "eye" ], [ "LOOKUP_METHOD", "eye.exec_ipython_cell" ], [ "LOAD_FAST", "cell" ], [ "LOAD_FAST", "callback" ], [ "CALL_METHOD", "eye.exec_ipython_cell(cell, callback)" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "call_id" ], [ "COMPARE_OP", "call_id is None" ], [ "LOAD_GLOBAL", "HTML" ], [ "LOAD_GLOBAL", "templates_env" ], [ "LOOKUP_METHOD", "templates_env.get_template" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html')" ], [ "LOOKUP_METHOD", "templates_env.get_template('ipython_iframe.html').render" ], [ "LOAD_FAST", "call_id" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.server_url" ], [ "LOOKUP_METHOD", "self.server_url.rstrip" ], [ "CALL_METHOD", "self.server_url.rstrip('/')" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.port" ], [ "LOAD_GLOBAL", "uuid4" ], [ "CALL_FUNCTION", "uuid4()" ], [ "LOAD_ATTR", "uuid4().hex" ], [ "CALL_METHOD", "templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n )" ], [ "CALL_FUNCTION", "HTML(templates_env.get_template('ipython_iframe.html').render(\n call_id=call_id,\n url=self.server_url.rstrip('/'),\n port=self.port,\n container_id=uuid4().hex,\n ))" ], [ "LOAD_GLOBAL", "display" ], [ "LOAD_FAST", "html" ], [ "CALL_FUNCTION", "display(html)" ] ]python-executing-2.2.0/tests/sample_results/server-py-2.7.json000066400000000000000000001300671474076367500244160ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "SLICE+1", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_ATTR", "db.all_file_paths" ], [ "CALL_FUNCTION", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "SLICE+2", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_ATTR", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_ATTR", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_FUNCTION", "session.query(filtered_calls)" ], [ "LOAD_ATTR", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_FUNCTION", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_ATTR", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_ATTR", "filtered_calls.c.start_time.desc" ], [ "CALL_FUNCTION", "filtered_calls.c.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_ATTR", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "SLICE+2", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_ATTR", "request.environ.get" ], [ "CALL_FUNCTION", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_KW", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_KW", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_VAR", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "SLICE+2", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "CALL_FUNCTION", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_FUNCTION", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_ATTR", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_FUNCTION", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL_FUNCTION", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_FUNCTION", "sqlalchemy.func.count(Call.id)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_ATTR", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_FUNCTION", "Function.body_hash.in_(hashes)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION", "dict(hash=h, count=count)" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_ATTR", "argv[0].isdigit" ], [ "CALL_FUNCTION", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_ATTR", "argv.insert" ], [ "CALL_FUNCTION", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.10.json000066400000000000000000001257321474076367500244740ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION_KW", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOAD_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "CONTAINS_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "IS_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CONTAINS_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION_KW", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.11.json000066400000000000000000001620721474076367500244730ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from os.path import basename" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import argparse" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask.templating import render_template" ], [ "STORE_NAME", "from flask_humanize import Humanize" ], [ "STORE_NAME", "from werkzeug.routing import PathConverter" ], [ "STORE_NAME", "import sqlalchemy" ], [ "STORE_NAME", "from birdseye.db import Database" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "LOAD_NAME", "Flask" ], [ "CALL", "Flask('birdseye')" ], [ "STORE_NAME", "app" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "CALL", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "STORE_NAME", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL", "Database()" ], [ "STORE_NAME", "db" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "STORE_NAME", "Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "STORE_NAME", "Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "STORE_NAME", "Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/')" ], [ "STORE_NAME", "@app.route('/')\n@db.provide_session\ndef index(session):\n all_paths = db.all_file_paths()\n\n recent_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100])\n\n files = OrderedDict()\n\n for row in recent_calls:\n if is_ipython_cell(row.file):\n continue\n files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )\n\n for path in all_paths:\n files.setdefault(\n path, OrderedDict()\n )\n\n short = partial(short_path, all_paths=all_paths)\n\n return render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file/')" ], [ "STORE_NAME", "@app.route('/file/')\n@db.provide_session\ndef file_view(session, path):\n path = fix_abs_path(path)\n\n # Get all calls and functions in this file\n filtered_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls'))\n\n # Get the latest call *time* for each function in the file\n latest_calls = session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')\n\n # Get the latest call for each function\n query = session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())\n funcs = group_by_attr(query, 'type')\n\n # Add any functions which were never called\n all_funcs = sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())\n func_names = {row.name for row in query}\n for func in all_funcs:\n if func.name not in func_names:\n funcs[func.type].append(func)\n\n return render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file//__function__/')" ], [ "STORE_NAME", "@app.route('/file//__function__/')\n@db.provide_session\ndef func_view(session, path, func_name):\n path = fix_abs_path(path)\n query = get_calls(session, path, func_name, 200)\n if query:\n func = query[0]\n calls = [withattrs(Call(), **row._asdict()) for row in query]\n else:\n func = session.query(Function).filter_by(file=path, name=func_name)[0]\n calls = None\n\n return render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "STORE_NAME", "@app.route('/api/file//__function__//latest_call/')\n@db.provide_session\ndef latest_call(session, path, func_name):\n path = fix_abs_path(path)\n call = get_calls(session, path, func_name, 1)[0]\n return jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "STORE_NAME", "def get_calls(session, path, func_name, limit):\n return (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "STORE_NAME", "@db.provide_session\ndef base_call_view(session, call_id, template):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/call/')" ], [ "CALL", "app.route('/call/')" ], [ "STORE_NAME", "@app.route('/call/')\ndef call_view(call_id):\n return base_call_view(call_id, 'call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/ipython_call/')" ], [ "CALL", "app.route('/ipython_call/')" ], [ "STORE_NAME", "@app.route('/ipython_call/')\ndef ipython_call_view(call_id):\n return base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "STORE_NAME", "@app.route('/ipython_iframe/')\ndef ipython_iframe_view(call_id):\n \"\"\"\n This view isn't generally used, it's just an easy way to play with the template\n without a notebook.\n \"\"\"\n return render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/kill', methods=['POST'])" ], [ "CALL", "app.route('/kill', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/kill', methods=['POST'])\ndef kill():\n func = request.environ.get('werkzeug.server.shutdown')\n if func is None:\n raise RuntimeError('Not running with the Werkzeug Server')\n func()\n return 'Server shutting down...'" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/call/')" ], [ "STORE_NAME", "@app.route('/api/call/')\n@db.provide_session\ndef api_call_view(session, call_id):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "STORE_NAME", "@app.route('/api/calls_by_body_hash/')\n@db.provide_session\ndef calls_by_body_hash(session, body_hash):\n query = (session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200])\n\n calls = [Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]\n\n function_data_set = {row.data for row in query}\n ranges = set()\n loop_ranges = set()\n for function_data in function_data_set:\n function_data = json.loads(function_data)\n\n def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))\n\n add('node_ranges', ranges)\n\n # All functions are expected to have the same set\n # of loop nodes\n current_loop_ranges = set()\n add('loop_ranges', current_loop_ranges)\n assert loop_ranges in (set(), current_loop_ranges)\n loop_ranges = current_loop_ranges\n\n ranges = [dict(start=start, end=end) for start, end in ranges]\n loop_ranges = [dict(start=start, end=end) for start, end in loop_ranges]\n\n return DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/api/body_hashes_present/', methods=['POST'])\n@db.provide_session\ndef body_hashes_present(session):\n hashes = request.get_json()\n query = (session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash))\n return DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "STORE_NAME", "def main(argv=sys.argv[1:]):\n # Support legacy CLI where there was just one positional argument: the port\n if len(argv) == 1 and argv[0].isdigit():\n argv.insert(0, '--port')\n\n parser = argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")\n parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)\n parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')\n\n args = parser.parse_args(argv)\n app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL", "main()" ], [ "STORE_NAME", "regex" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_METHOD", "db.all_file_paths" ], [ "CALL", "db.all_file_paths()" ], [ "STORE_FAST", "all_paths" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "STORE_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "STORE_FAST", "files" ], [ "LOAD_FAST", "recent_calls" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL", "partial(short_path, all_paths=all_paths)" ], [ "STORE_FAST", "short" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "STORE_FAST", "filtered_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "STORE_FAST", "latest_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL", "session.query(filtered_calls)" ], [ "LOAD_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL", "filtered_calls.c.start_time.desc()" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL", "group_by_attr(query, 'type')" ], [ "STORE_FAST", "funcs" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL", "session.query(Function.name, Function.type)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "STORE_FAST", "all_funcs" ], [ "LOAD_FAST", "query" ], [ "CALL", "{row.name for row in query}" ], [ "STORE_FAST", "func_names" ], [ "LOAD_FAST", "all_funcs" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "CONTAINS_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "CALL", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "{row.name for row in query}" ], [ "STORE_FAST", "row" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 200)" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "query" ], [ "CALL", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "STORE_FAST", "calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "STORE_FAST", "func" ], [ "STORE_FAST", "calls" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_FAST", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "STORE_FAST", "call" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_METHOD", "request.environ.get" ], [ "CALL", "request.environ.get('werkzeug.server.shutdown')" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_OP", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "CALL", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "calls" ], [ "LOAD_FAST", "query" ], [ "CALL", "{row.data for row in query}" ], [ "STORE_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "function_data_set" ], [ "STORE_DEREF", "function_data" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL", "json.loads(function_data)" ], [ "STORE_DEREF", "function_data" ], [ "STORE_FAST", " def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CONTAINS_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "CALL", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_FAST", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "{row.data for row in query}" ], [ "STORE_FAST", "row" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(start=start, end=end)" ], [ "LOAD_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL", "request.get_json()" ], [ "STORE_FAST", "hashes" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL", "sqlalchemy.func.count(Call.id)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL", "Function.body_hash.in_(hashes)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "CALL", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "count" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_METHOD", "argv[0].isdigit" ], [ "CALL", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_METHOD", "argv.insert" ], [ "CALL", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "STORE_FAST", "parser" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.add_argument" ], [ "CALL", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL", "parser.parse_args(argv)" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_METHOD", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.12.json000066400000000000000000001652621474076367500245000ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from os.path import basename" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import argparse" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask.templating import render_template" ], [ "STORE_NAME", "from flask_humanize import Humanize" ], [ "STORE_NAME", "from werkzeug.routing import PathConverter" ], [ "STORE_NAME", "import sqlalchemy" ], [ "STORE_NAME", "from birdseye.db import Database" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "LOAD_NAME", "Flask" ], [ "CALL", "Flask('birdseye')" ], [ "STORE_NAME", "app" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "CALL", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "STORE_NAME", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL", "Database()" ], [ "STORE_NAME", "db" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "STORE_NAME", "Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "STORE_NAME", "Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "STORE_NAME", "Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/')" ], [ "STORE_NAME", "@app.route('/')\n@db.provide_session\ndef index(session):\n all_paths = db.all_file_paths()\n\n recent_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100])\n\n files = OrderedDict()\n\n for row in recent_calls:\n if is_ipython_cell(row.file):\n continue\n files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )\n\n for path in all_paths:\n files.setdefault(\n path, OrderedDict()\n )\n\n short = partial(short_path, all_paths=all_paths)\n\n return render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file/')" ], [ "STORE_NAME", "@app.route('/file/')\n@db.provide_session\ndef file_view(session, path):\n path = fix_abs_path(path)\n\n # Get all calls and functions in this file\n filtered_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls'))\n\n # Get the latest call *time* for each function in the file\n latest_calls = session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')\n\n # Get the latest call for each function\n query = session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())\n funcs = group_by_attr(query, 'type')\n\n # Add any functions which were never called\n all_funcs = sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())\n func_names = {row.name for row in query}\n for func in all_funcs:\n if func.name not in func_names:\n funcs[func.type].append(func)\n\n return render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file//__function__/')" ], [ "STORE_NAME", "@app.route('/file//__function__/')\n@db.provide_session\ndef func_view(session, path, func_name):\n path = fix_abs_path(path)\n query = get_calls(session, path, func_name, 200)\n if query:\n func = query[0]\n calls = [withattrs(Call(), **row._asdict()) for row in query]\n else:\n func = session.query(Function).filter_by(file=path, name=func_name)[0]\n calls = None\n\n return render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "STORE_NAME", "@app.route('/api/file//__function__//latest_call/')\n@db.provide_session\ndef latest_call(session, path, func_name):\n path = fix_abs_path(path)\n call = get_calls(session, path, func_name, 1)[0]\n return jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "STORE_NAME", "def get_calls(session, path, func_name, limit):\n return (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "STORE_NAME", "@db.provide_session\ndef base_call_view(session, call_id, template):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/call/')" ], [ "CALL", "app.route('/call/')" ], [ "STORE_NAME", "@app.route('/call/')\ndef call_view(call_id):\n return base_call_view(call_id, 'call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/ipython_call/')" ], [ "CALL", "app.route('/ipython_call/')" ], [ "STORE_NAME", "@app.route('/ipython_call/')\ndef ipython_call_view(call_id):\n return base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "STORE_NAME", "@app.route('/ipython_iframe/')\ndef ipython_iframe_view(call_id):\n \"\"\"\n This view isn't generally used, it's just an easy way to play with the template\n without a notebook.\n \"\"\"\n return render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/kill', methods=['POST'])" ], [ "CALL", "app.route('/kill', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/kill', methods=['POST'])\ndef kill():\n func = request.environ.get('werkzeug.server.shutdown')\n if func is None:\n raise RuntimeError('Not running with the Werkzeug Server')\n func()\n return 'Server shutting down...'" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/call/')" ], [ "STORE_NAME", "@app.route('/api/call/')\n@db.provide_session\ndef api_call_view(session, call_id):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "STORE_NAME", "@app.route('/api/calls_by_body_hash/')\n@db.provide_session\ndef calls_by_body_hash(session, body_hash):\n query = (session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200])\n\n calls = [Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]\n\n function_data_set = {row.data for row in query}\n ranges = set()\n loop_ranges = set()\n for function_data in function_data_set:\n function_data = json.loads(function_data)\n\n def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))\n\n add('node_ranges', ranges)\n\n # All functions are expected to have the same set\n # of loop nodes\n current_loop_ranges = set()\n add('loop_ranges', current_loop_ranges)\n assert loop_ranges in (set(), current_loop_ranges)\n loop_ranges = current_loop_ranges\n\n ranges = [dict(start=start, end=end) for start, end in ranges]\n loop_ranges = [dict(start=start, end=end) for start, end in loop_ranges]\n\n return DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/api/body_hashes_present/', methods=['POST'])\n@db.provide_session\ndef body_hashes_present(session):\n hashes = request.get_json()\n query = (session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash))\n return DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SLICE", "sys.argv[1:]" ], [ "STORE_NAME", "def main(argv=sys.argv[1:]):\n # Support legacy CLI where there was just one positional argument: the port\n if len(argv) == 1 and argv[0].isdigit():\n argv.insert(0, '--port')\n\n parser = argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")\n parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)\n parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')\n\n args = parser.parse_args(argv)\n app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL", "main()" ], [ "STORE_NAME", "regex" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_ATTR", "db.all_file_paths" ], [ "CALL", "db.all_file_paths()" ], [ "STORE_FAST", "all_paths" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SLICE", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "STORE_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "STORE_FAST", "files" ], [ "LOAD_FAST", "recent_calls" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_ATTR", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL", "partial(short_path, all_paths=all_paths)" ], [ "STORE_FAST", "short" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "STORE_FAST", "filtered_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_ATTR", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "STORE_FAST", "latest_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL", "session.query(filtered_calls)" ], [ "LOAD_ATTR", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_ATTR", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_ATTR", "filtered_calls.c.start_time.desc" ], [ "CALL", "filtered_calls.c.start_time.desc()" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL", "group_by_attr(query, 'type')" ], [ "STORE_FAST", "funcs" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "STORE_FAST", "all_funcs" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "{row.name for row in query}" ], [ "STORE_FAST", "row" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "STORE_FAST", "func_names" ], [ "STORE_FAST", "{row.name for row in query}" ], [ "LOAD_FAST", "all_funcs" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "CONTAINS_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_ATTR", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "CALL", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "STORE_FAST", "{row.name for row in query}" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 200)" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "STORE_FAST", "calls" ], [ "STORE_FAST", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "STORE_FAST", "func" ], [ "STORE_FAST", "calls" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "STORE_FAST", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "STORE_FAST", "call" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SLICE", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_ATTR", "request.environ.get" ], [ "CALL", "request.environ.get('werkzeug.server.shutdown')" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_OP", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SLICE", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "STORE_FAST", "calls" ], [ "STORE_FAST", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "{row.data for row in query}" ], [ "STORE_FAST", "row" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "STORE_FAST", "function_data_set" ], [ "STORE_FAST", "{row.data for row in query}" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "function_data_set" ], [ "STORE_DEREF", "function_data" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL", "json.loads(function_data)" ], [ "STORE_DEREF", "function_data" ], [ "STORE_FAST", " def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CONTAINS_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in ranges]" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(start=start, end=end)" ], [ "STORE_FAST", "ranges" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL", "dict(start=start, end=end)" ], [ "STORE_FAST", "loop_ranges" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "STORE_FAST", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "{row.data for row in query}" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_ATTR", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL", "request.get_json()" ], [ "STORE_FAST", "hashes" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL", "sqlalchemy.func.count(Call.id)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_ATTR", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL", "Function.body_hash.in_(hashes)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "h" ], [ "STORE_FAST", "count" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL", "dict(hash=h, count=count)" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "CALL", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_ATTR", "argv[0].isdigit" ], [ "CALL", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_ATTR", "argv.insert" ], [ "CALL", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "STORE_FAST", "parser" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL", "parser.parse_args(argv)" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.13.json000066400000000000000000001631741474076367500245010ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "import json" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "from functools import partial" ], [ "STORE_NAME", "from os.path import basename" ], [ "STORE_NAME", "from future import standard_library" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "STORE_NAME", "from littleutils import DecentJSONEncoder, withattrs, group_by_attr" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import argparse" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask import Flask, request, jsonify, url_for" ], [ "STORE_NAME", "from flask.templating import render_template" ], [ "STORE_NAME", "from flask_humanize import Humanize" ], [ "STORE_NAME", "from werkzeug.routing import PathConverter" ], [ "STORE_NAME", "import sqlalchemy" ], [ "STORE_NAME", "from birdseye.db import Database" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "STORE_NAME", "from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell" ], [ "LOAD_NAME", "Flask" ], [ "CALL", "Flask('birdseye')" ], [ "STORE_NAME", "app" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "CALL", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "STORE_NAME", "class FileConverter(PathConverter):\n regex = '.*?'" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL", "Database()" ], [ "STORE_NAME", "db" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "STORE_NAME", "Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "STORE_NAME", "Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "STORE_NAME", "Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/')" ], [ "STORE_NAME", "@app.route('/')\n@db.provide_session\ndef index(session):\n all_paths = db.all_file_paths()\n\n recent_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100])\n\n files = OrderedDict()\n\n for row in recent_calls:\n if is_ipython_cell(row.file):\n continue\n files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )\n\n for path in all_paths:\n files.setdefault(\n path, OrderedDict()\n )\n\n short = partial(short_path, all_paths=all_paths)\n\n return render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file/')" ], [ "STORE_NAME", "@app.route('/file/')\n@db.provide_session\ndef file_view(session, path):\n path = fix_abs_path(path)\n\n # Get all calls and functions in this file\n filtered_calls = (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls'))\n\n # Get the latest call *time* for each function in the file\n latest_calls = session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')\n\n # Get the latest call for each function\n query = session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())\n funcs = group_by_attr(query, 'type')\n\n # Add any functions which were never called\n all_funcs = sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())\n func_names = {row.name for row in query}\n for func in all_funcs:\n if func.name not in func_names:\n funcs[func.type].append(func)\n\n return render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/file//__function__/')" ], [ "STORE_NAME", "@app.route('/file//__function__/')\n@db.provide_session\ndef func_view(session, path, func_name):\n path = fix_abs_path(path)\n query = get_calls(session, path, func_name, 200)\n if query:\n func = query[0]\n calls = [withattrs(Call(), **row._asdict()) for row in query]\n else:\n func = session.query(Function).filter_by(file=path, name=func_name)[0]\n calls = None\n\n return render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/file//__function__//latest_call/')" ], [ "STORE_NAME", "@app.route('/api/file//__function__//latest_call/')\n@db.provide_session\ndef latest_call(session, path, func_name):\n path = fix_abs_path(path)\n call = get_calls(session, path, func_name, 1)[0]\n return jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "STORE_NAME", "def get_calls(session, path, func_name, limit):\n return (session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "STORE_NAME", "@db.provide_session\ndef base_call_view(session, call_id, template):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/call/')" ], [ "CALL", "app.route('/call/')" ], [ "STORE_NAME", "@app.route('/call/')\ndef call_view(call_id):\n return base_call_view(call_id, 'call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/ipython_call/')" ], [ "CALL", "app.route('/ipython_call/')" ], [ "STORE_NAME", "@app.route('/ipython_call/')\ndef ipython_call_view(call_id):\n return base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "CALL", "app.route('/ipython_iframe/')" ], [ "STORE_NAME", "@app.route('/ipython_iframe/')\ndef ipython_iframe_view(call_id):\n \"\"\"\n This view isn't generally used, it's just an easy way to play with the template\n without a notebook.\n \"\"\"\n return render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL", "app.route('/kill', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/kill', methods=['POST'])\ndef kill():\n func = request.environ.get('werkzeug.server.shutdown')\n if func is None:\n raise RuntimeError('Not running with the Werkzeug Server')\n func()\n return 'Server shutting down...'" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/call/')" ], [ "STORE_NAME", "@app.route('/api/call/')\n@db.provide_session\ndef api_call_view(session, call_id):\n call = session.query(Call).filter_by(id=call_id).one()\n func = call.function\n return DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/calls_by_body_hash/')" ], [ "STORE_NAME", "@app.route('/api/calls_by_body_hash/')\n@db.provide_session\ndef calls_by_body_hash(session, body_hash):\n query = (session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200])\n\n calls = [Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]\n\n function_data_set = {row.data for row in query}\n ranges = set()\n loop_ranges = set()\n for function_data in function_data_set:\n function_data = json.loads(function_data)\n\n def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))\n\n add('node_ranges', ranges)\n\n # All functions are expected to have the same set\n # of loop nodes\n current_loop_ranges = set()\n add('loop_ranges', current_loop_ranges)\n assert loop_ranges in (set(), current_loop_ranges)\n loop_ranges = current_loop_ranges\n\n ranges = [dict(start=start, end=end) for start, end in ranges]\n loop_ranges = [dict(start=start, end=end) for start, end in loop_ranges]\n\n return DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL", "db.provide_session" ], [ "CALL", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "STORE_NAME", "@app.route('/api/body_hashes_present/', methods=['POST'])\n@db.provide_session\ndef body_hashes_present(session):\n hashes = request.get_json()\n query = (session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash))\n return DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SLICE", "sys.argv[1:]" ], [ "STORE_NAME", "def main(argv=sys.argv[1:]):\n # Support legacy CLI where there was just one positional argument: the port\n if len(argv) == 1 and argv[0].isdigit():\n argv.insert(0, '--port')\n\n parser = argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")\n parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)\n parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')\n\n args = parser.parse_args(argv)\n app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL", "main()" ], [ "STORE_NAME", "regex" ], [ "STORE_NAME", "regex" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_ATTR", "db.all_file_paths" ], [ "CALL", "db.all_file_paths()" ], [ "STORE_FAST", "all_paths" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SLICE", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "STORE_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "STORE_FAST", "files" ], [ "LOAD_FAST", "recent_calls" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_ATTR", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "CALL", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_KW", "partial(short_path, all_paths=all_paths)" ], [ "STORE_FAST", "short" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "STORE_FAST", "filtered_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_ATTR", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "STORE_FAST", "latest_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL", "session.query(filtered_calls)" ], [ "LOAD_ATTR", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_ATTR", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_ATTR", "filtered_calls.c.start_time.desc" ], [ "CALL", "filtered_calls.c.start_time.desc()" ], [ "CALL", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL", "group_by_attr(query, 'type')" ], [ "STORE_FAST", "funcs" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "STORE_FAST", "all_funcs" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "{row.name for row in query}" ], [ "LOAD_ATTR", "row.name" ], [ "STORE_FAST", "func_names" ], [ "STORE_FAST", "{row.name for row in query}" ], [ "LOAD_FAST", "all_funcs" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "CONTAINS_OP", "func.name not in func_names" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_ATTR", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "CALL_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "STORE_FAST", "{row.name for row in query}" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 200)" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "STORE_FAST", "calls" ], [ "STORE_FAST", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "CALL_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "STORE_FAST", "func" ], [ "STORE_FAST", "calls" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "STORE_FAST", "[withattrs(Call(), **row._asdict()) for row in query]" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL", "fix_abs_path(path)" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "func_name" ], [ "CALL", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "STORE_FAST", "call" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_OP", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "CALL_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SLICE", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_ATTR", "request.environ.get" ], [ "CALL", "request.environ.get('werkzeug.server.shutdown')" ], [ "STORE_FAST", "func" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL", "session.query(Call).filter_by(id=call_id).one()" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "STORE_FAST", "func" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_OP", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL", "Call.start_time.desc()" ], [ "CALL", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SLICE", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "STORE_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "row" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "STORE_FAST", "calls" ], [ "STORE_FAST", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "{row.data for row in query}" ], [ "LOAD_ATTR", "row.data" ], [ "STORE_FAST", "function_data_set" ], [ "STORE_FAST", "{row.data for row in query}" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "function_data_set" ], [ "STORE_DEREF", "function_data" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL", "json.loads(function_data)" ], [ "STORE_DEREF", "function_data" ], [ "LOAD_FAST", " def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))" ], [ "STORE_FAST", " def add(key, ranges_set):\n for node in function_data[key]:\n ranges_set.add((node['start'], node['end']))" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "STORE_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CONTAINS_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "STORE_FAST", "loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in ranges]" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in ranges]" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(start=start, end=end)" ], [ "STORE_FAST", "ranges" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_FAST_AND_CLEAR", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(start=start, end=end)" ], [ "STORE_FAST", "loop_ranges" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "STORE_FAST", "[Call.basic_dict(withattrs(Call(), **row._asdict()))\n for row in query]" ], [ "STORE_FAST", "{row.data for row in query}" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "STORE_FAST", "[dict(start=start, end=end) for start, end in loop_ranges]" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_ATTR", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL", "request.get_json()" ], [ "STORE_FAST", "hashes" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL", "sqlalchemy.func.count(Call.id)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_ATTR", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL", "Function.body_hash.in_(hashes)" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "STORE_FAST", "query" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST_AND_CLEAR", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "LOAD_GLOBAL", "dict" ], [ "CALL_KW", "dict(hash=h, count=count)" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "CALL", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "STORE_FAST", "[\n dict(hash=h, count=count)\n for h, count in query\n ]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_ATTR", "argv[0].isdigit" ], [ "CALL", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_ATTR", "argv.insert" ], [ "CALL", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "STORE_FAST", "parser" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL", "parser.parse_args(argv)" ], [ "STORE_FAST", "args" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.5.json000066400000000000000000001256231474076367500244170ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_ATTR", "db.all_file_paths" ], [ "CALL_FUNCTION", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_ATTR", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_ATTR", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_FUNCTION", "session.query(filtered_calls)" ], [ "LOAD_ATTR", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_FUNCTION", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_ATTR", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_ATTR", "filtered_calls.c.start_time.desc" ], [ "CALL_FUNCTION", "filtered_calls.c.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_ATTR", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_ATTR", "request.environ.get" ], [ "CALL_FUNCTION", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_KW", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_KW", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_VAR", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_FUNCTION", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "CALL_FUNCTION", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_ATTR", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_FUNCTION", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL_FUNCTION", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_FUNCTION", "sqlalchemy.func.count(Call.id)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_ATTR", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_FUNCTION", "Function.body_hash.in_(hashes)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_ATTR", "argv[0].isdigit" ], [ "CALL_FUNCTION", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_ATTR", "argv.insert" ], [ "CALL_FUNCTION", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.6.json000066400000000000000000001257351474076367500244240ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_ATTR", "db.all_file_paths" ], [ "CALL_FUNCTION", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_ATTR", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_FUNCTION", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_ATTR", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_FUNCTION", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION_KW", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_ATTR", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_FUNCTION", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_ATTR", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_FUNCTION", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_FUNCTION", "session.query(filtered_calls)" ], [ "LOAD_ATTR", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_FUNCTION", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_ATTR", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_ATTR", "filtered_calls.c.start_time.desc" ], [ "CALL_FUNCTION", "filtered_calls.c.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_FUNCTION", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_ATTR", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_ATTR", "request.environ.get" ], [ "CALL_FUNCTION", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_ATTR", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_FUNCTION", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_FUNCTION", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_ATTR", "Call.start_time.desc" ], [ "CALL_FUNCTION", "Call.start_time.desc()" ], [ "CALL_FUNCTION", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_ATTR", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_FUNCTION", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row._asdict" ], [ "CALL_FUNCTION", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL_FUNCTION", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_ATTR", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_FUNCTION", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.get_json" ], [ "CALL_FUNCTION", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_ATTR", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_FUNCTION", "sqlalchemy.func.count(Call.id)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_ATTR", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_FUNCTION", "Function.body_hash.in_(hashes)" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_ATTR", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_FUNCTION", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_ATTR", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION_KW", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_ATTR", "argv[0].isdigit" ], [ "CALL_FUNCTION", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_ATTR", "argv.insert" ], [ "CALL_FUNCTION", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_ATTR", "os.environ.get" ], [ "CALL_FUNCTION", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.7.json000066400000000000000000001257351474076367500244250ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION_KW", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOAD_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION_KW", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.8.json000066400000000000000000001257351474076367500244260ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION_KW", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOAD_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION_KW", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-py-3.9.json000066400000000000000000001257321474076367500244240ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.route" ], [ "CALL_FUNCTION_KW", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOAD_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOAD_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOAD_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION_KW", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION_KW", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOAD_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOAD_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOAD_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOAD_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOAD_ATTR", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION_KW", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOAD_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "CONTAINS_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOAD_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION_KW", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOAD_ATTR", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION_KW", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION_KW", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION_KW", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_EX", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION_KW", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOAD_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION_KW", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOAD_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "IS_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOAD_ATTR", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION_KW", "session.query(Call).filter_by(id=call_id)" ], [ "LOAD_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_EX", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_EX", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION_KW", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_EX", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOAD_ATTR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_FUNCTION_KW", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOAD_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOAD_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOAD_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CONTAINS_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION_KW", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOAD_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_EX", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOAD_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION_KW", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOAD_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOAD_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOAD_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOAD_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION_KW", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOAD_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOAD_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOAD_ATTR", "argparse.ArgumentParser" ], [ "CALL_FUNCTION_KW", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION_KW", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOAD_ATTR", "parser.add_argument" ], [ "CALL_FUNCTION_KW", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOAD_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOAD_ATTR", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOAD_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_FUNCTION_KW", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-pypy-2.7.json000066400000000000000000001303231474076367500247620ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "SLICE+1", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOOKUP_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "SLICE+2", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOOKUP_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOOKUP_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOOKUP_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOOKUP_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "SLICE+2", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOOKUP_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_KW", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOOKUP_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_KW", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_VAR", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "SLICE+2", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOOKUP_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "request" ], [ "LOOKUP_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOOKUP_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION", "dict(hash=h, count=count)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOOKUP_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOOKUP_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOOKUP_METHOD", "argparse.ArgumentParser" ], [ "CALL_METHOD", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_METHOD", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "CALL_METHOD", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOOKUP_METHOD", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_METHOD", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-pypy-3.5.json000066400000000000000000001260571474076367500247720ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOOKUP_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOOKUP_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOOKUP_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOOKUP_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOOKUP_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOOKUP_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_KW", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOOKUP_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_KW", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_VAR", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOOKUP_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOOKUP_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOOKUP_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOOKUP_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOOKUP_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOOKUP_METHOD", "argparse.ArgumentParser" ], [ "CALL_METHOD", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_METHOD", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "CALL_METHOD", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOOKUP_METHOD", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_METHOD", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/server-pypy-3.6.json000066400000000000000000001260571474076367500247730ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "Flask" ], [ "CALL_FUNCTION", "Flask('birdseye')" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.jinja_env" ], [ "STORE_ATTR", "app.jinja_env.auto_reload" ], [ "LOAD_NAME", "Humanize" ], [ "LOAD_NAME", "app" ], [ "CALL_FUNCTION", "Humanize(app)" ], [ "LOAD_NAME", "PathConverter" ], [ "LOAD_NAME", "FileConverter" ], [ "LOAD_NAME", "app" ], [ "LOAD_ATTR", "app.url_map" ], [ "LOAD_ATTR", "app.url_map.converters" ], [ "STORE_SUBSCR", "app.url_map.converters['file']" ], [ "LOAD_NAME", "Database" ], [ "CALL_FUNCTION", "Database()" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Session" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Function" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.Call" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/file//__function__/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/file//__function__//latest_call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/call/')" ], [ "CALL_FUNCTION", "app.route('/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_call/')" ], [ "CALL_FUNCTION", "app.route('/ipython_call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/ipython_iframe/')" ], [ "CALL_FUNCTION", "app.route('/ipython_iframe/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/kill', methods=['POST'])" ], [ "CALL_FUNCTION", "app.route('/kill', methods=['POST'])" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/call/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/call/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/calls_by_body_hash/')" ], [ "LOAD_NAME", "app" ], [ "LOOKUP_METHOD", "app.route" ], [ "CALL_METHOD", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "db" ], [ "LOAD_ATTR", "db.provide_session" ], [ "CALL_FUNCTION", "db.provide_session" ], [ "CALL_FUNCTION", "app.route('/api/body_hashes_present/', methods=['POST'])" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.argv" ], [ "BINARY_SUBSCR", "sys.argv[1:]" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "main" ], [ "CALL_FUNCTION", "main()" ], [ "LOAD_GLOBAL", "db" ], [ "LOOKUP_METHOD", "db.all_file_paths" ], [ "CALL_METHOD", "db.all_file_paths()" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .order_by(Call.start_time.desc())[:100]" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "recent_calls" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "CALL_FUNCTION", "is_ipython_cell(row.file)" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.file" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n )" ], [ "LOOKUP_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_FAST", "row" ], [ "CALL_METHOD", "files.setdefault(\n row.file, OrderedDict()\n ).setdefault(\n row.name, row\n )" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "files" ], [ "LOOKUP_METHOD", "files.setdefault" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "CALL_METHOD", "files.setdefault(\n path, OrderedDict()\n )" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_GLOBAL", "short_path" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "partial(short_path, all_paths=all_paths)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "short" ], [ "LOAD_FAST", "files" ], [ "CALL_FUNCTION", "render_template('index.html',\n short=short,\n files=files)" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path)\n .subquery('filtered_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time)" ], [ "LOOKUP_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label" ], [ "CALL_METHOD", "sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n )" ], [ "LOOKUP_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery" ], [ "CALL_METHOD", "session.query(\n filtered_calls.c.name,\n sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime')\n ).group_by(\n filtered_calls.c.name,\n ).subquery('latest_calls')" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_FAST", "filtered_calls" ], [ "CALL_METHOD", "session.query(filtered_calls)" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOOKUP_METHOD", "sqlalchemy.and_" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.name" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.name" ], [ "COMPARE_OP", "filtered_calls.c.name == latest_calls.c.name" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOAD_FAST", "latest_calls" ], [ "LOAD_ATTR", "latest_calls.c" ], [ "LOAD_ATTR", "latest_calls.c.maxtime" ], [ "COMPARE_OP", "filtered_calls.c.start_time == latest_calls.c.maxtime" ], [ "CALL_METHOD", "sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n )" ], [ "LOOKUP_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by" ], [ "LOAD_FAST", "filtered_calls" ], [ "LOAD_ATTR", "filtered_calls.c" ], [ "LOAD_ATTR", "filtered_calls.c.start_time" ], [ "LOOKUP_METHOD", "filtered_calls.c.start_time.desc" ], [ "CALL_METHOD", "filtered_calls.c.start_time.desc()" ], [ "CALL_METHOD", "session.query(filtered_calls).join(\n latest_calls,\n sqlalchemy.and_(\n filtered_calls.c.name == latest_calls.c.name,\n filtered_calls.c.start_time == latest_calls.c.maxtime,\n )\n ).order_by(filtered_calls.c.start_time.desc())" ], [ "LOAD_GLOBAL", "group_by_attr" ], [ "LOAD_FAST", "query" ], [ "CALL_FUNCTION", "group_by_attr(query, 'type')" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.name" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.type" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)" ], [ "LOOKUP_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct" ], [ "CALL_METHOD", "session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct()" ], [ "CALL_FUNCTION", "sorted(session.query(Function.name, Function.type)\n .filter_by(file=path)\n .distinct())" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "all_funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.name" ], [ "LOAD_FAST", "func_names" ], [ "COMPARE_OP", "func.name not in func_names" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.type" ], [ "BINARY_SUBSCR", "funcs[func.type]" ], [ "LOOKUP_METHOD", "funcs[func.type].append" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "funcs[func.type].append(func)" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "funcs" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "CALL_FUNCTION", "render_template('file.html',\n funcs=funcs,\n is_ipython=path == IPYTHON_FILE_PATH,\n full_path=path,\n short_path=basename(path))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.name" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 200)" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "BINARY_SUBSCR", "query[0]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(Function)" ], [ "LOOKUP_METHOD", "session.query(Function).filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(Function).filter_by(file=path, name=func_name)" ], [ "BINARY_SUBSCR", "session.query(Function).filter_by(file=path, name=func_name)[0]" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "basename(path)" ], [ "LOAD_FAST", "calls" ], [ "CALL_FUNCTION", "render_template('function.html',\n func=func,\n short_path=basename(path),\n calls=calls)" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "LOAD_GLOBAL", "fix_abs_path" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "fix_abs_path(path)" ], [ "LOAD_GLOBAL", "get_calls" ], [ "LOAD_FAST", "session" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_FUNCTION", "get_calls(session, path, func_name, 1)" ], [ "BINARY_SUBSCR", "get_calls(session, path, func_name, 1)[0]" ], [ "LOAD_GLOBAL", "jsonify" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "LOAD_GLOBAL", "url_for" ], [ "LOAD_GLOBAL", "call_view" ], [ "LOAD_ATTR", "call_view.__name__" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.id" ], [ "CALL_FUNCTION", "url_for(call_view.__name__,\n call_id=call.id)" ], [ "CALL_FUNCTION", "dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n )" ], [ "CALL_FUNCTION", "jsonify(dict(\n id=call.id,\n url=url_for(call_view.__name__,\n call_id=call.id),\n ))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.basic_columns" ], [ "BINARY_ADD", "Call.basic_columns + Function.basic_columns" ], [ "CALL_FUNCTION_VAR", "session.query(*(Call.basic_columns + Function.basic_columns))" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "func_name" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)" ], [ "LOOKUP_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())" ], [ "LOAD_FAST", "limit" ], [ "BINARY_SUBSCR", "session.query(*(Call.basic_columns + Function.basic_columns))\n .join(Function)\n .filter_by(file=path, name=func_name)\n .order_by(Call.start_time.desc())[:limit]" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "template" ], [ "LOAD_GLOBAL", "basename" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.file" ], [ "CALL_FUNCTION", "basename(func.file)" ], [ "LOAD_FAST", "call" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "render_template(template,\n short_path=basename(func.file),\n call=call,\n func=func)" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'call.html')" ], [ "LOAD_GLOBAL", "base_call_view" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "base_call_view(call_id, 'ipython_call.html')" ], [ "LOAD_GLOBAL", "render_template" ], [ "LOAD_FAST", "call_id" ], [ "CALL_FUNCTION", "render_template('ipython_iframe.html',\n container_id='1234',\n port=7777,\n call_id=call_id)" ], [ "LOAD_GLOBAL", "request" ], [ "LOAD_ATTR", "request.environ" ], [ "LOOKUP_METHOD", "request.environ.get" ], [ "CALL_METHOD", "request.environ.get('werkzeug.server.shutdown')" ], [ "LOAD_FAST", "func" ], [ "COMPARE_OP", "func is None" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "CALL_FUNCTION", "RuntimeError('Not running with the Werkzeug Server')" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "func()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Call)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by" ], [ "LOAD_FAST", "call_id" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id)" ], [ "LOOKUP_METHOD", "session.query(Call).filter_by(id=call_id).one" ], [ "CALL_METHOD", "session.query(Call).filter_by(id=call_id).one()" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.function" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.parsed_data" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_FAST", "call" ], [ "CALL_METHOD", "Call.basic_dict(call)" ], [ "CALL_FUNCTION_KW", "dict(data=call.parsed_data, **Call.basic_dict(call))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.parsed_data" ], [ "LOAD_GLOBAL", "Function" ], [ "LOOKUP_METHOD", "Function.basic_dict" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "Function.basic_dict(func)" ], [ "CALL_FUNCTION_KW", "dict(data=func.parsed_data, **Function.basic_dict(func))" ], [ "CALL_FUNCTION", "dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func)))" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n call=dict(data=call.parsed_data, **Call.basic_dict(call)),\n function=dict(data=func.parsed_data, **Function.basic_dict(func))))" ], [ "LOAD_FAST", "session" ], [ "LOAD_ATTR", "session.query" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.basic_columns" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.data" ], [ "BINARY_ADD", "Call.basic_columns + (Function.data,)" ], [ "CALL_FUNCTION_VAR", "session.query(*Call.basic_columns + (Function.data,))" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join" ], [ "LOAD_GLOBAL", "Function" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by" ], [ "LOAD_FAST", "body_hash" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)" ], [ "LOOKUP_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.start_time" ], [ "LOOKUP_METHOD", "Call.start_time.desc" ], [ "CALL_METHOD", "Call.start_time.desc()" ], [ "CALL_METHOD", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())" ], [ "BINARY_SUBSCR", "session.query(*Call.basic_columns + (Function.data,))\n .join(Function)\n .filter_by(body_hash=body_hash)\n .order_by(Call.start_time.desc())[:200]" ], [ "LOAD_FAST", "query" ], [ "LOAD_FAST", "query" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "function_data_set" ], [ "LOAD_GLOBAL", "json" ], [ "LOOKUP_METHOD", "json.loads" ], [ "LOAD_DEREF", "function_data" ], [ "CALL_METHOD", "json.loads(function_data)" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "ranges" ], [ "CALL_FUNCTION", "add('node_ranges', ranges)" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "add" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "CALL_FUNCTION", "add('loop_ranges', current_loop_ranges)" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "COMPARE_OP", "loop_ranges in (set(), current_loop_ranges)" ], [ "LOAD_FAST", "current_loop_ranges" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "calls" ], [ "LOAD_FAST", "ranges" ], [ "LOAD_FAST", "loop_ranges" ], [ "CALL_FUNCTION", "dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges)" ], [ "CALL_METHOD", "DecentJSONEncoder().encode(dict(\n calls=calls, ranges=ranges, loop_ranges=loop_ranges))" ], [ "LOAD_GLOBAL", "Call" ], [ "LOOKUP_METHOD", "Call.basic_dict" ], [ "LOAD_GLOBAL", "withattrs" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_FUNCTION", "Call()" ], [ "LOAD_FAST", "row" ], [ "LOOKUP_METHOD", "row._asdict" ], [ "CALL_METHOD", "row._asdict()" ], [ "CALL_FUNCTION_KW", "withattrs(Call(), **row._asdict())" ], [ "CALL_METHOD", "Call.basic_dict(withattrs(Call(), **row._asdict()))" ], [ "LOAD_FAST", "row" ], [ "LOAD_ATTR", "row.data" ], [ "LOAD_DEREF", "function_data" ], [ "LOAD_FAST", "key" ], [ "BINARY_SUBSCR", "function_data[key]" ], [ "LOAD_FAST", "ranges_set" ], [ "LOOKUP_METHOD", "ranges_set.add" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['start']" ], [ "LOAD_FAST", "node" ], [ "BINARY_SUBSCR", "node['end']" ], [ "CALL_METHOD", "ranges_set.add((node['start'], node['end']))" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "CALL_FUNCTION", "dict(start=start, end=end)" ], [ "LOAD_GLOBAL", "request" ], [ "LOOKUP_METHOD", "request.get_json" ], [ "CALL_METHOD", "request.get_json()" ], [ "LOAD_FAST", "session" ], [ "LOOKUP_METHOD", "session.query" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOAD_GLOBAL", "sqlalchemy" ], [ "LOAD_ATTR", "sqlalchemy.func" ], [ "LOOKUP_METHOD", "sqlalchemy.func.count" ], [ "LOAD_GLOBAL", "Call" ], [ "LOAD_ATTR", "Call.id" ], [ "CALL_METHOD", "sqlalchemy.func.count(Call.id)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin" ], [ "LOAD_GLOBAL", "Call" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "LOOKUP_METHOD", "Function.body_hash.in_" ], [ "LOAD_FAST", "hashes" ], [ "CALL_METHOD", "Function.body_hash.in_(hashes)" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))" ], [ "LOOKUP_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by" ], [ "LOAD_GLOBAL", "Function" ], [ "LOAD_ATTR", "Function.body_hash" ], [ "CALL_METHOD", "session.query(Function.body_hash, sqlalchemy.func.count(Call.id))\n .outerjoin(Call)\n .filter(Function.body_hash.in_(hashes))\n .group_by(Function.body_hash)" ], [ "LOAD_GLOBAL", "DecentJSONEncoder" ], [ "CALL_FUNCTION", "DecentJSONEncoder()" ], [ "LOOKUP_METHOD", "DecentJSONEncoder().encode" ], [ "LOAD_FAST", "query" ], [ "CALL_METHOD", "DecentJSONEncoder().encode([\n dict(hash=h, count=count)\n for h, count in query\n ])" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_FAST", "h" ], [ "LOAD_FAST", "count" ], [ "CALL_FUNCTION", "dict(hash=h, count=count)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "argv" ], [ "CALL_FUNCTION", "len(argv)" ], [ "COMPARE_OP", "len(argv) == 1" ], [ "LOAD_FAST", "argv" ], [ "BINARY_SUBSCR", "argv[0]" ], [ "LOOKUP_METHOD", "argv[0].isdigit" ], [ "CALL_METHOD", "argv[0].isdigit()" ], [ "LOAD_FAST", "argv" ], [ "LOOKUP_METHOD", "argv.insert" ], [ "CALL_METHOD", "argv.insert(0, '--port')" ], [ "LOAD_GLOBAL", "argparse" ], [ "LOOKUP_METHOD", "argparse.ArgumentParser" ], [ "CALL_METHOD", "argparse.ArgumentParser(description=\"Bird's Eye: A graphical Python debugger\")" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_METHOD", "parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int)" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.add_argument" ], [ "CALL_METHOD", "parser.add_argument('--host', help=\"HTTP host, default is 'localhost'\", default='localhost')" ], [ "LOAD_FAST", "parser" ], [ "LOOKUP_METHOD", "parser.parse_args" ], [ "LOAD_FAST", "argv" ], [ "CALL_METHOD", "parser.parse_args(argv)" ], [ "LOAD_GLOBAL", "app" ], [ "LOOKUP_METHOD", "app.run" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.port" ], [ "LOAD_FAST", "args" ], [ "LOAD_ATTR", "args.host" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.environ" ], [ "LOOKUP_METHOD", "os.environ.get" ], [ "CALL_METHOD", "os.environ.get('BIRDSEYE_RELOADER')" ], [ "COMPARE_OP", "os.environ.get('BIRDSEYE_RELOADER') == '1'" ], [ "CALL_METHOD", "app.run(\n port=args.port,\n host=args.host,\n use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1',\n )" ] ]python-executing-2.2.0/tests/sample_results/tests-py-2.7.json000066400000000000000000001726431474076367500242600ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_ATTR", "TestFile().test_file" ], [ "CALL_FUNCTION", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.foo" ], [ "LOAD_NAME", "False" ], [ "CALL_FUNCTION", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL_FUNCTION", "unittest.main()" ], [ "LOAD_NAME", "True" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_FUNCTION", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_FUNCTION", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_FUNCTION", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__)" ], [ "LOAD_ATTR", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_FUNCTION", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_FUNCTION", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_ATTR", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_FUNCTION", "qn.endswith(func.__name__)" ], [ "CALL_FUNCTION", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_FUNCTION", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_FUNCTION", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.h" ], [ "CALL_FUNCTION", "C.D.h()" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_FUNCTION", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_FUNCTION", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_NAME", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL_FUNCTION", "tempfile.mkstemp()" ], [ "LOAD_NAME", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_NAME", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_ATTR", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "outfile.write(source)" ], [ "LOAD_FAST", "code" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_FUNCTION", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "os.path.dirname(__file__)" ], [ "CALL_FUNCTION", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.code_qualname" ], [ "CALL_FUNCTION", "executing.code_qualname()" ], [ "CALL_FUNCTION", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL_FUNCTION", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text" ], [ "CALL_FUNCTION", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text_range" ], [ "CALL_FUNCTION", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "SLICE+3", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_ATTR", "inst.opname.startswith" ], [ "CALL_FUNCTION", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_FUNCTION", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_FUNCTION", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_FUNCTION", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_FUNCTION", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_FUNCTION", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_FUNCTION", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.10.json000066400000000000000000001664541474076367500243360ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOAD_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "IS_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "IS_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "IS_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.11.json000066400000000000000000003375301474076367500243320ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import tempfile" ], [ "STORE_NAME", "import time" ], [ "STORE_NAME", "import unittest" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "STORE_NAME", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_NAME", "object" ], [ "CALL", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "TestFile" ], [ "CALL", "TestFile()" ], [ "LOAD_METHOD", "TestFile().test_file" ], [ "CALL", "TestFile().test_file()" ], [ "STORE_NAME", "def f():\n def g():\n pass\n\n return g" ], [ "STORE_NAME", "def lambda_maker():\n def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator\n\n @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3\n\n return foo" ], [ "STORE_NAME", "lamb" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "STORE_NAME", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "LOAD_NAME", "Tester" ], [ "CALL", "Tester()" ], [ "STORE_NAME", "tester" ], [ "LOAD_NAME", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_METHOD", "tester.foo" ], [ "CALL", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "STORE_NAME", "def empty_decorator(func):\n return func" ], [ "STORE_NAME", "def decorator_with_args(*_, **__):\n return empty_decorator" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL", "unittest.main()" ], [ "STORE_NAME", " def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])" ], [ "STORE_NAME", " def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "STORE_NAME", " def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "STORE_NAME", " def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "STORE_NAME", " def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()" ], [ "STORE_NAME", " def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "STORE_NAME", " def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_NAME", " def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_NAME", " def test_future_import(self):\n tester(4)" ], [ "STORE_NAME", " def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)" ], [ "STORE_NAME", " def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "STORE_NAME", " def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "STORE_NAME", " def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)" ], [ "STORE_NAME", " def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))" ], [ "STORE_NAME", " def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "STORE_NAME", " def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)" ], [ "STORE_NAME", " def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "STORE_NAME", " def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)" ], [ "STORE_NAME", " def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)" ], [ "STORE_NAME", " def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([1, 2])" ], [ "CALL", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple(\n [3, 4])" ], [ "CALL", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([5, 6])" ], [ "CALL", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([7, 8])" ], [ "CALL", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123234')" ], [ "CALL", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(tester('123'), x=int())" ], [ "CALL", "empty_decorator" ], [ "STORE_FAST", " @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "{tester(x) for x in [1]}" ], [ "CALL", "{tester(y) for y in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "{tester(x) for x in [1]}" ], [ "CALL", "{tester(x) for x in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "{tester(x) for x in [1]}" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "(tester(x) for x in [1])" ], [ "CALL", "list(tester(x) for x in [1])" ], [ "CALL", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "{tester(y) for y in [1]}" ], [ "STORE_FAST", "y" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL", "tester(y)" ], [ "LOAD_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "(tester(x) for x in [1])" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "CALL", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "CALL", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "CALL", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "[tester(x) for x in tester([1, 2])]" ], [ "LOAD_FAST", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_DEREF", "x" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", " def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "LOAD_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_DEREF", "y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", " def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL", "bar()" ], [ "LOAD_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "LOAD_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+y) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "LOAD_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "STORE_DEREF", "z" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "CALL", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "LOAD_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+y) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "LOAD_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "LOAD_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_OP", "a+x+y+z" ], [ "CALL", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "CALL", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_OP", "b+x+y+z" ], [ "CALL", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "LOAD_FAST", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_OP", "c+x+y+z" ], [ "CALL", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "dict(x=tester)['x'](tester)" ], [ "CALL", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "tester(Exception)" ], [ "CALL", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_OP", "1 / 0" ], [ "CALL", "tester(1 / 0)" ], [ "CALL", " with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_FAST", " def gen():\n for x in [1, 2]:\n yield tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "gen2" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL", "gen()" ], [ "CALL", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL", "list(gen2)" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "STORE_FAST", "start" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(10000)" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "STORE_FAST", "new_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_OP", "time.time() - start" ], [ "CALL", "self.assertLess(time.time() - start, 1)" ], [ "STORE_FAST", " def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.encode(encoding)" ], [ "STORE_FAST", "encoded" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "CALL", " with self.assertRaises(exception):\n Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "STORE_FAST", "decoded" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "Source.for_filename(__file__)" ], [ "LOAD_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "STORE_FAST", "qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL", "qn.endswith(func.__name__)" ], [ "CALL", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "f()" ], [ "CALL", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_METHOD", "C.D.h" ], [ "CALL", "C.D.h()" ], [ "CALL", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL", "lambda_maker()" ], [ "STORE_FAST", "foo" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "foo()()" ], [ "CALL", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(66000)" ], [ "CALL", "list(range(66000))" ], [ "BINARY_OP", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL", "tempfile.mkstemp()" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "filename" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL", "compile(source, filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL", "open(filename, 'w')" ], [ "STORE_FAST", "outfile" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL", "outfile.write(source)" ], [ "CALL", " with open(filename, 'w') as outfile:\n outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(5)" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL", "range(n)" ], [ "CALL", "(i for i in range(n))" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", " with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "LOAD_FAST", "(i for i in range(n))" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "os.path.dirname(__file__)" ], [ "CALL", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL", "Source.for_filename(path)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "STORE_FAST", "executing" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.code_qualname" ], [ "CALL", "executing.code_qualname()" ], [ "CALL", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' not in sys.version.lower()" ], [ "STORE_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text" ], [ "CALL", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text_range" ], [ "CALL", "executing.text_range()" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", " def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.for_frame(inspect.currentframe())" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL", "compile(source.text, source.filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "STORE_FAST", "instructions" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "instructions" ], [ "STORE_FAST", "inst" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_METHOD", "inst.opname.startswith" ], [ "CALL", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def f():\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def g():\n pass" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_FAST", " def i():\n def j():\n pass\n\n return j" ], [ "LOAD_FAST", "i" ], [ "CALL", "i()" ], [ "STORE_FAST", " def j():\n pass" ], [ "LOAD_FAST", "j" ], [ "STORE_FAST", " def g():\n pass" ], [ "LOAD_FAST", "g" ], [ "STORE_FAST", " def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator" ], [ "LOAD_FAST", "assign" ], [ "CALL", "assign(lambda: 1)" ], [ "CALL", "assign(lambda: 1)" ], [ "STORE_FAST", " @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3" ], [ "LOAD_FAST", "foo" ], [ "STORE_FAST", " def decorator(func):\n func.x = x\n return func" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "STORE_NAME", " def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node" ], [ "STORE_NAME", " def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)" ], [ "STORE_NAME", " def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns" ], [ "STORE_NAME", " def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self" ], [ "STORE_NAME", " def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self" ], [ "STORE_NAME", " def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__pow__" ], [ "STORE_NAME", "__mul__" ], [ "STORE_NAME", "__sub__" ], [ "STORE_NAME", " def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self" ], [ "LOAD_NAME", "__invert__" ], [ "STORE_NAME", "__neg__" ], [ "STORE_NAME", "__pos__" ], [ "STORE_NAME", " def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self" ], [ "LOAD_NAME", "__lt__" ], [ "STORE_NAME", "__ne__" ], [ "STORE_NAME", "__ge__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL", "self.get_node(ast.Call)" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL", "self.get_node(ast.Attribute)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL", "self.get_node(ast.Subscript)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL", "self.get_node(ast.BinOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "self.get_node(ast.UnaryOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL", "self.get_node(ast.Compare)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.12.json000066400000000000000000003745101474076367500243320ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import tempfile" ], [ "STORE_NAME", "import time" ], [ "STORE_NAME", "import unittest" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "STORE_NAME", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_NAME", "object" ], [ "CALL", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "TestFile" ], [ "CALL", "TestFile()" ], [ "LOAD_ATTR", "TestFile().test_file" ], [ "CALL", "TestFile().test_file()" ], [ "STORE_NAME", "def f():\n def g():\n pass\n\n return g" ], [ "STORE_NAME", "def lambda_maker():\n def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator\n\n @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3\n\n return foo" ], [ "STORE_NAME", "lamb" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "STORE_NAME", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "LOAD_NAME", "Tester" ], [ "CALL", "Tester()" ], [ "STORE_NAME", "tester" ], [ "LOAD_NAME", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "CALL_INTRINSIC_1", "+tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.foo" ], [ "CALL", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "STORE_NAME", "def empty_decorator(func):\n return func" ], [ "STORE_NAME", "def decorator_with_args(*_, **__):\n return empty_decorator" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL", "unittest.main()" ], [ "STORE_NAME", " def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])" ], [ "STORE_NAME", " def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "STORE_NAME", " def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "STORE_NAME", " def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "STORE_NAME", " def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()" ], [ "STORE_NAME", " def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "STORE_NAME", " def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_NAME", " def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_NAME", " def test_future_import(self):\n tester(4)" ], [ "STORE_NAME", " def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)" ], [ "STORE_NAME", " def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "STORE_NAME", " def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "STORE_NAME", " def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)" ], [ "STORE_NAME", " def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))" ], [ "STORE_NAME", " def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "STORE_NAME", " def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)" ], [ "STORE_NAME", " def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "STORE_NAME", " def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)" ], [ "STORE_NAME", " def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)" ], [ "STORE_NAME", " def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([1, 2])" ], [ "CALL", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple(\n [3, 4])" ], [ "CALL", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([5, 6])" ], [ "CALL", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([7, 8])" ], [ "CALL", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123234')" ], [ "CALL", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(tester('123'), x=int())" ], [ "CALL", "empty_decorator" ], [ "STORE_FAST", " @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(y) for y in [1]}" ], [ "STORE_FAST", "y" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL", "tester(y)" ], [ "STORE_FAST", "{tester(y) for y in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "(tester(x) for x in [1])" ], [ "CALL", "list(tester(x) for x in [1])" ], [ "CALL", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(y) for y in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST", "(tester(x) for x in [1])" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "CALL", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "CALL", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_FAST", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_DEREF", "x" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", " def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_DEREF", "y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", " def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL", "bar()" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "z" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "a+x+y+z" ], [ "CALL", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "b+x+y+z" ], [ "CALL", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "c+x+y+z" ], [ "CALL", "tester(c+x+y+z)" ], [ "STORE_FAST", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "dict(x=tester)['x'](tester)" ], [ "CALL", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "tester(Exception)" ], [ "CALL", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_OP", "1 / 0" ], [ "CALL", "tester(1 / 0)" ], [ "CALL", " with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_FAST", " def gen():\n for x in [1, 2]:\n yield tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "gen2" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL", "gen()" ], [ "CALL", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL", "list(gen2)" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "STORE_FAST", "start" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(10000)" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "STORE_FAST", "new_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_OP", "time.time() - start" ], [ "CALL", "self.assertLess(time.time() - start, 1)" ], [ "STORE_FAST", " def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.encode(encoding)" ], [ "STORE_FAST", "encoded" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "CALL", " with self.assertRaises(exception):\n Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "STORE_FAST", "decoded" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "Source.for_filename(__file__)" ], [ "LOAD_ATTR", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "STORE_FAST", "qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_ATTR", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL", "qn.endswith(func.__name__)" ], [ "CALL", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "f()" ], [ "CALL", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.h" ], [ "CALL", "C.D.h()" ], [ "CALL", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL", "lambda_maker()" ], [ "STORE_FAST", "foo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "foo()()" ], [ "CALL", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(66000)" ], [ "CALL", "list(range(66000))" ], [ "BINARY_OP", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL", "tempfile.mkstemp()" ], [ "STORE_FAST", "_" ], [ "STORE_FAST", "filename" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL", "compile(source, filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL", "open(filename, 'w')" ], [ "STORE_FAST", "outfile" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_ATTR", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL", "outfile.write(source)" ], [ "CALL", " with open(filename, 'w') as outfile:\n outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(5)" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL", "range(n)" ], [ "CALL", "(i for i in range(n))" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", " with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "LOAD_FAST", "(i for i in range(n))" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "os.path.dirname(__file__)" ], [ "CALL", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL", "Source.for_filename(path)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "STORE_FAST", "executing" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.code_qualname" ], [ "CALL", "executing.code_qualname()" ], [ "CALL", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' not in sys.version.lower()" ], [ "STORE_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text" ], [ "CALL", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text_range" ], [ "CALL", "executing.text_range()" ], [ "STORE_FAST", "start" ], [ "STORE_FAST", "end" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SLICE", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", " def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.for_frame(inspect.currentframe())" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL", "compile(source.text, source.filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "STORE_FAST", "instructions" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "instructions" ], [ "STORE_FAST", "inst" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_ATTR", "inst.opname.startswith" ], [ "CALL", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def f():\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def g():\n pass" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_FAST", " def i():\n def j():\n pass\n\n return j" ], [ "LOAD_FAST", "i" ], [ "CALL", "i()" ], [ "STORE_FAST", " def j():\n pass" ], [ "LOAD_FAST", "j" ], [ "STORE_FAST", " def g():\n pass" ], [ "LOAD_FAST", "g" ], [ "STORE_FAST", " def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator" ], [ "LOAD_FAST", "assign" ], [ "CALL", "assign(lambda: 1)" ], [ "CALL", "assign(lambda: 1)" ], [ "STORE_FAST", " @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3" ], [ "LOAD_FAST", "foo" ], [ "STORE_FAST", " def decorator(func):\n func.x = x\n return func" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "STORE_NAME", " def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node" ], [ "STORE_NAME", " def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)" ], [ "STORE_NAME", " def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns" ], [ "STORE_NAME", " def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self" ], [ "STORE_NAME", " def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self" ], [ "STORE_NAME", " def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__pow__" ], [ "STORE_NAME", "__mul__" ], [ "STORE_NAME", "__sub__" ], [ "STORE_NAME", " def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self" ], [ "LOAD_NAME", "__invert__" ], [ "STORE_NAME", "__neg__" ], [ "STORE_NAME", "__pos__" ], [ "STORE_NAME", " def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self" ], [ "LOAD_NAME", "__lt__" ], [ "STORE_NAME", "__ne__" ], [ "STORE_NAME", "__ge__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL", "self.get_node(ast.Call)" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL", "self.get_node(ast.Attribute)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL", "self.get_node(ast.Subscript)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL", "self.get_node(ast.BinOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "self.get_node(ast.UnaryOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL", "self.get_node(ast.Compare)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.13.json000066400000000000000000004025561474076367500243350ustar00rootroot00000000000000[ [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "from __future__ import print_function, division" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import tempfile" ], [ "STORE_NAME", "import time" ], [ "STORE_NAME", "import unittest" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "STORE_NAME", "from executing import Source, only, PY3, NotOneValueFound, get_instructions" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", "class TestStuff(unittest.TestCase):\n\n # noinspection PyTrailingSemicolon\n def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])\n # @formatter:on\n\n def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass\n\n def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])\n # but not if everything is the same\n # noinspection PyTypeChecker\n # with self.assertRaises((AttributeError, NotOneValueFound)):\n # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}])\n\n def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )\n\n def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()\n # @formatter:on\n\n def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)\n\n def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass\n\n def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]\n\n def test_future_import(self):\n tester(4)\n\n def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)\n\n def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)\n\n def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )\n\n def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)\n\n def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))\n\n def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)\n\n def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)\n\n def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)\n\n def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)\n\n def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)\n\n def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "CALL", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "STORE_NAME", "class TestFile(unittest.TestCase):\n def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_NAME", "object" ], [ "CALL", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", "class C(object):\n @staticmethod\n def f():\n pass\n\n class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "TestFile" ], [ "CALL", "TestFile()" ], [ "LOAD_ATTR", "TestFile().test_file" ], [ "CALL", "TestFile().test_file()" ], [ "STORE_NAME", "def f():\n def g():\n pass\n\n return g" ], [ "STORE_NAME", "def lambda_maker():\n def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator\n\n @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3\n\n return foo" ], [ "STORE_NAME", "lamb" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "STORE_NAME", "class Tester(object):\n def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node\n\n def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)\n\n def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns\n\n def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self\n\n def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self\n\n def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self\n\n __pow__ = __mul__ = __sub__ = __add__\n\n def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self\n\n __neg__ = __pos__ = __invert__\n\n def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self\n\n __ne__ = __ge__ = __lt__" ], [ "LOAD_NAME", "Tester" ], [ "CALL", "Tester()" ], [ "STORE_NAME", "tester" ], [ "LOAD_NAME", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_OP", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "CALL_INTRINSIC_1", "+tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.foo" ], [ "CALL", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "STORE_NAME", "def empty_decorator(func):\n return func" ], [ "STORE_NAME", "def decorator_with_args(*_, **__):\n return empty_decorator" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL", "unittest.main()" ], [ "STORE_NAME", " def test_semicolons(self):\n # @formatter:off\n tester(1); tester(2); tester(3)\n tester(9\n ); tester(\n 8); tester(\n 99\n ); tester(33); tester([4,\n 5, 6, [\n 7]])" ], [ "STORE_NAME", " def test_decorator(self):\n @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "STORE_NAME", " def test_comprehensions(self):\n # Comprehensions can be separated if they contain different names\n str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])\n # or are on different lines\n str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])\n # or are of different types\n str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "STORE_NAME", " def test_lambda(self):\n self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )\n (lambda: (lambda: tester(1))())()\n self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "STORE_NAME", " def test_closures_and_nested_comprehensions(self):\n x = 1\n # @formatter:off\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()\n\n foo()" ], [ "STORE_NAME", " def test_indirect_call(self):\n dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "STORE_NAME", " def test_compound_statements(self):\n with self.assertRaises(TypeError):\n try:\n for _ in tester([1, 2, 3]):\n while tester(0):\n pass\n else:\n tester(4)\n else:\n tester(5)\n raise ValueError\n except tester(ValueError):\n tester(9)\n raise TypeError\n finally:\n tester(10)\n\n # PyCharm getting confused somehow?\n # noinspection PyUnreachableCode\n str()\n\n with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_NAME", " def test_generator(self):\n def gen():\n for x in [1, 2]:\n yield tester(x)\n\n gen2 = (tester(x) for x in tester([1, 2]))\n\n assert list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_NAME", " def test_future_import(self):\n tester(4)" ], [ "STORE_NAME", " def test_many_calls(self):\n node = None\n start = time.time()\n for i in range(10000):\n new_node = Source.executing(inspect.currentframe()).node\n if node is None:\n node = new_node\n else:\n self.assertIs(node, new_node)\n self.assertLess(time.time() - start, 1)" ], [ "STORE_NAME", " def test_decode_source(self):\n def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)\n\n check(u'# coding=utf8\\n\u00e9', 'utf8')\n check(u'# coding=gbk\\n\u00e9', 'gbk')\n\n check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)\n check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)\n\n # In Python 3 the default encoding is assumed to be UTF8\n if PY3:\n check(u'\u00e9', 'utf8')\n check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "STORE_NAME", " def test_multiline_strings(self):\n tester('a')\n tester('''\n ab''')\n tester('''\n abc\n def\n '''\n )\n str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])\n tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "STORE_NAME", " def test_multiple_statements_on_one_line(self):\n if tester(1): tester(2)\n for _ in tester([1, 2]): tester(3)" ], [ "STORE_NAME", " def assert_qualname(self, func, qn, check_actual_qualname=True):\n qualname = Source.for_filename(__file__).code_qualname(func.__code__)\n self.assertEqual(qn, qualname)\n if PY3 and check_actual_qualname:\n self.assertEqual(qn, func.__qualname__)\n self.assertTrue(qn.endswith(func.__name__))" ], [ "STORE_NAME", " def test_qualname(self):\n self.assert_qualname(C.f, 'C.f')\n self.assert_qualname(C.D.g, 'C.D.g')\n self.assert_qualname(f, 'f')\n self.assert_qualname(f(), 'f..g')\n self.assert_qualname(C.D.h(), 'C.D.h..i..j')\n self.assert_qualname(lamb, '')\n foo = lambda_maker()\n self.assert_qualname(foo, 'lambda_maker..foo')\n self.assert_qualname(foo.x, 'lambda_maker..')\n self.assert_qualname(foo(), 'lambda_maker..foo..')\n self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "STORE_NAME", " def test_extended_arg(self):\n source = 'tester(6)\\n%s\\ntester(9)' % list(range(66000))\n _, filename = tempfile.mkstemp()\n code = compile(source, filename, 'exec')\n with open(filename, 'w') as outfile:\n outfile.write(source)\n exec(code)" ], [ "STORE_NAME", " def test_only(self):\n for n in range(5):\n gen = (i for i in range(n))\n if n == 1:\n self.assertEqual(only(gen), 0)\n else:\n with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "STORE_NAME", " def test_invalid_python(self):\n path = os.path.join(os.path.dirname(__file__), 'not_code.txt', )\n source = Source.for_filename(path)\n self.assertIsNone(source.tree)" ], [ "STORE_NAME", " def test_executing_methods(self):\n frame = inspect.currentframe()\n executing = Source.executing(frame)\n self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')\n if 'pypy' not in sys.version.lower():\n text = 'Source.executing(frame)'\n self.assertEqual(executing.text(), text)\n start, end = executing.text_range()\n self.assertEqual(executing.source.text[start:end], text)" ], [ "STORE_NAME", " def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", " def test_attr(self):\n c = C()\n c.x = c.y = tester\n str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([1, 2])" ], [ "CALL", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple(\n [3, 4])" ], [ "CALL", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL", "int()" ], [ "CALL_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([5, 6])" ], [ "CALL", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "tuple([7, 8])" ], [ "CALL", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('123234')" ], [ "CALL_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL", "empty_decorator" ], [ "CALL", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL", "decorator_with_args(tester('123'), x=int())" ], [ "CALL", "empty_decorator" ], [ "STORE_FAST", " @empty_decorator\n @decorator_with_args(tester('123'), x=int())\n @tester(list(tuple([1, 2])), returns=empty_decorator)\n @tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(\n str(),\n x=int())\n @tester(list(tuple([5, 6])), returns=empty_decorator)\n @tester(list(tuple([7, 8])), returns=empty_decorator)\n @empty_decorator\n @decorator_with_args(tester('sdf'), x=tester('123234'))\n def foo():\n pass" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(y) for y in [1]}" ], [ "STORE_FAST", "y" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL", "tester(y)" ], [ "STORE_FAST", "{tester(y) for y in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "CALL", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST_AND_CLEAR", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "(tester(x) for x in [1])" ], [ "CALL", "list(tester(x) for x in [1])" ], [ "CALL", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(y) for y in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "STORE_FAST", "{tester(x) for x in [1]}" ], [ "LOAD_FAST", "(tester(x) for x in [1])" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "CALL", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "CALL", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "STORE_FAST", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_FAST", "[tester(x) for x in tester([1, 2])]" ], [ "STORE_DEREF", "x" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", " def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()" ], [ "STORE_FAST", " def foo():\n y = 2\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n\n bar()" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_DEREF", "y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", " def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", " def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", " def bar():\n z = 3\n str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})\n str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL", "bar()" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "z" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "CALL", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "CALL", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "CALL", "tester(c+x)" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+y" ], [ "CALL", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+y" ], [ "CALL", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+y" ], [ "CALL", "tester(c+y)" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "CALL", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "CALL", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "CALL", "tester(c+x+y)" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([5, 6])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "a" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "a+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "a+x+y+z" ], [ "CALL", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([3, 4])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "LOAD_FAST_AND_CLEAR", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "b" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "b+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "b+x+y+z" ], [ "CALL", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "LOAD_FAST_AND_CLEAR", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_OP", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_OP", "c+x+y" ], [ "LOAD_FAST", "z" ], [ "BINARY_OP", "c+x+y+z" ], [ "CALL", "tester(c+x+y+z)" ], [ "STORE_FAST", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "CALL", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "STORE_FAST", "{tester(c+x) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(c+x+y+z) for c in tester([1, 2])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "STORE_FAST", "{tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "dict(x=tester)['x'](tester)" ], [ "CALL_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2, 3])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "tester(Exception)" ], [ "CALL", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_OP", "1 / 0" ], [ "CALL", "tester(1 / 0)" ], [ "CALL", " with self.assertRaises(tester(Exception)):\n if tester(0):\n pass\n elif tester(0):\n pass\n elif tester(1 / 0):\n pass" ], [ "STORE_FAST", " def gen():\n for x in [1, 2]:\n yield tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "CALL", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "gen2" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL", "gen()" ], [ "CALL", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL", "list(gen2)" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "COMPARE_OP", "list(gen()) == list(gen2) == [1, 2]" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_FAST", "(tester(x) for x in tester([1, 2]))" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(4)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "STORE_FAST", "start" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(10000)" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "STORE_FAST", "new_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIs" ], [ "CALL", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_OP", "time.time() - start" ], [ "CALL", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", " def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)" ], [ "STORE_FAST", " def check(source, encoding, exception=None, matches=True):\n encoded = source.encode(encoding)\n if exception:\n with self.assertRaises(exception):\n Source.decode_source(encoded)\n else:\n decoded = Source.decode_source(encoded)\n if matches:\n self.assertEqual(decoded, source)\n else:\n self.assertNotEqual(decoded, source)" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL", "source.encode(encoding)" ], [ "STORE_FAST", "encoded" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "CALL", " with self.assertRaises(exception):\n Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL", "Source.decode_source(encoded)" ], [ "STORE_FAST", "decoded" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertNotEqual" ], [ "CALL", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester([1, 2])" ], [ "STORE_FAST", "_" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "Source.for_filename(__file__)" ], [ "LOAD_ATTR", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "STORE_FAST", "qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_ATTR", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL", "qn.endswith(func.__name__)" ], [ "CALL", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL", "f()" ], [ "CALL", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.h" ], [ "CALL", "C.D.h()" ], [ "CALL", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL", "lambda_maker()" ], [ "STORE_FAST", "foo" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL", "foo()" ], [ "CALL", "foo()()" ], [ "CALL_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(66000)" ], [ "CALL", "list(range(66000))" ], [ "BINARY_OP", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "CALL", "compile(source, filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL", "open(filename, 'w')" ], [ "STORE_FAST", "outfile" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_ATTR", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL", "outfile.write(source)" ], [ "CALL", " with open(filename, 'w') as outfile:\n outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL", "range(5)" ], [ "STORE_FAST", "n" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL", "range(n)" ], [ "CALL", "(i for i in range(n))" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL", "only(gen)" ], [ "CALL", " with self.assertRaises(NotOneValueFound):\n only(gen)" ], [ "LOAD_FAST", "(i for i in range(n))" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL", "os.path.dirname(__file__)" ], [ "CALL", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "STORE_FAST", "path" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL", "Source.for_filename(path)" ], [ "STORE_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "STORE_FAST", "executing" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.code_qualname" ], [ "CALL", "executing.code_qualname()" ], [ "CALL", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' not in sys.version.lower()" ], [ "STORE_FAST", "text" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text" ], [ "CALL", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text_range" ], [ "CALL", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "BINARY_SLICE", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "STORE_NAME", " def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "STORE_NAME", " def test_file(self):\n source = Source.for_frame(inspect.currentframe())\n code = compile(source.text, source.filename, 'exec')\n instructions = get_instructions(code)\n lineno = None\n for inst in instructions:\n if inst.starts_line is not None:\n lineno = inst.starts_line\n if not inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')):\n continue\n frame = C()\n frame.f_lasti = inst.offset\n frame.f_code = code\n frame.f_globals = globals()\n frame.f_lineno = lineno\n print(inst.opname)\n assert Source.executing(frame).node is not None" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "CALL", "Source.for_frame(inspect.currentframe())" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL", "compile(source.text, source.filename, 'exec')" ], [ "STORE_FAST", "code" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL", "get_instructions(code)" ], [ "STORE_FAST", "instructions" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "instructions" ], [ "STORE_FAST", "inst" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "STORE_FAST", "lineno" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_ATTR", "inst.opname.startswith" ], [ "CALL", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL", "C()" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def f():\n pass" ], [ "LOAD_NAME", "object" ], [ "CALL", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", " class D(object):\n @staticmethod\n def g():\n pass\n\n @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def g():\n pass" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_NAME", " @staticmethod\n def h():\n def i():\n def j():\n pass\n\n return j\n\n return i()" ], [ "STORE_FAST", " def i():\n def j():\n pass\n\n return j" ], [ "LOAD_FAST", "i" ], [ "CALL", "i()" ], [ "STORE_FAST", " def j():\n pass" ], [ "LOAD_FAST", "j" ], [ "STORE_FAST", " def g():\n pass" ], [ "LOAD_FAST", "g" ], [ "STORE_FAST", " def assign(x):\n def decorator(func):\n func.x = x\n return func\n\n return decorator" ], [ "LOAD_FAST", "assign" ], [ "CALL", "assign(lambda: 1)" ], [ "CALL", "assign(lambda: 1)" ], [ "STORE_FAST", " @assign(lambda: 1)\n def foo():\n return lambda: lambda: 3" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", " def decorator(func):\n func.x = x\n return func" ], [ "STORE_FAST", " def decorator(func):\n func.x = x\n return func" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "STORE_NAME", " def get_node(self, typ):\n frame = inspect.currentframe().f_back.f_back\n Source.lazycache(frame)\n node = Source.executing(frame).node\n assert isinstance(node, typ), (node, typ)\n return node" ], [ "STORE_NAME", " def check(self, node, value):\n frame = inspect.currentframe().f_back.f_back\n result = eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )\n assert result == value, (result, value)" ], [ "STORE_NAME", " def __call__(self, arg, check_func=True, returns=None):\n call = self.get_node(ast.Call)\n self.check(call.args[0], arg)\n if check_func:\n self.check(call.func, self)\n if returns is None:\n return arg\n return returns" ], [ "STORE_NAME", " def __getattr__(self, item):\n node = self.get_node(ast.Attribute)\n self.check(node.value, self)\n assert node.attr == item\n return self" ], [ "STORE_NAME", " def __getitem__(self, item):\n node = self.get_node(ast.Subscript)\n self.check(node.value, self)\n self.check(node.slice.value, item)\n return self" ], [ "STORE_NAME", " def __add__(self, other):\n node = self.get_node(ast.BinOp)\n self.check(node.left, self)\n self.check(node.right, other)\n return self" ], [ "LOAD_NAME", "__add__" ], [ "STORE_NAME", "__pow__" ], [ "STORE_NAME", "__mul__" ], [ "STORE_NAME", "__sub__" ], [ "STORE_NAME", " def __invert__(self):\n node = self.get_node(ast.UnaryOp)\n self.check(node.operand, self)\n return self" ], [ "LOAD_NAME", "__invert__" ], [ "STORE_NAME", "__neg__" ], [ "STORE_NAME", "__pos__" ], [ "STORE_NAME", " def __lt__(self, other):\n node = self.get_node(ast.Compare)\n self.check(node.left, self)\n self.check(node.comparators[0], other)\n return self" ], [ "LOAD_NAME", "__lt__" ], [ "STORE_NAME", "__ne__" ], [ "STORE_NAME", "__ge__" ], [ "STORE_NAME", "__ge__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "CALL", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "STORE_FAST", "result" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL", "self.get_node(ast.Call)" ], [ "STORE_FAST", "call" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL", "self.get_node(ast.Attribute)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL", "self.get_node(ast.Subscript)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL", "self.get_node(ast.BinOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL", "self.get_node(ast.UnaryOp)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL", "self.get_node(ast.Compare)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.5.json000066400000000000000000001663451474076367500242610ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_ATTR", "TestFile().test_file" ], [ "CALL_FUNCTION", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.foo" ], [ "CALL_FUNCTION", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL_FUNCTION", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_FUNCTION", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_FUNCTION", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_FUNCTION", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__)" ], [ "LOAD_ATTR", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_FUNCTION", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_FUNCTION", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_ATTR", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_FUNCTION", "qn.endswith(func.__name__)" ], [ "CALL_FUNCTION", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_FUNCTION", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_FUNCTION", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.h" ], [ "CALL_FUNCTION", "C.D.h()" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_FUNCTION", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_FUNCTION", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL_FUNCTION", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_ATTR", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_FUNCTION", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "os.path.dirname(__file__)" ], [ "CALL_FUNCTION", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.code_qualname" ], [ "CALL_FUNCTION", "executing.code_qualname()" ], [ "CALL_FUNCTION", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL_FUNCTION", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text" ], [ "CALL_FUNCTION", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text_range" ], [ "CALL_FUNCTION", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_ATTR", "inst.opname.startswith" ], [ "CALL_FUNCTION", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_FUNCTION", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_FUNCTION", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_FUNCTION", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_FUNCTION", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_FUNCTION", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_FUNCTION", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.6.json000066400000000000000000001664141474076367500242570ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_ATTR", "TestFile().test_file" ], [ "CALL_FUNCTION", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.foo" ], [ "CALL_FUNCTION", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.main" ], [ "CALL_FUNCTION", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_FUNCTION", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_FUNCTION", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_FUNCTION", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_ATTR", "time.time" ], [ "CALL_FUNCTION", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_FUNCTION", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_FUNCTION", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_FUNCTION", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_FUNCTION", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__)" ], [ "LOAD_ATTR", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_FUNCTION", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_FUNCTION", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_FUNCTION", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_ATTR", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_FUNCTION", "qn.endswith(func.__name__)" ], [ "CALL_FUNCTION", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_FUNCTION", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_FUNCTION", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.h" ], [ "CALL_FUNCTION", "C.D.h()" ], [ "CALL_FUNCTION", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_FUNCTION", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_FUNCTION", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_ATTR", "tempfile.mkstemp" ], [ "CALL_FUNCTION", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_ATTR", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_FUNCTION", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_FUNCTION", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_FUNCTION", "os.path.dirname(__file__)" ], [ "CALL_FUNCTION", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_FUNCTION", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.code_qualname" ], [ "CALL_FUNCTION", "executing.code_qualname()" ], [ "CALL_FUNCTION", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL_FUNCTION", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text" ], [ "CALL_FUNCTION", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.text_range" ], [ "CALL_FUNCTION", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_FUNCTION", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "CALL_FUNCTION", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_ATTR", "inst.opname.startswith" ], [ "CALL_FUNCTION", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.currentframe" ], [ "CALL_FUNCTION", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_FUNCTION", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_FUNCTION", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_FUNCTION", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_FUNCTION", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_FUNCTION", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_FUNCTION", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_FUNCTION", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_FUNCTION", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_FUNCTION", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.7.json000066400000000000000000001664141474076367500242600ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOAD_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.8.json000066400000000000000000001664141474076367500242610ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOAD_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-py-3.9.json000066400000000000000000001664551474076367500242670ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOAD_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "IS_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOAD_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION_KW", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION_KW", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION_KW", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION_KW", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION_KW", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "IS_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOAD_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION_KW", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION_KW", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION_KW", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOAD_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOAD_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOAD_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_FUNCTION_KW", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOAD_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOAD_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOAD_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "IS_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOAD_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "IS_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "IS_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-pypy-2.7.json000066400000000000000000001730771474076367500246330ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOOKUP_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOOKUP_METHOD", "tester.foo" ], [ "LOAD_NAME", "False" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOOKUP_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_NAME", "True" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOOKUP_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOOKUP_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOOKUP_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_NAME", "list" ], [ "LOAD_NAME", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_NAME", "tempfile" ], [ "LOOKUP_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_NAME", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_NAME", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOOKUP_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_FAST", "code" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "SLICE+3", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOOKUP_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "True" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-pypy-3.5.json000066400000000000000000001666011474076367500246250ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOOKUP_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOOKUP_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOOKUP_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOOKUP_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOOKUP_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOOKUP_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_METHOD", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOOKUP_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOOKUP_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOOKUP_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tests-pypy-3.6.json000066400000000000000000001666011474076367500246260ustar00rootroot00000000000000[ [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "unittest" ], [ "LOAD_ATTR", "unittest.TestCase" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "TestFile" ], [ "CALL_FUNCTION", "TestFile()" ], [ "LOOKUP_METHOD", "TestFile().test_file" ], [ "CALL_METHOD", "TestFile().test_file()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Tester" ], [ "CALL_FUNCTION", "Tester()" ], [ "LOAD_NAME", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "COMPARE_OP", "tester([1, 2, 3]) == [1, 2, 3]" ], [ "LOAD_NAME", "tester" ], [ "LOAD_ATTR", "tester.asd" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester.asd is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBSCR", "tester[19]" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester[19] is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_POWER", "tester ** 4" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester ** 4 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_MULTIPLY", "tester * 3" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester * 3 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_SUBTRACT", "tester - 2" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester - 2 is tester" ], [ "LOAD_NAME", "tester" ], [ "BINARY_ADD", "tester + 1" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester + 1 is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_NEGATIVE", "-tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "-tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_POSITIVE", "+tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "+tester is tester" ], [ "LOAD_NAME", "tester" ], [ "UNARY_INVERT", "~tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "~tester is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester < 7" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester < 7) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester >= 78" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester >= 78) is tester" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "tester != 79" ], [ "LOAD_NAME", "tester" ], [ "COMPARE_OP", "(tester != 79) is tester" ], [ "LOAD_NAME", "tester" ], [ "LOOKUP_METHOD", "tester.foo" ], [ "CALL_METHOD", "tester.foo(45, False)" ], [ "COMPARE_OP", "tester.foo(45, False) == 45" ], [ "LOAD_NAME", "__name__" ], [ "COMPARE_OP", "__name__ == '__main__'" ], [ "LOAD_NAME", "unittest" ], [ "LOOKUP_METHOD", "unittest.main" ], [ "CALL_METHOD", "unittest.main()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 8)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n 99\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(33)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([4,\n 5, 6, [\n 7]])" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123')" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([1, 2])" ], [ "CALL_FUNCTION", "list(tuple([1, 2]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple(\n [3, 4])" ], [ "CALL_FUNCTION", "list(\n tuple(\n [3, 4]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_GLOBAL", "int" ], [ "CALL_FUNCTION", "int()" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([5, 6])" ], [ "CALL_FUNCTION", "list(tuple([5, 6]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "tuple([7, 8])" ], [ "CALL_FUNCTION", "list(tuple([7, 8]))" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "LOAD_GLOBAL", "empty_decorator" ], [ "LOAD_GLOBAL", "decorator_with_args" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('sdf')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('123234')" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "decorator_with_args(tester('sdf'), x=tester('123234'))" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(list(tuple([7, 8])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([5, 6])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(\n str(),\n x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "CALL_FUNCTION", "tester(\n list(\n tuple(\n [3, 4])),\n returns=empty_decorator)" ], [ "CALL_FUNCTION", "tester(list(tuple([1, 2])), returns=empty_decorator)" ], [ "CALL_FUNCTION", "decorator_with_args(tester('123'), x=int())" ], [ "CALL_FUNCTION", "empty_decorator" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, {tester(y) for y in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]},\n {tester(x) for x in [1]}])" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "list(tester(x) for x in [1])" ], [ "CALL_FUNCTION", "str([{tester(x) for x in [1]}, list(tester(x) for x in [1])])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "y" ], [ "CALL_FUNCTION", "tester(y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "CALL_FUNCTION", "(lambda x: (tester(x), tester(x)))(tester(3))" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda x: (tester(x), tester(x)))(tester(3)),\n (3, 3),\n )" ], [ "CALL_FUNCTION", "(lambda: (lambda: tester(1))())()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "CALL_FUNCTION", "(lambda: [tester(x) for x in tester([1, 2])])()" ], [ "CALL_METHOD", "self.assertEqual(\n (lambda: [tester(x) for x in tester([1, 2])])(),\n [1, 2],\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "CALL_FUNCTION", "(lambda: tester(1))()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_FAST", "bar" ], [ "CALL_FUNCTION", "bar()" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([5, 6])" ], [ "CALL_FUNCTION", "str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])})" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "CALL_FUNCTION", "tester(a+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "CALL_FUNCTION", "tester(b+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "CALL_FUNCTION", "tester(c+x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+y" ], [ "CALL_FUNCTION", "tester(a+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+y" ], [ "CALL_FUNCTION", "tester(b+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+y" ], [ "CALL_FUNCTION", "tester(c+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "CALL_FUNCTION", "tester(a+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "CALL_FUNCTION", "tester(b+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "CALL_FUNCTION", "tester(c+x+y)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([3, 4])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "a" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "a+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "a+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "a+x+y+z" ], [ "CALL_FUNCTION", "tester(a+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "b" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "b+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "b+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "b+x+y+z" ], [ "CALL_FUNCTION", "tester(b+x+y+z)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "LOAD_DEREF", "x" ], [ "BINARY_ADD", "c+x" ], [ "LOAD_DEREF", "y" ], [ "BINARY_ADD", "c+x+y" ], [ "LOAD_DEREF", "z" ], [ "BINARY_ADD", "c+x+y+z" ], [ "CALL_FUNCTION", "tester(c+x+y+z)" ], [ "LOAD_GLOBAL", "dict" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)" ], [ "BINARY_SUBSCR", "dict(x=tester)['x']" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)" ], [ "CALL_FUNCTION", "dict(x=tester)['x'](tester)(3, check_func=False)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_METHOD", "self.assertRaises(TypeError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2, 3])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(5)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "tester(ValueError)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(9)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(10)" ], [ "LOAD_GLOBAL", "str" ], [ "CALL_FUNCTION", "str()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "tester(Exception)" ], [ "CALL_METHOD", "self.assertRaises(tester(Exception))" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(0)" ], [ "LOAD_GLOBAL", "tester" ], [ "BINARY_TRUE_DIVIDE", "1 / 0" ], [ "CALL_FUNCTION", "tester(1 / 0)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "gen()" ], [ "CALL_FUNCTION", "list(gen())" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_FAST", "gen2" ], [ "CALL_FUNCTION", "list(gen2)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tester(x)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(4)" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(10000)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.executing(inspect.currentframe())" ], [ "LOAD_ATTR", "Source.executing(inspect.currentframe()).node" ], [ "LOAD_FAST", "node" ], [ "COMPARE_OP", "node is None" ], [ "LOAD_FAST", "new_node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIs" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "new_node" ], [ "CALL_METHOD", "self.assertIs(node, new_node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertLess" ], [ "LOAD_GLOBAL", "time" ], [ "LOOKUP_METHOD", "time.time" ], [ "CALL_METHOD", "time.time()" ], [ "LOAD_FAST", "start" ], [ "BINARY_SUBTRACT", "time.time() - start" ], [ "CALL_METHOD", "self.assertLess(time.time() - start, 1)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'gbk')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "UnicodeDecodeError" ], [ "CALL_FUNCTION", "check(u'# coding=utf8\\n\u00e9', 'gbk', exception=UnicodeDecodeError)" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'# coding=gbk\\n\u00e9', 'utf8', matches=False)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'utf8')" ], [ "LOAD_FAST", "check" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "CALL_FUNCTION", "check(u'\u00e9', 'gbk', exception=SyntaxError)" ], [ "LOAD_FAST", "source" ], [ "LOOKUP_METHOD", "source.encode" ], [ "LOAD_FAST", "encoding" ], [ "CALL_METHOD", "source.encode(encoding)" ], [ "LOAD_FAST", "exception" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_FAST", "exception" ], [ "CALL_METHOD", "self.assertRaises(exception)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.decode_source" ], [ "LOAD_FAST", "encoded" ], [ "CALL_METHOD", "Source.decode_source(encoded)" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertEqual(decoded, source)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.assertNotEqual" ], [ "LOAD_FAST", "decoded" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "self.assertNotEqual(decoded, source)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('a')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n ab''')" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester('''\n abc\n def\n '''\n )" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 123\n 456\n '''\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n '''\n 345\n 456786\n '''\n )" ], [ "CALL_FUNCTION", "str([\n tester(\n '''\n 123\n 456\n '''\n ),\n tester(\n '''\n 345\n 456786\n '''\n ),\n ])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(\n [\n '''\n 123\n 456\n '''\n '''\n 345\n 456786\n '''\n ,\n '''\n 123\n 456\n ''',\n '''\n 345\n 456786\n '''\n ]\n )" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(1)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(2)" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester([1, 2])" ], [ "LOAD_GLOBAL", "tester" ], [ "CALL_FUNCTION", "tester(3)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "Source.for_filename(__file__)" ], [ "LOOKUP_METHOD", "Source.for_filename(__file__).code_qualname" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "CALL_METHOD", "Source.for_filename(__file__).code_qualname(func.__code__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "qualname" ], [ "CALL_METHOD", "self.assertEqual(qn, qualname)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_FAST", "check_actual_qualname" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "qn" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__qualname__" ], [ "CALL_METHOD", "self.assertEqual(qn, func.__qualname__)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertTrue" ], [ "LOAD_FAST", "qn" ], [ "LOOKUP_METHOD", "qn.endswith" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "CALL_METHOD", "qn.endswith(func.__name__)" ], [ "CALL_METHOD", "self.assertTrue(qn.endswith(func.__name__))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.f" ], [ "CALL_METHOD", "self.assert_qualname(C.f, 'C.f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOAD_ATTR", "C.D.g" ], [ "CALL_METHOD", "self.assert_qualname(C.D.g, 'C.D.g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_METHOD", "self.assert_qualname(f, 'f')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "f" ], [ "CALL_FUNCTION", "f()" ], [ "CALL_METHOD", "self.assert_qualname(f(), 'f..g')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "C" ], [ "LOAD_ATTR", "C.D" ], [ "LOOKUP_METHOD", "C.D.h" ], [ "CALL_METHOD", "C.D.h()" ], [ "CALL_METHOD", "self.assert_qualname(C.D.h(), 'C.D.h..i..j')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_GLOBAL", "lamb" ], [ "CALL_METHOD", "self.assert_qualname(lamb, '')" ], [ "LOAD_GLOBAL", "lambda_maker" ], [ "CALL_FUNCTION", "lambda_maker()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_METHOD", "self.assert_qualname(foo, 'lambda_maker..foo')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "LOAD_ATTR", "foo.x" ], [ "CALL_METHOD", "self.assert_qualname(foo.x, 'lambda_maker..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_METHOD", "self.assert_qualname(foo(), 'lambda_maker..foo..')" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assert_qualname" ], [ "LOAD_FAST", "foo" ], [ "CALL_FUNCTION", "foo()" ], [ "CALL_FUNCTION", "foo()()" ], [ "CALL_METHOD", "self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False)" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(66000)" ], [ "CALL_FUNCTION", "list(range(66000))" ], [ "BINARY_MODULO", "'tester(6)\\n%s\\ntester(9)' % list(range(66000))" ], [ "LOAD_GLOBAL", "tempfile" ], [ "LOOKUP_METHOD", "tempfile.mkstemp" ], [ "CALL_METHOD", "tempfile.mkstemp()" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec')" ], [ "LOAD_GLOBAL", "open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open(filename, 'w')" ], [ "LOAD_FAST", "outfile" ], [ "LOOKUP_METHOD", "outfile.write" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "outfile.write(source)" ], [ "LOAD_GLOBAL", "exec" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "exec(code)" ], [ "LOAD_GLOBAL", "range" ], [ "CALL_FUNCTION", "range(5)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "n" ], [ "CALL_FUNCTION", "range(n)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "CALL_METHOD", "self.assertEqual(only(gen), 0)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertRaises" ], [ "LOAD_GLOBAL", "NotOneValueFound" ], [ "CALL_METHOD", "self.assertRaises(NotOneValueFound)" ], [ "LOAD_GLOBAL", "only" ], [ "LOAD_FAST", "gen" ], [ "CALL_FUNCTION", "only(gen)" ], [ "LOAD_FAST", "i" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.join" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_GLOBAL", "__file__" ], [ "CALL_METHOD", "os.path.dirname(__file__)" ], [ "CALL_METHOD", "os.path.join(os.path.dirname(__file__), 'not_code.txt', )" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_filename" ], [ "LOAD_FAST", "path" ], [ "CALL_METHOD", "Source.for_filename(path)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertIsNone" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.tree" ], [ "CALL_METHOD", "self.assertIsNone(source.tree)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.code_qualname" ], [ "CALL_METHOD", "executing.code_qualname()" ], [ "CALL_METHOD", "self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods')" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' not in sys.version.lower()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text" ], [ "CALL_METHOD", "executing.text()" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.text(), text)" ], [ "LOAD_FAST", "executing" ], [ "LOOKUP_METHOD", "executing.text_range" ], [ "CALL_METHOD", "executing.text_range()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.assertEqual" ], [ "LOAD_FAST", "executing" ], [ "LOAD_ATTR", "executing.source" ], [ "LOAD_ATTR", "executing.source.text" ], [ "LOAD_FAST", "start" ], [ "LOAD_FAST", "end" ], [ "BINARY_SUBSCR", "executing.source.text[start:end]" ], [ "LOAD_FAST", "text" ], [ "CALL_METHOD", "self.assertEqual(executing.source.text[start:end], text)" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_GLOBAL", "tester" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.x" ], [ "LOAD_FAST", "c" ], [ "STORE_ATTR", "c.y" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.x" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.y" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.x" ], [ "LOAD_ATTR", "c.x.asd" ], [ "LOAD_FAST", "c" ], [ "LOAD_ATTR", "c.y" ], [ "LOAD_ATTR", "c.y.qwe" ], [ "CALL_FUNCTION", "str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe))" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "CALL_METHOD", "Source.for_frame(inspect.currentframe())" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.text" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.filename" ], [ "CALL_FUNCTION", "compile(source.text, source.filename, 'exec')" ], [ "LOAD_GLOBAL", "get_instructions" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "get_instructions(code)" ], [ "LOAD_FAST", "instructions" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "COMPARE_OP", "inst.starts_line is not None" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.starts_line" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "LOOKUP_METHOD", "inst.opname.startswith" ], [ "CALL_METHOD", "inst.opname.startswith(\n ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP'))" ], [ "LOAD_GLOBAL", "C" ], [ "CALL_FUNCTION", "C()" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.offset" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lasti" ], [ "LOAD_FAST", "code" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_code" ], [ "LOAD_GLOBAL", "globals" ], [ "CALL_FUNCTION", "globals()" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "lineno" ], [ "LOAD_FAST", "frame" ], [ "STORE_ATTR", "frame.f_lineno" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "inst" ], [ "LOAD_ATTR", "inst.opname" ], [ "CALL_FUNCTION", "print(inst.opname)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "COMPARE_OP", "Source.executing(frame).node is not None" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_FAST", "i" ], [ "CALL_FUNCTION", "i()" ], [ "LOAD_FAST", "j" ], [ "LOAD_FAST", "g" ], [ "LOAD_FAST", "assign" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "CALL_FUNCTION", "assign(lambda: 1)" ], [ "LOAD_FAST", "foo" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "x" ], [ "LOAD_FAST", "func" ], [ "STORE_ATTR", "func.x" ], [ "LOAD_FAST", "func" ], [ "LOAD_NAME", "__add__" ], [ "LOAD_NAME", "__invert__" ], [ "LOAD_NAME", "__lt__" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.lazycache" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.lazycache(frame)" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.executing" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.executing(frame)" ], [ "LOAD_ATTR", "Source.executing(frame).node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "CALL_FUNCTION", "isinstance(node, typ)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "typ" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.currentframe" ], [ "CALL_METHOD", "inspect.currentframe()" ], [ "LOAD_ATTR", "inspect.currentframe().f_back" ], [ "LOAD_ATTR", "inspect.currentframe().f_back.f_back" ], [ "LOAD_GLOBAL", "eval" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Expression" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.Expression(node)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "CALL_FUNCTION", "compile(ast.Expression(node), frame.f_code.co_filename, 'eval')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_globals" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "CALL_FUNCTION", "eval(\n compile(ast.Expression(node), frame.f_code.co_filename, 'eval'),\n frame.f_globals,\n frame.f_locals,\n )" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "COMPARE_OP", "result == value" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "CALL_METHOD", "self.get_node(ast.Call)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.args" ], [ "BINARY_SUBSCR", "call.args[0]" ], [ "LOAD_FAST", "arg" ], [ "CALL_METHOD", "self.check(call.args[0], arg)" ], [ "LOAD_FAST", "check_func" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "call" ], [ "LOAD_ATTR", "call.func" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(call.func, self)" ], [ "LOAD_FAST", "returns" ], [ "COMPARE_OP", "returns is None" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "returns" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Attribute" ], [ "CALL_METHOD", "self.get_node(ast.Attribute)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.attr" ], [ "LOAD_FAST", "item" ], [ "COMPARE_OP", "node.attr == item" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Subscript" ], [ "CALL_METHOD", "self.get_node(ast.Subscript)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.value" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.value, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.slice" ], [ "LOAD_ATTR", "node.slice.value" ], [ "LOAD_FAST", "item" ], [ "CALL_METHOD", "self.check(node.slice.value, item)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.BinOp" ], [ "CALL_METHOD", "self.get_node(ast.BinOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.right" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.right, other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.UnaryOp" ], [ "CALL_METHOD", "self.get_node(ast.UnaryOp)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.operand" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.operand, self)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Compare" ], [ "CALL_METHOD", "self.get_node(ast.Compare)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.left" ], [ "LOAD_FAST", "self" ], [ "CALL_METHOD", "self.check(node.left, self)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.check" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.comparators" ], [ "BINARY_SUBSCR", "node.comparators[0]" ], [ "LOAD_FAST", "other" ], [ "CALL_METHOD", "self.check(node.comparators[0], other)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "func" ], [ "LOAD_GLOBAL", "empty_decorator" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-2.7.json000066400000000000000000001700351474076367500243670ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_NAME", "False" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_enter_call_nodes" ], [ "CALL_FUNCTION", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_ATTR", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_FUNCTION", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_ATTR", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+2", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "ast.walk(s)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_FUNCTION", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_ATTR", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_ATTR", "kwargs.pop" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL_FUNCTION", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_ATTR", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_FUNCTION", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.pop" ], [ "CALL_FUNCTION", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_FUNCTION", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "UNARY_NOT", "not isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_FUNCTION", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.pop" ], [ "CALL_FUNCTION", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_FUNCTION", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "UNARY_NOT", "not exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_FUNCTION", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_FUNCTION", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_FUNCTION", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.reverse" ], [ "CALL_FUNCTION", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.10.json000066400000000000000000001633031474076367500244420ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "IS_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "IS_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "IS_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "IS_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "IS_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "CONTAINS_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "CONTAINS_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "CONTAINS_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.11.json000066400000000000000000004227171474076367500244520ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nThis module provides the generic functionality of tracing code by\nmodifying its AST. Eventually this will become a separate package.\nThis is similar to the standard library module bdb, while birdseye\nitself would correspond to pdb.\nMost of the work is in TreeTracerBase.\n\"\"\"" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from copy import deepcopy" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from itertools import takewhile" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "STORE_NAME", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "STORE_NAME", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "STORE_NAME", "EnterCallInfo" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "STORE_NAME", "ExitCallInfo" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('ChangeValue', 'value')" ], [ "STORE_NAME", "ChangeValue" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "STORE_NAME", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "CALL", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_NAME", "object" ], [ "CALL", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "def ancestors(node):\n # type: (ast.AST) -> Iterator[ast.AST]\n while True:\n try:\n node = node.parent\n except AttributeError:\n break\n yield node" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "STORE_NAME", "Loop" ], [ "STORE_NAME", "def loops(node):\n # type: (ast.AST) -> Tuple[Loop, ...]\n \"\"\"\n Return all the 'enclosing loops' of a node, up to the innermost class or\n function definition. This also includes the 'for in' clauses in list/dict/set/generator\n comprehensions. So for example, in this code:\n\n for x in ...:\n def foo():\n while True:\n print([z for y in ...])\n\n The loops enclosing the node 'z' are 'while True' and 'for y in ...', in that order.\n \"\"\"\n result = []\n while True:\n try:\n parent = node.parent\n except AttributeError:\n break\n if isinstance(parent, ast.FunctionDef):\n break\n\n is_containing_loop = (((isinstance(parent, ast.For) and parent.iter is not node or\n isinstance(parent, ast.While))\n and node not in parent.orelse) or\n (isinstance(parent, ast.comprehension) and node in parent.ifs))\n if is_containing_loop:\n result.append(parent)\n\n elif isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp)):\n generators = parent.generators\n if node in generators:\n generators = list(takewhile(lambda n: n != node, generators))\n result.extend(reversed(generators))\n\n node = parent\n\n result.reverse()\n return tuple(result)" ], [ "STORE_NAME", "\"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"" ], [ "STORE_NAME", "is_ipython_cell" ], [ "STORE_NAME", " def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename" ], [ "STORE_NAME", " def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True" ], [ "STORE_NAME", " def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OP", "ast.PyCF_ONLY_AST | flags" ], [ "CALL", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL", "tracer.parse_extra(self.root, source, filename)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_enter_call_nodes" ], [ "CALL", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "deepcopy(self.root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL", "_NodeVisitor()" ], [ "LOAD_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL", "_NodeVisitor().visit(new_root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "ast.walk(self.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL", "enumerate(self.root.body)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL", "ast.walk(s)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "STORE_NAME", "\"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "STORE_NAME", "\"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)" ], [ "STORE_NAME", " def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func" ], [ "STORE_NAME", " def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator" ], [ "STORE_NAME", " def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame" ], [ "STORE_NAME", " def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)" ], [ "STORE_NAME", " def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node" ], [ "STORE_NAME", " def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value" ], [ "STORE_NAME", " def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "STORE_NAME", " def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "STORE_NAME", " def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "CALL", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "LOAD_FAST", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL", "partial(f, traced_file)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "filename" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL", "is_ipython_cell(filename)" ], [ "STORE_FAST", "from IPython import get_ipython" ], [ "STORE_FAST", "import linecache" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "STORE_FAST", "flags" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL", "''.join(linecache.cache[filename][2])" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "self.compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "STORE_DEREF", "code_options" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "STORE_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "STORE_FAST", "matches" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "STORE_FAST", " def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "self.trace_function(actual_func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "wraps(actual_func)" ], [ "CALL", "wraps(actual_func)" ], [ "STORE_FAST", " @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_METHOD", "kwargs.pop" ], [ "CALL", "kwargs.pop('trace_call', False)" ], [ "STORE_FAST", "trace_call" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "f" ], [ "LOAD_DEREF", "actual_func" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL", "sys._getframe(2)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.secondary_to_main_frames.get(frame)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "original_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL", "ancestors(node)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.stmt, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.expr, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._after_expr(node, frame, value, None, None)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.pop" ], [ "CALL", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL", "self._get_caller_stuff(current_frame)" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL", "self.secondary_to_main_frames.get(caller_frame)" ], [ "STORE_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "STORE_FAST", "caller_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "STORE_NAME", "\"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"" ], [ "STORE_NAME", " def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)" ], [ "STORE_NAME", " def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker" ], [ "STORE_NAME", " def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'Starred', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "STORE_FAST", "before_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "STORE_FAST", "after_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "STORE_FAST", "context_expr" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL", "ast.Num(node._tree_index)" ], [ "CALL", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame" ], [ "STORE_NAME", " def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.pop" ], [ "CALL", "frame_info.statement_stack.pop()" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "IS_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "STORE_FAST", "return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "IS_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "STORE_FAST", "exiting" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer._get_caller_stuff(frame)" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "STORE_FAST", "secondary_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "DELETE_SUBSCR", "self.tracer.secondary_to_main_frames[secondary_frame]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "IS_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "CONTAINS_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "CONTAINS_OP", "node in parent.ifs" ], [ "STORE_FAST", "is_containing_loop" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "STORE_FAST", "generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "CONTAINS_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL", "takewhile(lambda n: n != node, generators)" ], [ "CALL", "list(takewhile(lambda n: n != node, generators))" ], [ "STORE_FAST", "generators" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL", "reversed(generators)" ], [ "CALL", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "STORE_DEREF", "node" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.reverse" ], [ "CALL", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.12.json000066400000000000000000004231511474076367500244440ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nThis module provides the generic functionality of tracing code by\nmodifying its AST. Eventually this will become a separate package.\nThis is similar to the standard library module bdb, while birdseye\nitself would correspond to pdb.\nMost of the work is in TreeTracerBase.\n\"\"\"" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from copy import deepcopy" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from itertools import takewhile" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "STORE_NAME", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "STORE_NAME", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "STORE_NAME", "EnterCallInfo" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "STORE_NAME", "ExitCallInfo" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('ChangeValue', 'value')" ], [ "STORE_NAME", "ChangeValue" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "STORE_NAME", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "CALL", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_NAME", "object" ], [ "CALL", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "def ancestors(node):\n # type: (ast.AST) -> Iterator[ast.AST]\n while True:\n try:\n node = node.parent\n except AttributeError:\n break\n yield node" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "STORE_NAME", "Loop" ], [ "STORE_NAME", "def loops(node):\n # type: (ast.AST) -> Tuple[Loop, ...]\n \"\"\"\n Return all the 'enclosing loops' of a node, up to the innermost class or\n function definition. This also includes the 'for in' clauses in list/dict/set/generator\n comprehensions. So for example, in this code:\n\n for x in ...:\n def foo():\n while True:\n print([z for y in ...])\n\n The loops enclosing the node 'z' are 'while True' and 'for y in ...', in that order.\n \"\"\"\n result = []\n while True:\n try:\n parent = node.parent\n except AttributeError:\n break\n if isinstance(parent, ast.FunctionDef):\n break\n\n is_containing_loop = (((isinstance(parent, ast.For) and parent.iter is not node or\n isinstance(parent, ast.While))\n and node not in parent.orelse) or\n (isinstance(parent, ast.comprehension) and node in parent.ifs))\n if is_containing_loop:\n result.append(parent)\n\n elif isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp)):\n generators = parent.generators\n if node in generators:\n generators = list(takewhile(lambda n: n != node, generators))\n result.extend(reversed(generators))\n\n node = parent\n\n result.reverse()\n return tuple(result)" ], [ "STORE_NAME", "\"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"" ], [ "STORE_NAME", "is_ipython_cell" ], [ "STORE_NAME", " def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename" ], [ "STORE_NAME", " def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True" ], [ "STORE_NAME", " def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OP", "ast.PyCF_ONLY_AST | flags" ], [ "CALL", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL", "tracer.parse_extra(self.root, source, filename)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_enter_call_nodes" ], [ "CALL", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "deepcopy(self.root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL", "_NodeVisitor()" ], [ "LOAD_ATTR", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL", "_NodeVisitor().visit(new_root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "ast.walk(self.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_ATTR", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL", "enumerate(self.root.body)" ], [ "STORE_FAST", "i" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "self.root.body[:i + 1]" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL", "ast.walk(s)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "STORE_NAME", "\"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "STORE_NAME", "\"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)" ], [ "STORE_NAME", " def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func" ], [ "STORE_NAME", " def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator" ], [ "STORE_NAME", " def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame" ], [ "STORE_NAME", " def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)" ], [ "STORE_NAME", " def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node" ], [ "STORE_NAME", " def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value" ], [ "STORE_NAME", " def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "STORE_NAME", " def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "STORE_NAME", " def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_FAST_AND_CLEAR", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "partial(f, traced_file)" ], [ "STORE_FAST", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_FAST", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "filename" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL", "is_ipython_cell(filename)" ], [ "STORE_FAST", "from IPython import get_ipython" ], [ "STORE_FAST", "import linecache" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "STORE_FAST", "flags" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL", "''.join(linecache.cache[filename][2])" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL", "self.compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "STORE_DEREF", "code_options" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "STORE_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_ATTR", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "STORE_FAST", "matches" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "STORE_FAST", " def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "self.trace_function(actual_func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "wraps(actual_func)" ], [ "CALL", "wraps(actual_func)" ], [ "STORE_FAST", " @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_ATTR", "kwargs.pop" ], [ "CALL", "kwargs.pop('trace_call', False)" ], [ "STORE_FAST", "trace_call" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "f" ], [ "LOAD_DEREF", "actual_func" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL", "sys._getframe(2)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.secondary_to_main_frames.get(frame)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "original_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL", "ancestors(node)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_ATTR", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.stmt, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.expr, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._after_expr(node, frame, value, None, None)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.pop" ], [ "CALL", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL", "self._get_caller_stuff(current_frame)" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL", "self.secondary_to_main_frames.get(caller_frame)" ], [ "STORE_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "STORE_FAST", "caller_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "STORE_NAME", "\"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"" ], [ "STORE_NAME", " def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)" ], [ "STORE_NAME", " def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker" ], [ "STORE_NAME", " def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'Starred', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "STORE_FAST", "before_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "STORE_FAST", "after_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "STORE_FAST", "context_expr" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL", "ast.Num(node._tree_index)" ], [ "CALL", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame" ], [ "STORE_NAME", " def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.pop" ], [ "CALL", "frame_info.statement_stack.pop()" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "IS_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "STORE_FAST", "return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "IS_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "STORE_FAST", "exiting" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer._get_caller_stuff(frame)" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "STORE_FAST", "secondary_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "DELETE_SUBSCR", "self.tracer.secondary_to_main_frames[secondary_frame]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "IS_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "CONTAINS_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "CONTAINS_OP", "node in parent.ifs" ], [ "STORE_FAST", "is_containing_loop" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "STORE_FAST", "generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "CONTAINS_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL", "takewhile(lambda n: n != node, generators)" ], [ "CALL", "list(takewhile(lambda n: n != node, generators))" ], [ "STORE_FAST", "generators" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL", "reversed(generators)" ], [ "CALL", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "STORE_DEREF", "node" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.reverse" ], [ "CALL", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL", "tuple(result)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.13.json000066400000000000000000004310531474076367500244450ustar00rootroot00000000000000[ [ "STORE_NAME", "\"\"\"\nThis module provides the generic functionality of tracing code by\nmodifying its AST. Eventually this will become a separate package.\nThis is similar to the standard library module bdb, while birdseye\nitself would correspond to pdb.\nMost of the work is in TreeTracerBase.\n\"\"\"" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from __future__ import print_function, division, absolute_import" ], [ "STORE_NAME", "from future import standard_library" ], [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL", "standard_library.install_aliases()" ], [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from collections import namedtuple, defaultdict" ], [ "STORE_NAME", "from copy import deepcopy" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from functools import partial, update_wrapper, wraps" ], [ "STORE_NAME", "from itertools import takewhile" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from types import FrameType, TracebackType, CodeType, FunctionType" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "STORE_NAME", "from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \\\n is_future_import" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "STORE_NAME", "class TracedFile(object):\n \"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"\n\n is_ipython_cell = False\n\n def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename\n\n def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True\n\n def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "STORE_NAME", "class FrameInfo(object):\n \"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"\n def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "STORE_NAME", "EnterCallInfo" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "STORE_NAME", "ExitCallInfo" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL", "namedtuple('ChangeValue', 'value')" ], [ "STORE_NAME", "ChangeValue" ], [ "LOAD_NAME", "object" ], [ "CALL", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "STORE_NAME", "class TreeTracerBase(object):\n \"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"\n\n def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}\n\n @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)\n\n def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}\n\n def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func\n\n def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator\n\n def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame\n\n def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)\n\n def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node\n\n def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value\n\n def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)\n\n def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))\n\n def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node\n\n # The methods below are hooks meant to be overridden in subclasses to take custom actions\n\n def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"\n\n def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"\n\n def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"\n\n def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"\n\n def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"\n\n def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"\n\n def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "CALL", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "class _NodeVisitor(ast.NodeTransformer):\n \"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"\n\n def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)\n\n def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker\n\n def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped\n\n @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_NAME", "object" ], [ "CALL", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "class _StmtContext(object):\n __slots__ = ('tracer', 'node', 'frame')\n\n def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame\n\n def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)\n\n def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", "def ancestors(node):\n # type: (ast.AST) -> Iterator[ast.AST]\n while True:\n try:\n node = node.parent\n except AttributeError:\n break\n yield node" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "STORE_NAME", "Loop" ], [ "STORE_NAME", "def loops(node):\n # type: (ast.AST) -> Tuple[Loop, ...]\n \"\"\"\n Return all the 'enclosing loops' of a node, up to the innermost class or\n function definition. This also includes the 'for in' clauses in list/dict/set/generator\n comprehensions. So for example, in this code:\n\n for x in ...:\n def foo():\n while True:\n print([z for y in ...])\n\n The loops enclosing the node 'z' are 'while True' and 'for y in ...', in that order.\n \"\"\"\n result = []\n while True:\n try:\n parent = node.parent\n except AttributeError:\n break\n if isinstance(parent, ast.FunctionDef):\n break\n\n is_containing_loop = (((isinstance(parent, ast.For) and parent.iter is not node or\n isinstance(parent, ast.While))\n and node not in parent.orelse) or\n (isinstance(parent, ast.comprehension) and node in parent.ifs))\n if is_containing_loop:\n result.append(parent)\n\n elif isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp)):\n generators = parent.generators\n if node in generators:\n generators = list(takewhile(lambda n: n != node, generators))\n result.extend(reversed(generators))\n\n node = parent\n\n result.reverse()\n return tuple(result)" ], [ "STORE_NAME", "\"\"\"\n An instance of this class corresponds to a single .py file.\n It contains some useful data in the following attributes:\n\n - filename: name of the source file\n - source: textual contents of the file\n - root: root of the original Abstract Syntax Tree (AST) of the source,\n where the nodes of this tree have an additional handy attribute:\n - parent: parent of the node, so this node is a child node of its parent\n - tracer: instance of TreeTracerBase\n - code: executable code object compiled from the modified AST\n \"\"\"" ], [ "STORE_NAME", "is_ipython_cell" ], [ "STORE_NAME", " def __init__(self, tracer, source, filename, flags):\n # type: (TreeTracerBase, str, str, int) -> None\n # Here the source code is parsed, modified, and compiled\n self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module\n\n self.nodes = [] # type: List[ast.AST]\n\n self.set_basic_node_attributes()\n\n new_root = tracer.parse_extra(self.root, source, filename)\n if new_root is not None:\n self.root = new_root\n\n self.set_basic_node_attributes()\n self.set_enter_call_nodes()\n\n new_root = deepcopy(self.root)\n new_root = _NodeVisitor().visit(new_root)\n\n self.code = compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags) # type: CodeType\n self.tracer = tracer\n self.source = source\n self.filename = filename" ], [ "STORE_NAME", " def set_basic_node_attributes(self):\n self.nodes = [] # type: List[ast.AST]\n for node in ast.walk(self.root): # type: ast.AST\n for child in ast.iter_child_nodes(node):\n child.parent = node\n node._tree_index = len(self.nodes)\n self.nodes.append(node)\n\n # Mark __future__ imports and anything before (i.e. module docstrings)\n # to be ignored by the AST transformer\n for i, stmt in enumerate(self.root.body):\n if is_future_import(stmt):\n for s in self.root.body[:i + 1]:\n for node in ast.walk(s):\n node._visit_ignore = True" ], [ "STORE_NAME", " def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "STORE_NAME", " def set_enter_call_nodes(self):\n for node in self.nodes:\n if isinstance(node, (ast.Module, ast.FunctionDef)):\n for stmt in node.body:\n if not is_future_import(stmt):\n stmt._enter_call_node = True\n break" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OP", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "tracer.parse_extra(self.root, source, filename)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_FAST", "new_root" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_enter_call_nodes" ], [ "CALL", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "deepcopy(self.root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL", "_NodeVisitor()" ], [ "LOAD_ATTR", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL", "_NodeVisitor().visit(new_root)" ], [ "STORE_FAST", "new_root" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "flags" ], [ "CALL_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "STORE_ATTR", "self.tracer" ], [ "STORE_ATTR", "self.source" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL", "ast.walk(self.root)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL", "ast.iter_child_nodes(node)" ], [ "STORE_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_ATTR", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "self.root.body[:i + 1]" ], [ "STORE_FAST", "s" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL", "ast.walk(s)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "STORE_FAST", "stmt" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "STORE_NAME", "\"\"\"\n Contains extra data about an execution frame.\n Can be obtained from the stack attribute of a TreeTracerBase instance\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "STORE_NAME", " def __init__(self):\n # Stack of statements currently being executed\n self.statement_stack = [] # type: List[ast.stmt]\n\n # Stack of expression nodes within the above statement that\n # the interpreter is planning on evaluating, or has just evaluated\n # in the case of the last element of the list. For example, given\n # the expression f(g(x)), the stack would be [f, g, x] before and just\n # after evaluating x, since function arguments are evaluated before the\n # actual function call.\n self.expression_stack = [] # type: List[ast.expr]\n\n # Mapping from the expression node to its most recent value\n # in the corresponding frame\n self.expression_values = {} # type: Dict[ast.expr, Any]\n\n # Node where the frame has explicitly returned\n # There may be parent nodes such as enclosing loops that still need to finish executing\n self.return_node = None # type: Optional[ast.Return]\n\n # Most recent exception raised in the frame\n self.exc_value = None" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "STORE_NAME", "\"\"\"\n Create a subclass of this class with one or more of the 'hooks'\n (methods which are empty in this class) overridden to take a custom action\n in the given situation. Then decorate functions with an instance of this class\n to trace them.\n \"\"\"" ], [ "STORE_NAME", " def __init__(self):\n # Mapping from frames of execution being traced to FrameInfo objects\n # for extra metadata.\n self.stack = {} # type: Dict[FrameType, FrameInfo]\n self.main_to_secondary_frames = defaultdict(list)\n self.secondary_to_main_frames = {}" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL", "lru_cache()" ], [ "CALL", "lru_cache()" ], [ "STORE_NAME", " @lru_cache()\n def compile(self, source, filename, flags=0):\n # type: (str, str, int) -> TracedFile\n return TracedFile(self, source, filename, flags)" ], [ "STORE_NAME", " def _trace_methods_dict(self, traced_file):\n # type: (TracedFile) -> Dict[str, Callable]\n return {f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_NAME", " def trace_function(self, func):\n # type: (FunctionType) -> FunctionType\n \"\"\"\n Returns a version of the passed function with the AST modified to\n trigger the tracing hooks.\n \"\"\"\n if not isinstance(func, FunctionType):\n raise ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n try:\n if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func):\n raise ValueError('You cannot trace async functions')\n except AttributeError:\n pass\n\n if is_lambda(func):\n raise ValueError('You cannot trace lambdas')\n\n filename = inspect.getsourcefile(func) # type: str\n\n if is_ipython_cell(filename):\n # noinspection PyPackageRequirements\n from IPython import get_ipython\n import linecache\n\n flags = get_ipython().compile.flags\n source = ''.join(linecache.cache[filename][2])\n else:\n source = read_source_file(filename)\n flags = 0\n\n # We compile the entire file instead of just the function source\n # because it can contain context which affects the function code,\n # e.g. enclosing functions and classes or __future__ imports\n traced_file = self.compile(source, filename, flags)\n\n if func.__dict__:\n raise ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')\n\n # Then we have to recursively search through the newly compiled\n # code to find the code we actually want corresponding to this function\n code_options = [] # type: List[CodeType]\n\n def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)\n\n find_code(traced_file.code)\n\n if len(code_options) > 1:\n # Currently lambdas aren't allowed anyway, but should be in the future\n assert is_lambda(func)\n raise ValueError(\"Failed to trace lambda. Convert the function to a def.\")\n new_func_code = code_options[0] # type: CodeType\n\n # Give the new function access to the hooks\n # We have to use the original __globals__ and not a copy\n # because it's the actual module namespace that may get updated by other code\n func.__globals__.update(self._trace_methods_dict(traced_file))\n\n # http://stackoverflow.com/a/13503277/2482744\n # noinspection PyArgumentList\n new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)\n update_wrapper(new_func, func) # type: FunctionType\n if PY3:\n new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None)\n new_func.traced_file = traced_file\n return new_func" ], [ "STORE_NAME", " def __call__(self, func=None, optional=False):\n # type: (FunctionType, bool) -> Callable\n \"\"\"\n Decorator which returns a (possibly optionally) traced function.\n This decorator can be called with or without arguments.\n Typically it is called without arguments, in which case it returns\n a traced function.\n If optional=True, it returns a function similar to the original\n but with an additional optional parameter trace_call, default False.\n If trace_call is false, the underlying untraced function is used.\n If true, the traced version is used.\n \"\"\"\n if inspect.isclass(func):\n raise TypeError('Decorating classes is no longer supported')\n\n if func:\n # The decorator has been called without arguments/parentheses,\n # e.g.\n # @eye\n # def ...\n return self.trace_function(func)\n\n # The decorator has been called with arguments/parentheses,\n # e.g.\n # @eye(...)\n # def ...\n # We must return a decorator\n\n if not optional:\n return self.trace_function\n\n def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper\n\n return decorator" ], [ "STORE_NAME", " def _main_frame(self, node):\n # type: (ast.AST) -> Optional[FrameType]\n frame = sys._getframe(2)\n result = self.secondary_to_main_frames.get(frame)\n if result:\n return result\n\n original_frame = frame\n\n while frame.f_code.co_name in ('', '', ''):\n frame = frame.f_back\n\n for node in ancestors(node):\n if isinstance(node, (ast.FunctionDef, ast.Lambda)):\n break\n\n if isinstance(node, ast.ClassDef):\n frame = frame.f_back\n\n if frame.f_code.co_name in ('', ''):\n return None\n\n self.secondary_to_main_frames[original_frame] = frame\n self.main_to_secondary_frames[frame].append(original_frame)\n return frame" ], [ "STORE_NAME", " def _treetrace_hidden_with_stmt(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> _StmtContext\n \"\"\"\n Called directly from the modified code.\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(...):\n \n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.stmt, node)\n frame = self._main_frame(node)\n return _StmtContext(self, node, frame)" ], [ "STORE_NAME", " def _treetrace_hidden_before_expr(self, traced_file, _tree_index):\n # type: (TracedFile, int) -> ast.expr\n \"\"\"\n Called directly from the modified code before an expression is\n evaluated.\n \"\"\"\n node = traced_file.nodes[_tree_index]\n node = cast(ast.expr, node)\n frame = self._main_frame(node)\n if frame is None:\n return node\n\n frame_info = self.stack[frame]\n frame_info.expression_stack.append(node)\n\n self.before_expr(node, frame)\n return node" ], [ "STORE_NAME", " def _treetrace_hidden_after_expr(self, _, node, value):\n # type: (TracedFile, ast.expr, Any) -> Any\n \"\"\"\n Called directly from the modified code after an expression is\n evaluated.\n \"\"\"\n frame = self._main_frame(node)\n if frame is None:\n return value\n\n result = self._after_expr(node, frame, value, None, None)\n if result is not None:\n assert isinstance(result, ChangeValue), \"after_expr must return None or an instance of ChangeValue\"\n value = result.value\n return value" ], [ "STORE_NAME", " def _after_expr(self, node, frame, value, exc_value, exc_tb):\n frame_info = self.stack[frame]\n frame_info.expression_stack.pop()\n frame_info.expression_values[node] = value\n return self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "STORE_NAME", " def _enter_call(self, enter_node, current_frame):\n # type: (ast.AST, FrameType) -> None\n caller_frame, call_node = self._get_caller_stuff(current_frame)\n self.stack[current_frame] = FrameInfo()\n self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "STORE_NAME", " def _get_caller_stuff(self, frame):\n # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]]\n caller_frame = frame.f_back\n call_node = None\n main_frame = self.secondary_to_main_frames.get(caller_frame)\n if main_frame:\n caller_frame = main_frame\n frame_info = self.stack[caller_frame]\n expression_stack = frame_info.expression_stack\n if expression_stack:\n call_node = expression_stack[-1]\n else:\n call_node = frame_info.statement_stack[-1] # type: ignore\n return caller_frame, call_node" ], [ "STORE_NAME", " def before_expr(self, node, frame):\n # type: (ast.expr, FrameType) -> None\n \"\"\"\n Called right before the expression corresponding to `node` is evaluated\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_expr(self, node, frame, value, exc_value, exc_tb):\n # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue]\n \"\"\"\n Called right after the expression corresponding to `node` is evaluated\n within `frame`. `value` is the value of the expression, if it succeeded.\n If the evaluation raised an exception, exc_value will be the exception object\n and exc_tb the traceback.\n\n Return `ChangeValue(x)` to change the value of the expression as\n seen by the rest of the program from `value` to `x`.\n \"\"\"" ], [ "STORE_NAME", " def before_stmt(self, node, frame):\n # type: (ast.stmt, FrameType) -> None\n \"\"\"\n Called right before the statement corresponding to `node` is executed\n within `frame`.\n \"\"\"" ], [ "STORE_NAME", " def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node):\n # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool]\n \"\"\"\n Called right after the statement corresponding to `node` is executed\n within `frame`.\n If the statement raised an exception, exc_value will be the exception object,\n exc_tb the traceback, and exc_node the node where the exception was raised\n (either this statement or an expression within).\n\n Returning True will suppress any exception raised (as with __exit__ in general).\n \"\"\"" ], [ "STORE_NAME", " def enter_call(self, enter_info):\n # type: (EnterCallInfo) -> None\n \"\"\"\n Called before a function call begins executing. For typical `def` functions,\n this is called before the `before_stmt` for to the first statement in the function.\n \"\"\"" ], [ "STORE_NAME", " def exit_call(self, exit_info):\n # type: (ExitCallInfo) -> None\n \"\"\"\n Called after a function call finishes executing. For typical `def` functions,\n this is called after the `after_stmt` for to the last statement to execute.\n \"\"\"" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "STORE_NAME", " def parse_extra(self, root, source, filename):\n # type: (ast.Module, str, str) -> Optional[ast.Module]\n \"\"\"\n Called before the AST (root) is modified to let subclasses make additional changes first.\n \"\"\"" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "CALL", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_FAST_AND_CLEAR", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "CALL", "partial(f, traced_file)" ], [ "STORE_FAST", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "STORE_FAST", "{f.__name__: partial(f, traced_file)\n for f in [\n self._treetrace_hidden_with_stmt,\n self._treetrace_hidden_before_expr,\n self._treetrace_hidden_after_expr,\n ]}" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL", "inspect.getsourcefile(func)" ], [ "STORE_FAST", "filename" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL", "is_ipython_cell(filename)" ], [ "STORE_FAST", "from IPython import get_ipython" ], [ "STORE_FAST", "import linecache" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "STORE_FAST", "flags" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL", "''.join(linecache.cache[filename][2])" ], [ "STORE_FAST", "source" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL", "read_source_file(filename)" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "flags" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_FAST", "flags" ], [ "CALL", "self.compile(source, filename, flags)" ], [ "STORE_FAST", "traced_file" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "STORE_DEREF", "code_options" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "LOAD_FAST", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "STORE_DEREF", " def find_code(root_code):\n # type: (CodeType) -> None\n for const in root_code.co_consts: # type: CodeType\n if not inspect.iscode(const):\n continue\n matches = (const.co_firstlineno == func.__code__.co_firstlineno and\n const.co_name == func.__code__.co_name)\n if matches:\n code_options.append(const)\n find_code(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "STORE_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_ATTR", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL", "self._trace_methods_dict(traced_file)" ], [ "CALL", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "STORE_FAST", "new_func" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "STORE_FAST", "const" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "STORE_FAST", "matches" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", " def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper" ], [ "STORE_FAST", " def decorator(actual_func):\n\n traced = self.trace_function(actual_func)\n\n @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)\n\n return wrapper" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "self.trace_function(actual_func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL", "wraps(actual_func)" ], [ "LOAD_FAST", " @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)" ], [ "LOAD_FAST", " @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)" ], [ "CALL", "wraps(actual_func)" ], [ "STORE_FAST", " @wraps(actual_func)\n def wrapper(*args, **kwargs):\n trace_call = kwargs.pop('trace_call', False)\n if trace_call:\n f = traced\n else:\n f = actual_func\n return f(*args, **kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_ATTR", "kwargs.pop" ], [ "CALL", "kwargs.pop('trace_call', False)" ], [ "STORE_FAST", "trace_call" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "f" ], [ "LOAD_DEREF", "actual_func" ], [ "STORE_FAST", "f" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL", "sys._getframe(2)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.secondary_to_main_frames.get(frame)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "original_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL", "ancestors(node)" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_ATTR", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.stmt, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "frame" ], [ "CALL", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "STORE_FAST", "node" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "cast(ast.expr, node)" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.before_expr" ], [ "CALL", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL", "self._main_frame(node)" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._after_expr" ], [ "LOAD_FAST", "value" ], [ "CALL", "self._after_expr(node, frame, value, None, None)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.pop" ], [ "CALL", "frame_info.expression_stack.pop()" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.after_expr" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "CALL", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "STORE_FAST", "caller_frame" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL", "self.secondary_to_main_frames.get(caller_frame)" ], [ "STORE_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "STORE_FAST", "caller_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "STORE_FAST", "call_node" ], [ "STORE_NAME", "\"\"\"\n This does the AST modifications that call the hooks.\n \"\"\"" ], [ "STORE_NAME", " def generic_visit(self, node):\n # type: (ast.AST) -> ast.AST\n if not getattr(node, '_visit_ignore', False):\n if (isinstance(node, ast.expr) and\n not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load)) and\n not isinstance(node, getattr(ast, 'Starred', ()))):\n return self.visit_expr(node)\n if isinstance(node, ast.stmt):\n return self.visit_stmt(node)\n return super(_NodeVisitor, self).generic_visit(node)" ], [ "STORE_NAME", " def visit_expr(self, node):\n # type: (ast.expr) -> ast.Call\n \"\"\"\n each expression e gets wrapped like this:\n _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e)\n\n where the _treetrace_* functions are the corresponding methods with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n\n before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)\n ast.copy_location(before_marker, node)\n\n after_marker = ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )\n ast.copy_location(after_marker, node)\n ast.fix_missing_locations(after_marker)\n\n return after_marker" ], [ "STORE_NAME", " def visit_stmt(self, node):\n # type: (ast.stmt) -> ast.With\n \"\"\"\n Every statement in the original code becomes:\n\n with _treetrace_hidden_with_stmt(_tree_index):\n \n\n where the _treetrace_hidden_with_stmt function is the the corresponding method with the\n TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict)\n \"\"\"\n context_expr = self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)\n\n if PY3:\n wrapped = ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )\n else:\n wrapped = ast.With(\n context_expr=context_expr,\n body=[node],\n )\n ast.copy_location(wrapped, node)\n ast.fix_missing_locations(wrapped)\n return wrapped" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL", "staticmethod" ], [ "STORE_NAME", " @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", " @staticmethod\n def _create_simple_marker_call(node, func):\n # type: (ast.AST, Callable) -> ast.Call\n \"\"\"\n Returns a Call node representing `func(node._tree_index)`\n where node._tree_index is a numerical literal which allows the node object\n to be retrieved later through the nodes attribute of a TracedFile.\n \"\"\"\n return ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL", "getattr(ast, 'Starred', ())" ], [ "CALL", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "STORE_FAST", "before_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "CALL", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "STORE_FAST", "after_marker" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "CALL", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "STORE_FAST", "context_expr" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "STORE_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "CALL", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL", "ast.Load()" ], [ "CALL_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL", "ast.Num(node._tree_index)" ], [ "CALL_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "STORE_NAME", "__slots__" ], [ "STORE_NAME", " def __init__(self, tracer, node, frame):\n # type: (TreeTracerBase, ast.stmt, FrameType) -> None\n self.tracer = tracer\n self.node = node\n self.frame = frame" ], [ "STORE_NAME", " def __enter__(self):\n tracer = self.tracer\n node = self.node\n frame = self.frame\n if getattr(node, '_enter_call_node', False):\n tracer._enter_call(node, frame)\n frame_info = tracer.stack[frame]\n frame_info.expression_stack = []\n frame_info.statement_stack.append(node)\n tracer.before_stmt(node, frame)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_val, exc_tb):\n # type: (Type[Exception], Exception, TracebackType) -> bool\n node = self.node\n tracer = self.tracer\n frame = self.frame\n frame_info = tracer.stack[frame]\n\n frame_info.statement_stack.pop()\n\n exc_node = None # type: Optional[Union[ast.expr, ast.stmt]]\n if exc_val and exc_val is not frame_info.exc_value:\n exc_node = node\n frame_info.exc_value = exc_val\n\n # Call the after_expr hook if the exception was raised by an expression\n expression_stack = frame_info.expression_stack\n if expression_stack:\n exc_node = expression_stack[-1]\n tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)\n\n result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)\n\n if isinstance(node, ast.Return):\n frame_info.return_node = node\n\n parent = node.parent # type: ast.AST\n return_node = frame_info.return_node\n exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and\n (node is parent.body[-1] or\n exc_val or\n return_node))\n if exiting:\n caller_frame, call_node = tracer._get_caller_stuff(frame)\n return_value = None\n if return_node and return_node.value and not exc_val:\n return_value = frame_info.expression_values[return_node.value]\n tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))\n\n del tracer.stack[frame]\n for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame):\n del self.tracer.secondary_to_main_frames[secondary_frame]\n\n return result" ], [ "STORE_ATTR", "self.tracer" ], [ "STORE_ATTR", "self.node" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._enter_call" ], [ "CALL", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.before_stmt" ], [ "CALL", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "STORE_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.pop" ], [ "CALL", "frame_info.statement_stack.pop()" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "IS_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "STORE_FAST", "exc_node" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "STORE_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "STORE_FAST", "exc_node" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._after_expr" ], [ "CALL", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.after_stmt" ], [ "LOAD_FAST", "exc_node" ], [ "CALL", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "STORE_FAST", "result" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL", "isinstance(node, ast.Return)" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "STORE_FAST", "return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "IS_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "STORE_FAST", "exiting" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL", "tracer._get_caller_stuff(frame)" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "STORE_FAST", "return_value" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "STORE_FAST", "secondary_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "DELETE_SUBSCR", "self.tracer.secondary_to_main_frames[secondary_frame]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "node" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "STORE_FAST", "result" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "STORE_FAST", "parent" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "IS_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "CONTAINS_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "CONTAINS_OP", "node in parent.ifs" ], [ "STORE_FAST", "is_containing_loop" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "STORE_FAST", "generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "CONTAINS_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "lambda n: n != node" ], [ "LOAD_FAST", "generators" ], [ "CALL", "takewhile(lambda n: n != node, generators)" ], [ "CALL", "list(takewhile(lambda n: n != node, generators))" ], [ "STORE_FAST", "generators" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL", "reversed(generators)" ], [ "CALL", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "STORE_DEREF", "node" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.reverse" ], [ "CALL", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL", "tuple(result)" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.5.json000066400000000000000000001632241474076367500243700ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_enter_call_nodes" ], [ "CALL_FUNCTION", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_ATTR", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_FUNCTION", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_ATTR", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_FUNCTION", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_ATTR", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_ATTR", "kwargs.pop" ], [ "CALL_FUNCTION", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL_FUNCTION", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_ATTR", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_FUNCTION", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.pop" ], [ "CALL_FUNCTION", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_FUNCTION", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "UNARY_NOT", "not isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_FUNCTION", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.pop" ], [ "CALL_FUNCTION", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_FUNCTION", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "UNARY_NOT", "not exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_FUNCTION", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_FUNCTION", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_FUNCTION", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.reverse" ], [ "CALL_FUNCTION", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.6.json000066400000000000000000001632531474076367500243730ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_basic_node_attributes" ], [ "CALL_FUNCTION", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.set_enter_call_nodes" ], [ "CALL_FUNCTION", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_ATTR", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_FUNCTION", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_ATTR", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_FUNCTION", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_ATTR", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_FUNCTION", "self._trace_methods_dict(traced_file)" ], [ "CALL_FUNCTION", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_ATTR", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_FUNCTION", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_ATTR", "kwargs.pop" ], [ "CALL_FUNCTION", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "CALL_FUNCTION", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_ATTR", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_FUNCTION", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_ATTR", "frame_info.expression_stack.pop" ], [ "CALL_FUNCTION", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_FUNCTION", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_ATTR", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_FUNCTION", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not isinstance(node.ctx, ast.Load)" ], [ "UNARY_NOT", "not (hasattr(node, \"ctx\") and not isinstance(node.ctx, ast.Load))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "UNARY_NOT", "not isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_ATTR", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_FUNCTION", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_FUNCTION", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_FUNCTION", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_ATTR", "frame_info.statement_stack.pop" ], [ "CALL_FUNCTION", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_FUNCTION", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "UNARY_NOT", "not exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_FUNCTION", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_FUNCTION", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_FUNCTION", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.reverse" ], [ "CALL_FUNCTION", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.7.json000066400000000000000000001625261474076367500243760ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.8.json000066400000000000000000001625261474076367500243770ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-py-3.9.json000066400000000000000000001624701474076367500243760ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION_KW", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "IS_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOAD_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION_KW", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOAD_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOAD_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOAD_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "IS_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOAD_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_FUNCTION_KW", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION_KW", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_FUNCTION_KW", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_FUNCTION_KW", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOAD_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "IS_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "IS_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOAD_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "IS_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "CONTAINS_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "CONTAINS_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "CONTAINS_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-pypy-2.7.json000066400000000000000000001675161474076367500247520ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_NAME", "False" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOOKUP_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOOKUP_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+2", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_NAME", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOOKUP_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOOKUP_METHOD", "kwargs.pop" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOOKUP_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_METHOD", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOOKUP_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-pypy-3.5.json000066400000000000000000001627151474076367500247450ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOOKUP_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOOKUP_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOOKUP_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOOKUP_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOOKUP_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_METHOD", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOOKUP_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer-pypy-3.6.json000066400000000000000000001627151474076367500247460ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOOKUP_METHOD", "standard_library.install_aliases" ], [ "CALL_METHOD", "standard_library.install_aliases()" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.AST" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "CALL_FUNCTION", "NamedTuple('EnterCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call begins\n ('enter_node', ast.AST),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType)])" ], [ "LOAD_NAME", "NamedTuple" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "BINARY_SUBSCR", "Union[ast.expr, ast.stmt]" ], [ "BINARY_SUBSCR", "Optional[Union[ast.expr, ast.stmt]]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "BINARY_SUBSCR", "Optional[ast.Return]" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "FrameType" ], [ "LOAD_NAME", "Any" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "Exception" ], [ "BINARY_SUBSCR", "Optional[Exception]" ], [ "LOAD_NAME", "Optional" ], [ "LOAD_NAME", "TracebackType" ], [ "BINARY_SUBSCR", "Optional[TracebackType]" ], [ "CALL_FUNCTION", "NamedTuple('ExitCallInfo', [\n\n # Node from where the call was made\n ('call_node', Optional[Union[ast.expr, ast.stmt]]),\n\n # Node where the call explicitly returned\n ('return_node', Optional[ast.Return]),\n\n # Frame from which the call was made\n ('caller_frame', FrameType),\n\n # Frame of the call\n ('current_frame', FrameType),\n\n # Node where the call explicitly returned\n ('return_value', Any),\n\n # Exception raised in the call causing it to end,\n # will propagate to the caller\n ('exc_value', Optional[Exception]),\n\n # Traceback corresponding to exc_value\n ('exc_tb', Optional[TracebackType])])" ], [ "LOAD_NAME", "namedtuple" ], [ "CALL_FUNCTION", "namedtuple('ChangeValue', 'value')" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.NodeTransformer" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "Union" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "BINARY_SUBSCR", "Union[ast.For, ast.While, ast.comprehension]" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.PyCF_ONLY_AST" ], [ "LOAD_FAST", "flags" ], [ "BINARY_OR", "ast.PyCF_ONLY_AST | flags" ], [ "CALL_FUNCTION", "compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.parse_extra" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "CALL_METHOD", "tracer.parse_extra(self.root, source, filename)" ], [ "LOAD_FAST", "new_root" ], [ "COMPARE_OP", "new_root is not None" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.root" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_basic_node_attributes" ], [ "CALL_METHOD", "self.set_basic_node_attributes()" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.set_enter_call_nodes" ], [ "CALL_METHOD", "self.set_enter_call_nodes()" ], [ "LOAD_GLOBAL", "deepcopy" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_FUNCTION", "deepcopy(self.root)" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "CALL_FUNCTION", "_NodeVisitor()" ], [ "LOOKUP_METHOD", "_NodeVisitor().visit" ], [ "LOAD_FAST", "new_root" ], [ "CALL_METHOD", "_NodeVisitor().visit(new_root)" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "new_root" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "compile(new_root, filename, \"exec\", dont_inherit=True, flags=flags)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.code" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.filename" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "CALL_METHOD", "ast.walk(self.root)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.iter_child_nodes" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.iter_child_nodes(node)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "child" ], [ "STORE_ATTR", "child.parent" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "CALL_FUNCTION", "len(self.nodes)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._tree_index" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOOKUP_METHOD", "self.nodes.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.nodes.append(node)" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "CALL_FUNCTION", "enumerate(self.root.body)" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.root" ], [ "LOAD_ATTR", "self.root.body" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "self.root.body[:i + 1]" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.walk" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "ast.walk(s)" ], [ "LOAD_FAST", "node" ], [ "STORE_ATTR", "node._visit_ignore" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.nodes" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(node, (ast.Module, ast.FunctionDef))" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.body" ], [ "LOAD_GLOBAL", "is_future_import" ], [ "LOAD_FAST", "stmt" ], [ "CALL_FUNCTION", "is_future_import(stmt)" ], [ "LOAD_FAST", "stmt" ], [ "STORE_ATTR", "stmt._enter_call_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.statement_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_stack" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.expression_values" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.return_node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.exc_value" ], [ "LOAD_NAME", "lru_cache" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "CALL_FUNCTION", "lru_cache()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.stack" ], [ "LOAD_GLOBAL", "defaultdict" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "defaultdict(list)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_GLOBAL", "TracedFile" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_FUNCTION", "TracedFile(self, source, filename, flags)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_with_stmt" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_before_expr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._treetrace_hidden_after_expr" ], [ "LOAD_GLOBAL", "partial" ], [ "LOAD_FAST", "f" ], [ "LOAD_DEREF", "traced_file" ], [ "CALL_FUNCTION", "partial(f, traced_file)" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__name__" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_DEREF", "func" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "CALL_FUNCTION", "isinstance(func, FunctionType)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You can only trace user-defined functions. '\n 'The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscoroutinefunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.iscoroutinefunction(func)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isasyncgenfunction" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.isasyncgenfunction(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace async functions')" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('You cannot trace lambdas')" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.getsourcefile" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "inspect.getsourcefile(func)" ], [ "LOAD_GLOBAL", "is_ipython_cell" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "is_ipython_cell(filename)" ], [ "LOAD_FAST", "get_ipython" ], [ "CALL_FUNCTION", "get_ipython()" ], [ "LOAD_ATTR", "get_ipython().compile" ], [ "LOAD_ATTR", "get_ipython().compile.flags" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "linecache" ], [ "LOAD_ATTR", "linecache.cache" ], [ "LOAD_FAST", "filename" ], [ "BINARY_SUBSCR", "linecache.cache[filename]" ], [ "BINARY_SUBSCR", "linecache.cache[filename][2]" ], [ "CALL_METHOD", "''.join(linecache.cache[filename][2])" ], [ "LOAD_GLOBAL", "read_source_file" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "read_source_file(filename)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.compile" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "filename" ], [ "LOAD_FAST", "flags" ], [ "CALL_METHOD", "self.compile(source, filename, flags)" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__dict__" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError('The birdseye decorator must be applied first, '\n 'at the bottom of the list.')" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.code" ], [ "CALL_FUNCTION", "find_code(traced_file.code)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_DEREF", "code_options" ], [ "CALL_FUNCTION", "len(code_options)" ], [ "COMPARE_OP", "len(code_options) > 1" ], [ "LOAD_GLOBAL", "is_lambda" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "is_lambda(func)" ], [ "LOAD_GLOBAL", "ValueError" ], [ "CALL_FUNCTION", "ValueError(\"Failed to trace lambda. Convert the function to a def.\")" ], [ "LOAD_DEREF", "code_options" ], [ "BINARY_SUBSCR", "code_options[0]" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOOKUP_METHOD", "func.__globals__.update" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._trace_methods_dict" ], [ "LOAD_FAST", "traced_file" ], [ "CALL_METHOD", "self._trace_methods_dict(traced_file)" ], [ "CALL_METHOD", "func.__globals__.update(self._trace_methods_dict(traced_file))" ], [ "LOAD_GLOBAL", "FunctionType" ], [ "LOAD_FAST", "new_func_code" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__globals__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__defaults__" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__closure__" ], [ "CALL_FUNCTION", "FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__)" ], [ "LOAD_GLOBAL", "update_wrapper" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "update_wrapper(new_func, func)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "getattr(func, '__kwdefaults__', None)" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.__kwdefaults__" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_FAST", "new_func" ], [ "STORE_ATTR", "new_func.traced_file" ], [ "LOAD_FAST", "new_func" ], [ "LOAD_FAST", "root_code" ], [ "LOAD_ATTR", "root_code.co_consts" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.iscode" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "inspect.iscode(const)" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_firstlineno" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_firstlineno" ], [ "COMPARE_OP", "const.co_firstlineno == func.__code__.co_firstlineno" ], [ "LOAD_FAST", "const" ], [ "LOAD_ATTR", "const.co_name" ], [ "LOAD_DEREF", "func" ], [ "LOAD_ATTR", "func.__code__" ], [ "LOAD_ATTR", "func.__code__.co_name" ], [ "COMPARE_OP", "const.co_name == func.__code__.co_name" ], [ "LOAD_FAST", "matches" ], [ "LOAD_DEREF", "code_options" ], [ "LOOKUP_METHOD", "code_options.append" ], [ "LOAD_FAST", "const" ], [ "CALL_METHOD", "code_options.append(const)" ], [ "LOAD_DEREF", "find_code" ], [ "LOAD_FAST", "const" ], [ "CALL_FUNCTION", "find_code(const)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isclass" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "inspect.isclass(func)" ], [ "LOAD_GLOBAL", "TypeError" ], [ "CALL_FUNCTION", "TypeError('Decorating classes is no longer supported')" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_FAST", "func" ], [ "CALL_METHOD", "self.trace_function(func)" ], [ "LOAD_FAST", "optional" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.trace_function" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self.trace_function" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_METHOD", "self.trace_function(actual_func)" ], [ "LOAD_GLOBAL", "wraps" ], [ "LOAD_DEREF", "actual_func" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "CALL_FUNCTION", "wraps(actual_func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_FAST", "kwargs" ], [ "LOOKUP_METHOD", "kwargs.pop" ], [ "CALL_METHOD", "kwargs.pop('trace_call', False)" ], [ "LOAD_FAST", "trace_call" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "actual_func" ], [ "LOAD_FAST", "f" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "f(*args, **kwargs)" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "CALL_METHOD", "sys._getframe(2)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(frame)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_GLOBAL", "ancestors" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "ancestors(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Lambda" ], [ "CALL_FUNCTION", "isinstance(node, (ast.FunctionDef, ast.Lambda))" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ClassDef" ], [ "CALL_FUNCTION", "isinstance(node, ast.ClassDef)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '')" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOAD_FAST", "original_frame" ], [ "STORE_SUBSCR", "self.secondary_to_main_frames[original_frame]" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.main_to_secondary_frames" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.main_to_secondary_frames[frame]" ], [ "LOOKUP_METHOD", "self.main_to_secondary_frames[frame].append" ], [ "LOAD_FAST", "original_frame" ], [ "CALL_METHOD", "self.main_to_secondary_frames[frame].append(original_frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.stmt, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_GLOBAL", "_StmtContext" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "_StmtContext(self, node, frame)" ], [ "LOAD_FAST", "traced_file" ], [ "LOAD_ATTR", "traced_file.nodes" ], [ "LOAD_FAST", "_tree_index" ], [ "BINARY_SUBSCR", "traced_file.nodes[_tree_index]" ], [ "LOAD_GLOBAL", "cast" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "cast(ast.expr, node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.expression_stack.append(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.before_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.before_expr(node, frame)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._main_frame" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self._main_frame(node)" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "frame is None" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "CALL_METHOD", "self._after_expr(node, frame, value, None, None)" ], [ "LOAD_FAST", "result" ], [ "COMPARE_OP", "result is not None" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "ChangeValue" ], [ "CALL_FUNCTION", "isinstance(result, ChangeValue)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.value" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOOKUP_METHOD", "frame_info.expression_stack.pop" ], [ "CALL_METHOD", "frame_info.expression_stack.pop()" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "node" ], [ "STORE_SUBSCR", "frame_info.expression_values[node]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.after_expr" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "exc_value" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "self.after_expr(node, frame, value, exc_value, exc_tb)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._get_caller_stuff" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_METHOD", "self._get_caller_stuff(current_frame)" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "FrameInfo()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "current_frame" ], [ "STORE_SUBSCR", "self.stack[current_frame]" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.enter_call" ], [ "LOAD_GLOBAL", "EnterCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "enter_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "current_frame" ], [ "CALL_FUNCTION", "EnterCallInfo(call_node, enter_node, caller_frame, current_frame)" ], [ "CALL_METHOD", "self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame))" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.secondary_to_main_frames" ], [ "LOOKUP_METHOD", "self.secondary_to_main_frames.get" ], [ "LOAD_FAST", "caller_frame" ], [ "CALL_METHOD", "self.secondary_to_main_frames.get(caller_frame)" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "main_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.stack" ], [ "LOAD_FAST", "caller_frame" ], [ "BINARY_SUBSCR", "self.stack[caller_frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "BINARY_SUBSCR", "frame_info.statement_stack[-1]" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_NAME", "staticmethod" ], [ "CALL_FUNCTION", "staticmethod" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_visit_ignore', False)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.expr" ], [ "CALL_FUNCTION", "isinstance(node, ast.expr)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "hasattr(node, \"ctx\")" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.ctx" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Load" ], [ "CALL_FUNCTION", "isinstance(node.ctx, ast.Load)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_GLOBAL", "ast" ], [ "CALL_FUNCTION", "getattr(ast, 'Starred', ())" ], [ "CALL_FUNCTION", "isinstance(node, getattr(ast, 'Starred', ()))" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_expr(node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.stmt" ], [ "CALL_FUNCTION", "isinstance(node, ast.stmt)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.visit_stmt" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "self.visit_stmt(node)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_before_expr" ], [ "CALL_METHOD", "self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(before_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_after_expr.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load())" ], [ "LOAD_FAST", "before_marker" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__,\n ctx=ast.Load()),\n args=[\n before_marker,\n super(_NodeVisitor, self).generic_visit(node),\n ],\n keywords=[],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(after_marker, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "after_marker" ], [ "CALL_METHOD", "ast.fix_missing_locations(after_marker)" ], [ "LOAD_FAST", "after_marker" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._create_simple_marker_call" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "_NodeVisitor" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(_NodeVisitor, self)" ], [ "LOOKUP_METHOD", "super(_NodeVisitor, self).generic_visit" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "super(_NodeVisitor, self).generic_visit(node)" ], [ "LOAD_GLOBAL", "TreeTracerBase" ], [ "LOAD_ATTR", "TreeTracerBase._treetrace_hidden_with_stmt" ], [ "CALL_METHOD", "self._create_simple_marker_call(\n super(_NodeVisitor, self).generic_visit(node),\n TreeTracerBase._treetrace_hidden_with_stmt)" ], [ "LOAD_GLOBAL", "PY3" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.withitem" ], [ "LOAD_FAST", "context_expr" ], [ "CALL_METHOD", "ast.withitem(context_expr=context_expr)" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n items=[ast.withitem(context_expr=context_expr)],\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.With" ], [ "LOAD_FAST", "context_expr" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.With(\n context_expr=context_expr,\n body=[node],\n )" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.copy_location" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "ast.copy_location(wrapped, node)" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.fix_missing_locations" ], [ "LOAD_FAST", "wrapped" ], [ "CALL_METHOD", "ast.fix_missing_locations(wrapped)" ], [ "LOAD_FAST", "wrapped" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Call" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Name" ], [ "LOAD_FAST", "func" ], [ "LOAD_ATTR", "func.__name__" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Load" ], [ "CALL_METHOD", "ast.Load()" ], [ "CALL_METHOD", "ast.Name(id=func.__name__,\n ctx=ast.Load())" ], [ "LOAD_GLOBAL", "ast" ], [ "LOOKUP_METHOD", "ast.Num" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node._tree_index" ], [ "CALL_METHOD", "ast.Num(node._tree_index)" ], [ "CALL_METHOD", "ast.Call(\n func=ast.Name(id=func.__name__,\n ctx=ast.Load()),\n args=[ast.Num(node._tree_index)],\n keywords=[],\n )" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.tracer" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_GLOBAL", "getattr" ], [ "LOAD_FAST", "node" ], [ "CALL_FUNCTION", "getattr(node, '_enter_call_node', False)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._enter_call" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._enter_call(node, frame)" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.append" ], [ "LOAD_FAST", "node" ], [ "CALL_METHOD", "frame_info.statement_stack.append(node)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.before_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer.before_stmt(node, frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.node" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "tracer.stack[frame]" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.statement_stack" ], [ "LOOKUP_METHOD", "frame_info.statement_stack.pop" ], [ "CALL_METHOD", "frame_info.statement_stack.pop()" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.exc_value" ], [ "COMPARE_OP", "exc_val is not frame_info.exc_value" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.exc_value" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "LOAD_FAST", "expression_stack" ], [ "BINARY_SUBSCR", "expression_stack[-1]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._after_expr" ], [ "LOAD_FAST", "exc_node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_METHOD", "tracer._after_expr(exc_node, frame, None, exc_val, exc_tb)" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.after_stmt" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "LOAD_FAST", "exc_node" ], [ "CALL_METHOD", "tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "node" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Return" ], [ "CALL_FUNCTION", "isinstance(node, ast.Return)" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.return_node" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.return_node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.Module" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.FunctionDef, ast.Module))" ], [ "LOAD_FAST", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.body" ], [ "BINARY_SUBSCR", "parent.body[-1]" ], [ "COMPARE_OP", "node is parent.body[-1]" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "exiting" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer._get_caller_stuff" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "tracer._get_caller_stuff(frame)" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.expression_values" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_ATTR", "return_node.value" ], [ "BINARY_SUBSCR", "frame_info.expression_values[return_node.value]" ], [ "LOAD_FAST", "tracer" ], [ "LOOKUP_METHOD", "tracer.exit_call" ], [ "LOAD_GLOBAL", "ExitCallInfo" ], [ "LOAD_FAST", "call_node" ], [ "LOAD_FAST", "return_node" ], [ "LOAD_FAST", "caller_frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "return_value" ], [ "LOAD_FAST", "exc_val" ], [ "LOAD_FAST", "exc_tb" ], [ "CALL_FUNCTION", "ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n )" ], [ "CALL_METHOD", "tracer.exit_call(ExitCallInfo(call_node,\n return_node,\n caller_frame,\n frame,\n return_value,\n exc_val,\n exc_tb\n ))" ], [ "LOAD_FAST", "tracer" ], [ "LOAD_ATTR", "tracer.stack" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.main_to_secondary_frames" ], [ "LOOKUP_METHOD", "self.tracer.main_to_secondary_frames.pop" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self.tracer.main_to_secondary_frames.pop(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.tracer" ], [ "LOAD_ATTR", "self.tracer.secondary_to_main_frames" ], [ "LOAD_FAST", "secondary_frame" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_FAST", "node" ], [ "LOAD_DEREF", "node" ], [ "LOAD_ATTR", "node.parent" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.FunctionDef" ], [ "CALL_FUNCTION", "isinstance(parent, ast.FunctionDef)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.For" ], [ "CALL_FUNCTION", "isinstance(parent, ast.For)" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.iter" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "parent.iter is not node" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.While" ], [ "CALL_FUNCTION", "isinstance(parent, ast.While)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.orelse" ], [ "COMPARE_OP", "node not in parent.orelse" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.comprehension" ], [ "CALL_FUNCTION", "isinstance(parent, ast.comprehension)" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.ifs" ], [ "COMPARE_OP", "node in parent.ifs" ], [ "LOAD_FAST", "is_containing_loop" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.append" ], [ "LOAD_FAST", "parent" ], [ "CALL_METHOD", "result.append(parent)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "parent" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.ListComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.GeneratorExp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.DictComp" ], [ "LOAD_GLOBAL", "ast" ], [ "LOAD_ATTR", "ast.SetComp" ], [ "CALL_FUNCTION", "isinstance(parent, (ast.ListComp,\n ast.GeneratorExp,\n ast.DictComp,\n ast.SetComp))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_ATTR", "parent.generators" ], [ "LOAD_DEREF", "node" ], [ "LOAD_FAST", "generators" ], [ "COMPARE_OP", "node in generators" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "takewhile" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "takewhile(lambda n: n != node, generators)" ], [ "CALL_FUNCTION", "list(takewhile(lambda n: n != node, generators))" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.extend" ], [ "LOAD_GLOBAL", "reversed" ], [ "LOAD_FAST", "generators" ], [ "CALL_FUNCTION", "reversed(generators)" ], [ "CALL_METHOD", "result.extend(reversed(generators))" ], [ "LOAD_FAST", "parent" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.reverse" ], [ "CALL_METHOD", "result.reverse()" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "tuple(result)" ], [ "LOAD_FAST", "n" ], [ "LOAD_DEREF", "node" ], [ "COMPARE_OP", "n != node" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-2.7.json000066400000000000000000001166311474076367500244530ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_FUNCTION", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_FUNCTION", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "UNARY_NOT", "not values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_ATTR", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SLICE+0", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.items" ], [ "CALL_FUNCTION", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_ATTR", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.keys" ], [ "CALL_FUNCTION", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.items" ], [ "CALL_FUNCTION", "frame.f_locals.items()" ], [ "CALL_FUNCTION", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_ATTR", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_ATTR", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_FUNCTION", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_ATTR", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_FUNCTION", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_ATTR", "thread_global.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL_FUNCTION", "sys.gettrace()" ], [ "CALL_FUNCTION", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_FUNCTION", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.pop" ], [ "CALL_FUNCTION", "stack.pop()" ], [ "CALL_FUNCTION", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_ATTR", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_ATTR", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_FUNCTION", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "UNARY_NOT", "not is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_ATTR", "thread_local.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_FUNCTION", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_FUNCTION", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_VAR_KW", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.10.json000066400000000000000000001134771474076367500245330ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "CONTAINS_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "IS_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "CONTAINS_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "CONTAINS_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "IS_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.11.json000066400000000000000000002277451474076367500245400ustar00rootroot00000000000000[ [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import re" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "STORE_NAME", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "STORE_NAME", "thread_global" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "STORE_NAME", "internal_directories" ], [ "STORE_NAME", "import birdseye" ], [ "LOAD_NAME", "internal_directories" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL", "os.path.dirname(birdseye.__file__)" ], [ "BINARY_OP", "internal_directories += (os.path.dirname(birdseye.__file__),)" ], [ "STORE_NAME", "internal_directories" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "type" ], [ "CALL", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "STORE_NAME", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_NAME", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_NAME", " def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''" ], [ "STORE_NAME", " def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables" ], [ "STORE_NAME", " def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_OP", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_OP", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "STORE_FAST", "old_local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "CALL", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "value_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.comprehension_variables.setdefault(name, [])" ], [ "STORE_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.items" ], [ "CALL", "self.comprehension_variables.items()" ], [ "CALL", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "value_repr" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "CONTAINS_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL", "my_cheap_repr(value)" ], [ "LOAD_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "values" ], [ "LOAD_FAST", "name" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "STORE_FAST", "code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.keys" ], [ "CALL", "frame.f_locals.keys()" ], [ "CALL", "tuple(frame.f_locals.keys())" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "STORE_DEREF", "vars_order" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.items" ], [ "CALL", "frame.f_locals.items()" ], [ "CALL", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "watch" ], [ "STORE_FAST", "variable" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL", "variable.items(frame)" ], [ "CALL", "sorted(variable.items(frame))" ], [ "BINARY_OP", "result_items += sorted(variable.items(frame))" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "result_items" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "STORE_FAST", "extra" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL", "extra(source, value)" ], [ "STORE_FAST", "pair" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL", "vars_order.index(key_value[0])" ], [ "STORE_NAME", " def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result" ], [ "STORE_NAME", " def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "STORE_NAME", " def __enter__(self):\n return self.default.__enter__(context=1)" ], [ "STORE_NAME", " def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "CALL", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_METHOD", "self.default.__enter__" ], [ "CALL", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", " def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()" ], [ "STORE_NAME", " def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper" ], [ "STORE_NAME", " def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)" ], [ "STORE_NAME", " def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)" ], [ "STORE_NAME", " def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames" ], [ "STORE_NAME", " def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL", "ensure_tuple(watch)" ], [ "CALL", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL", "ensure_tuple(watch_explode)" ], [ "CALL", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "BINARY_OP", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_FAST", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL", "CommonVariable(v)" ], [ "LOAD_FAST", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "CALL", " with self:\n return function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL", "method(incoming)" ], [ "STORE_FAST", "outgoing" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_GLOBAL", "Exception" ], [ "STORE_FAST", " except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "STORE_FAST", "stack" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL", "sys.gettrace()" ], [ "CALL", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "STORE_FAST", "stack" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.pop" ], [ "CALL", "stack.pop()" ], [ "CALL", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "CONTAINS_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "CONTAINS_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "candidate" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "STORE_FAST", "thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth += 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "STORE_FAST", "line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format_line_only(trace_event)" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL", "Event(frame_info, event, arg, thread_local.depth)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth -= 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format(trace_event)" ], [ "STORE_FAST", "formatted" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "STORE_NAME", " def __init__(self, config):\n self.config = config" ], [ "STORE_NAME", " def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator" ], [ "STORE_NAME", " def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "STORE_FAST", "import birdseye" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "self._trace(args[0])" ], [ "STORE_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "STORE_FAST", "from birdseye import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL", "eye(func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL", "self.config.snoop(*args, **kwargs)(traced)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "final_func" ], [ "LOAD_DEREF", "func" ], [ "STORE_FAST", "final_func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.12.json000066400000000000000000002316641474076367500245340ustar00rootroot00000000000000[ [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import re" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "STORE_NAME", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "STORE_NAME", "thread_global" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "STORE_NAME", "internal_directories" ], [ "STORE_NAME", "import birdseye" ], [ "LOAD_NAME", "internal_directories" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL", "os.path.dirname(birdseye.__file__)" ], [ "BINARY_OP", "internal_directories += (os.path.dirname(birdseye.__file__),)" ], [ "STORE_NAME", "internal_directories" ], [ "LOAD_NAME", "type" ], [ "CALL", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "STORE_NAME", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_NAME", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", " def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''" ], [ "STORE_NAME", " def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables" ], [ "STORE_NAME", " def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_OP", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_OP", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "STORE_FAST", "old_local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "CALL", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "value_repr" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.comprehension_variables.setdefault(name, [])" ], [ "STORE_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_ATTR", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SLICE", "values[:]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.items" ], [ "CALL", "self.comprehension_variables.items()" ], [ "LOAD_FAST_AND_CLEAR", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "values" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL", "', '.join(values)" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "STORE_FAST", "name" ], [ "STORE_FAST", "value_repr" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "CONTAINS_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_ATTR", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "LOAD_FAST", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL", "my_cheap_repr(value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "STORE_FAST", "code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.keys" ], [ "CALL", "frame.f_locals.keys()" ], [ "CALL", "tuple(frame.f_locals.keys())" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "STORE_DEREF", "vars_order" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.items" ], [ "CALL", "frame.f_locals.items()" ], [ "CALL", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "watch" ], [ "STORE_FAST", "variable" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_ATTR", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL", "variable.items(frame)" ], [ "CALL", "sorted(variable.items(frame))" ], [ "BINARY_OP", "result_items += sorted(variable.items(frame))" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "result_items" ], [ "STORE_FAST", "source" ], [ "STORE_FAST", "value" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "STORE_FAST", "extra" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL", "extra(source, value)" ], [ "STORE_FAST", "pair" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_ATTR", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL", "vars_order.index(key_value[0])" ], [ "STORE_NAME", " def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result" ], [ "STORE_NAME", " def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "STORE_NAME", " def __enter__(self):\n return self.default.__enter__(context=1)" ], [ "STORE_NAME", " def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_SUPER_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "CALL", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "LOAD_SUPER_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", " def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()" ], [ "STORE_NAME", " def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper" ], [ "STORE_NAME", " def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)" ], [ "STORE_NAME", " def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)" ], [ "STORE_NAME", " def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames" ], [ "STORE_NAME", " def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL", "ensure_tuple(watch)" ], [ "LOAD_FAST_AND_CLEAR", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL", "CommonVariable(v)" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL", "ensure_tuple(watch_explode)" ], [ "LOAD_FAST_AND_CLEAR", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL", "Exploding(v)" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "BINARY_OP", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_ATTR", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "CALL", " with self:\n return function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL", "method(incoming)" ], [ "STORE_FAST", "outgoing" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST_CHECK", "outgoing" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "LOAD_GLOBAL", "Exception" ], [ "STORE_FAST", " except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "STORE_FAST", "incoming" ], [ "STORE_FAST", "method" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_ATTR", "thread_global.__dict__.setdefault" ], [ "CALL", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "STORE_FAST", "stack" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL", "sys.gettrace()" ], [ "CALL", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "STORE_FAST", "stack" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.pop" ], [ "CALL", "stack.pop()" ], [ "CALL", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_ATTR", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_ATTR", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "CONTAINS_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "CONTAINS_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "candidate" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "STORE_FAST", "thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_ATTR", "thread_local.__dict__.setdefault" ], [ "CALL", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth += 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "STORE_FAST", "line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format_line_only(trace_event)" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL", "Event(frame_info, event, arg, thread_local.depth)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth -= 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format(trace_event)" ], [ "STORE_FAST", "formatted" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "STORE_NAME", " def __init__(self, config):\n self.config = config" ], [ "STORE_NAME", " def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator" ], [ "STORE_NAME", " def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "STORE_FAST", "import birdseye" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "self._trace(args[0])" ], [ "STORE_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "STORE_FAST", "from birdseye import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL", "eye(func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL", "self.config.snoop(*args, **kwargs)(traced)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "final_func" ], [ "LOAD_DEREF", "func" ], [ "STORE_FAST", "final_func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.13.json000066400000000000000000002417501474076367500245320ustar00rootroot00000000000000[ [ "STORE_NAME", "import functools" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import re" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "import threading" ], [ "STORE_NAME", "from collections import OrderedDict" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, find_repr_function" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \\\n truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .formatting import Event, Source" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "STORE_NAME", "from .variables import CommonVariable, Exploding, BaseVariable" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "CALL", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "STORE_NAME", "class FrameInfo(object):\n def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''\n\n def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables\n\n def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL", "threading.local()" ], [ "STORE_NAME", "thread_global" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "STORE_NAME", "internal_directories" ], [ "STORE_NAME", "import birdseye" ], [ "LOAD_NAME", "internal_directories" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL", "os.path.dirname(birdseye.__file__)" ], [ "BINARY_OP", "internal_directories += (os.path.dirname(birdseye.__file__),)" ], [ "STORE_NAME", "internal_directories" ], [ "LOAD_NAME", "type" ], [ "CALL", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", "class TracerMeta(type):\n def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result\n\n def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)\n\n def __enter__(self):\n return self.default.__enter__(context=1)\n\n def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "CALL", "six.add_metaclass(TracerMeta)" ], [ "STORE_NAME", "@six.add_metaclass(TracerMeta)\nclass Tracer(object):\n def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()\n\n def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper\n\n def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)\n\n def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)\n\n def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)\n \n def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames\n\n def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_NAME", "object" ], [ "CALL", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_NAME", "class Spy(object):\n def __init__(self, config):\n self.config = config\n\n def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator\n\n def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", " def __init__(self, frame):\n self.frame = frame\n self.local_reprs = {}\n self.last_line_no = frame.f_lineno\n self.comprehension_variables = OrderedDict()\n self.source = Source.for_frame(frame)\n self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR\n self.had_exception = False\n if is_comprehension_frame(frame):\n self.comprehension_type = (\n re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'\n )\n else:\n self.comprehension_type = ''" ], [ "STORE_NAME", " def update_variables(self, watch, watch_extras, event):\n self.last_line_no = self.frame.f_lineno\n old_local_reprs = self.local_reprs\n self.local_reprs = OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )\n\n if self.comprehension_type:\n for name, value_repr in self.local_reprs.items():\n values = self.comprehension_variables.setdefault(name, [])\n if not values or values[-1] != value_repr:\n values.append(value_repr)\n values[:] = truncate_list(values, 11)\n if event in ('return', 'exception'):\n return [\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]\n else:\n return []\n\n variables = []\n for name, value_repr in self.local_reprs.items():\n if name not in old_local_reprs or old_local_reprs[name] != value_repr:\n variables.append((name, value_repr))\n return variables" ], [ "STORE_NAME", " def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "STORE_NAME", " def get_local_reprs(self, watch, watch_extras):\n frame = self.frame\n code = frame.f_code\n vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())\n\n result_items = sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )\n\n for variable in watch:\n result_items += sorted(variable.items(frame))\n\n for source, value in result_items:\n yield source, value\n for extra in watch_extras:\n try:\n pair = extra(source, value)\n except Exception:\n pass\n else:\n if pair is not None:\n assert len(pair) == 2, \"Watch extra must return pair or None\"\n yield pair" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_OP", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_OP", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "STORE_FAST", "old_local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_local_reprs" ], [ "CALL", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "CALL", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL", "self.comprehension_variables.setdefault(name, [])" ], [ "STORE_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_ATTR", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SLICE", "values[:]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.items" ], [ "CALL", "self.comprehension_variables.items()" ], [ "LOAD_FAST_AND_CLEAR", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "LOAD_FAST_AND_CLEAR", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL", "', '.join(values)" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL", "self.local_reprs.items()" ], [ "CONTAINS_OP", "name not in old_local_reprs" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_ATTR", "variables.append" ], [ "CALL", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "STORE_FAST", "[\n (name, ', '.join(values))\n for name, values in self.comprehension_variables.items()\n ]" ], [ "LOAD_FAST", "(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL", "my_cheap_repr(value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "STORE_FAST", "frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "STORE_FAST", "code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.keys" ], [ "CALL", "frame.f_locals.keys()" ], [ "CALL", "tuple(frame.f_locals.keys())" ], [ "BINARY_OP", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "STORE_DEREF", "vars_order" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.items" ], [ "CALL", "frame.f_locals.items()" ], [ "LOAD_FAST", "lambda key_value: vars_order.index(key_value[0])" ], [ "CALL_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "watch" ], [ "STORE_FAST", "variable" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_ATTR", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL", "variable.items(frame)" ], [ "CALL", "sorted(variable.items(frame))" ], [ "BINARY_OP", "result_items += sorted(variable.items(frame))" ], [ "STORE_FAST", "result_items" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "watch_extras" ], [ "STORE_FAST", "extra" ], [ "LOAD_FAST", "extra" ], [ "CALL", "extra(source, value)" ], [ "STORE_FAST", "pair" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_ATTR", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL", "vars_order.index(key_value[0])" ], [ "STORE_NAME", " def __new__(mcs, *args, **kwargs):\n result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)\n result.default = result()\n return result" ], [ "STORE_NAME", " def __call__(cls, *args, **kwargs):\n if no_args_decorator(args, kwargs):\n return cls.default(args[0])\n else:\n return super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "STORE_NAME", " def __enter__(self):\n return self.default.__enter__(context=1)" ], [ "STORE_NAME", " def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", " def __exit__(self, *args):\n return self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_SUPER_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "CALL", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "LOAD_SUPER_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "STORE_NAME", " def __init__(\n self,\n watch=(),\n watch_explode=(),\n depth=1,\n ):\n self.watch = [\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]\n self.frame_infos = ArgDefaultDict(FrameInfo)\n self.depth = depth\n assert self.depth >= 1\n self.target_codes = set()\n self.target_frames = set()" ], [ "STORE_NAME", " def __call__(self, function):\n if iscoroutinefunction(function):\n raise NotImplementedError(\"coroutines are not supported, sorry!\")\n\n self.target_codes.add(function.__code__)\n\n @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)\n\n @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e\n\n if inspect.isgeneratorfunction(function):\n return generator_wrapper\n else:\n return simple_wrapper" ], [ "STORE_NAME", " def __enter__(self, context=0):\n if not self.config.enabled:\n return\n\n calling_frame = sys._getframe(context + 1)\n if not self._is_internal_frame(calling_frame):\n calling_frame.f_trace = self.trace\n self.target_frames.add(calling_frame)\n self.config.last_frame = calling_frame\n self.trace(calling_frame, 'enter', None)\n\n stack = thread_global.__dict__.setdefault('original_trace_functions', [])\n stack.append(sys.gettrace())\n sys.settrace(self.trace)" ], [ "STORE_NAME", " def __exit__(self, exc_type, exc_value, exc_traceback, context=0):\n if not self.config.enabled:\n return\n\n stack = thread_global.original_trace_functions\n sys.settrace(stack.pop())\n calling_frame = sys._getframe(context + 1)\n self.trace(calling_frame, 'exit', None)\n self.target_frames.discard(calling_frame)\n self.frame_infos.pop(calling_frame, None)" ], [ "STORE_NAME", " def _is_internal_frame(self, frame):\n return frame.f_code.co_filename.startswith(internal_directories)" ], [ "STORE_NAME", " def _is_traced_frame(self, frame):\n return frame.f_code in self.target_codes or frame in self.target_frames" ], [ "STORE_NAME", " def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "STORE_NAME", " def trace(self, frame, event, arg):\n if not self._is_traced_frame(frame):\n if (\n self.depth == 1\n or self._is_internal_frame(frame)\n ) and not is_comprehension_frame(frame):\n return None\n else:\n candidate = frame\n i = 0\n while True:\n if is_comprehension_frame(candidate):\n candidate = candidate.f_back\n continue\n i += 1\n if self._is_traced_frame(candidate):\n break\n candidate = candidate.f_back\n if i >= self.depth or candidate is None or self._is_internal_frame(candidate):\n return None\n\n thread_local = self.config.thread_local\n thread_local.__dict__.setdefault('depth', -1)\n frame_info = self.frame_infos[frame]\n if event in ('call', 'enter'):\n thread_local.depth += 1\n elif self.config.last_frame and self.config.last_frame is not frame:\n line_no = frame_info.last_line_no\n trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no)\n line = self.config.formatter.format_line_only(trace_event)\n self.config.write(line)\n\n if event == 'exception':\n frame_info.had_exception = True\n\n self.config.last_frame = frame\n\n trace_event = Event(frame_info, event, arg, thread_local.depth)\n if not (frame.f_code.co_name == '' and event not in ('return', 'exception')):\n trace_event.variables = frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )\n\n if event in ('return', 'exit'):\n del self.frame_infos[frame]\n thread_local.depth -= 1\n\n formatted = self.config.formatter.format(trace_event)\n self.config.write(formatted)\n\n return self.trace" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL", "ensure_tuple(watch)" ], [ "LOAD_FAST_AND_CLEAR", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL", "CommonVariable(v)" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL", "ensure_tuple(watch_explode)" ], [ "LOAD_FAST_AND_CLEAR", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "STORE_FAST", "v" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL", "Exploding(v)" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "BINARY_OP", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ]" ], [ "STORE_FAST", "[\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_ATTR", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "LOAD_FAST", " @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)" ], [ "LOAD_FAST", " @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def simple_wrapper(*args, **kwargs):\n with self:\n return function(*args, **kwargs)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL", "functools.wraps(function)" ], [ "LOAD_FAST", " @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_FAST", " @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e" ], [ "CALL", "functools.wraps(function)" ], [ "STORE_FAST", " @functools.wraps(function)\n def generator_wrapper(*args, **kwargs):\n gen = function(*args, **kwargs)\n method, incoming = gen.send, None\n while True:\n with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return\n try:\n method, incoming = gen.send, (yield outgoing)\n except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "CALL", " with self:\n return function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "STORE_FAST", "gen" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL", "method(incoming)" ], [ "STORE_FAST", "outgoing" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST_CHECK", "outgoing" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "CALL", " with self:\n try:\n outgoing = method(incoming)\n except StopIteration:\n return" ], [ "LOAD_GLOBAL", "Exception" ], [ "STORE_FAST", " except Exception as e:\n method, incoming = gen.throw, e" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.add(calling_frame)" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_ATTR", "thread_global.__dict__.setdefault" ], [ "CALL", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "STORE_FAST", "stack" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL", "sys.gettrace()" ], [ "CALL", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "STORE_FAST", "stack" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.pop" ], [ "CALL", "stack.pop()" ], [ "CALL", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_OP", "context + 1" ], [ "CALL", "sys._getframe(context + 1)" ], [ "STORE_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_ATTR", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_ATTR", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "CONTAINS_OP", "frame.f_code in self.target_codes" ], [ "LOAD_ATTR", "self.target_frames" ], [ "CONTAINS_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "STORE_FAST", "candidate" ], [ "STORE_FAST", "i" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i += 1" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "STORE_FAST", "candidate" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "STORE_FAST", "thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_ATTR", "thread_local.__dict__.setdefault" ], [ "CALL", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "STORE_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth += 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "STORE_FAST", "line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format_line_only(trace_event)" ], [ "STORE_FAST", "line" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL", "Event(frame_info, event, arg, thread_local.depth)" ], [ "STORE_FAST", "trace_event" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "DELETE_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "BINARY_OP", "thread_local.depth -= 1" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL", "self.config.formatter.format(trace_event)" ], [ "STORE_FAST", "formatted" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "STORE_NAME", " def __init__(self, config):\n self.config = config" ], [ "STORE_NAME", " def __call__(self, *args, **kwargs):\n if NO_ASTTOKENS:\n raise Exception(\"birdseye doesn't support this version of Python\")\n\n try:\n import birdseye\n except ImportError:\n raise Exception(\"You must install birdseye separately to use spy: pip install birdseye\")\n\n # Decorator without parentheses\n if no_args_decorator(args, kwargs):\n return self._trace(args[0])\n\n # Decorator with parentheses and perhaps arguments\n def decorator(func):\n return self._trace(func, *args, **kwargs)\n\n return decorator" ], [ "STORE_NAME", " def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_NAME", " def _trace(self, func, *args, **kwargs):\n # noinspection PyUnresolvedReferences\n from birdseye import eye\n\n traced = eye(func)\n traced = self.config.snoop(*args, **kwargs)(traced)\n\n @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)\n\n return wrapper" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "STORE_FAST", "import birdseye" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "self._trace(args[0])" ], [ "LOAD_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "STORE_FAST", " def decorator(func):\n return self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "STORE_FAST", "from birdseye import eye" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL", "eye(func)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL", "self.config.snoop(*args, **kwargs)(traced)" ], [ "STORE_DEREF", "traced" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL", "functools.wraps(func)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "LOAD_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "CALL", "functools.wraps(func)" ], [ "STORE_FAST", " @functools.wraps(func)\n def wrapper(*func_args, **func_kwargs):\n if self.config.enabled:\n final_func = traced\n else:\n final_func = func\n\n return final_func(*func_args, **func_kwargs)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "STORE_FAST", "final_func" ], [ "LOAD_DEREF", "func" ], [ "STORE_FAST", "final_func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.5.json000066400000000000000000001137401474076367500244500ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_FUNCTION", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_FUNCTION", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "UNARY_NOT", "not values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_ATTR", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.items" ], [ "CALL_FUNCTION", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_ATTR", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.keys" ], [ "CALL_FUNCTION", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.items" ], [ "CALL_FUNCTION", "frame.f_locals.items()" ], [ "CALL_FUNCTION", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_ATTR", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_ATTR", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_FUNCTION", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_ATTR", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_FUNCTION", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_ATTR", "thread_global.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL_FUNCTION", "sys.gettrace()" ], [ "CALL_FUNCTION", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_FUNCTION", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.pop" ], [ "CALL_FUNCTION", "stack.pop()" ], [ "CALL_FUNCTION", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_ATTR", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_ATTR", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_FUNCTION", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "UNARY_NOT", "not is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_ATTR", "thread_local.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_FUNCTION", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_FUNCTION", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_VAR_KW", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.6.json000066400000000000000000001137141474076367500244520ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_ATTR", "threading.local" ], [ "CALL_FUNCTION", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_FUNCTION", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_FUNCTION", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_ATTR", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_ATTR", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_ATTR", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_FUNCTION", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_FUNCTION", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_FUNCTION", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "UNARY_NOT", "not values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_ATTR", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_ATTR", "self.comprehension_variables.items" ], [ "CALL_FUNCTION", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_ATTR", "self.local_reprs.items" ], [ "CALL_FUNCTION", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_ATTR", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_FUNCTION", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_ATTR", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.keys" ], [ "CALL_FUNCTION", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_ATTR", "frame.f_locals.items" ], [ "CALL_FUNCTION", "frame.f_locals.items()" ], [ "CALL_FUNCTION_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_ATTR", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_ATTR", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_FUNCTION", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_ATTR", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_ATTR", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_FUNCTION", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_ATTR", "thread_global.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.gettrace" ], [ "CALL_FUNCTION", "sys.gettrace()" ], [ "CALL_FUNCTION", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_FUNCTION", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_ATTR", "stack.pop" ], [ "CALL_FUNCTION", "stack.pop()" ], [ "CALL_FUNCTION", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_ATTR", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_FUNCTION", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_ATTR", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_ATTR", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_FUNCTION", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_ATTR", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_FUNCTION", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "UNARY_NOT", "not is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_ATTR", "thread_local.__dict__.setdefault" ], [ "CALL_FUNCTION", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_FUNCTION", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_ATTR", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_FUNCTION", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_FUNCTION", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_ATTR", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.7.json000066400000000000000000001135071474076367500244530ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.8.json000066400000000000000000001135071474076367500244540ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-py-3.9.json000066400000000000000000001134771474076367500244630ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOAD_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOAD_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOAD_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOAD_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOAD_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOAD_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOAD_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "CONTAINS_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOAD_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOAD_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOAD_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION_KW", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOAD_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "IS_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOAD_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOAD_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__enter__" ], [ "CALL_FUNCTION_KW", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_EX", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOAD_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOAD_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOAD_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOAD_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOAD_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOAD_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "CONTAINS_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "CONTAINS_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "IS_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOAD_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "IS_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION_KW", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "CONTAINS_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOAD_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_EX", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_EX", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOAD_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_EX", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-pypy-2.7.json000066400000000000000000001165721474076367500250300ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOOKUP_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOOKUP_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOOKUP_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SLICE+0", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "name" ], [ "LOOKUP_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOOKUP_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOOKUP_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOOKUP_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOOKUP_METHOD", "self.default.__enter__" ], [ "CALL_METHOD", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOOKUP_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOOKUP_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOOKUP_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOOKUP_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOOKUP_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOOKUP_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_VAR_KW", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-pypy-3.5.json000066400000000000000000001137051474076367500250220ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOOKUP_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOOKUP_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOOKUP_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOOKUP_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOOKUP_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOOKUP_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOOKUP_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOOKUP_METHOD", "self.default.__enter__" ], [ "CALL_METHOD", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOOKUP_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOOKUP_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOOKUP_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOOKUP_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOOKUP_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOOKUP_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_VAR_KW", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/tracer2-pypy-3.6.json000066400000000000000000001137051474076367500250230ustar00rootroot00000000000000[ [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.text_type" ], [ "CALL_FUNCTION", "find_repr_function(six.text_type)" ], [ "STORE_ATTR", "find_repr_function(six.text_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "six" ], [ "LOAD_ATTR", "six.binary_type" ], [ "CALL_FUNCTION", "find_repr_function(six.binary_type)" ], [ "STORE_ATTR", "find_repr_function(six.binary_type).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "find_repr_function(object)" ], [ "STORE_ATTR", "find_repr_function(object).maxparts" ], [ "LOAD_NAME", "find_repr_function" ], [ "LOAD_NAME", "int" ], [ "CALL_FUNCTION", "find_repr_function(int)" ], [ "STORE_ATTR", "find_repr_function(int).maxparts" ], [ "LOAD_NAME", "cheap_repr" ], [ "STORE_ATTR", "cheap_repr.suppression_threshold" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "threading" ], [ "LOOKUP_METHOD", "threading.local" ], [ "CALL_METHOD", "threading.local()" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_filename" ], [ "CALL_METHOD", "os.path.dirname((lambda: 0).__code__.co_filename)" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.dirname" ], [ "LOAD_NAME", "birdseye" ], [ "LOAD_ATTR", "birdseye.__file__" ], [ "CALL_METHOD", "os.path.dirname(birdseye.__file__)" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "six" ], [ "LOOKUP_METHOD", "six.add_metaclass" ], [ "LOAD_NAME", "TracerMeta" ], [ "CALL_METHOD", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "CALL_FUNCTION", "six.add_metaclass(TracerMeta)" ], [ "LOAD_NAME", "object" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "CALL_FUNCTION", "OrderedDict()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_variables" ], [ "LOAD_GLOBAL", "Source" ], [ "LOOKUP_METHOD", "Source.for_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "Source.for_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.source" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_flags" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.CO_GENERATOR" ], [ "BINARY_AND", "frame.f_code.co_flags & inspect.CO_GENERATOR" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.is_generator" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.had_exception" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_GLOBAL", "re" ], [ "LOOKUP_METHOD", "re.match" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1)" ], [ "LOOKUP_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title" ], [ "CALL_METHOD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()" ], [ "BINARY_ADD", "re.match(r'<(\\w+)comp>', frame.f_code.co_name).group(1).title()\n + u' comprehension'" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_ATTR", "self.frame.f_lineno" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.last_line_no" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOAD_GLOBAL", "OrderedDict" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.get_local_reprs" ], [ "LOAD_FAST", "watch" ], [ "LOAD_FAST", "watch_extras" ], [ "CALL_METHOD", "self.get_local_reprs(watch, watch_extras)" ], [ "CALL_FUNCTION", "OrderedDict(\n (source, my_cheap_repr(value))\n for source, value in\n self.get_local_reprs(watch, watch_extras)\n )" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.local_reprs" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_type" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.setdefault" ], [ "LOAD_FAST", "name" ], [ "CALL_METHOD", "self.comprehension_variables.setdefault(name, [])" ], [ "LOAD_FAST", "values" ], [ "LOAD_FAST", "values" ], [ "BINARY_SUBSCR", "values[-1]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "values[-1] != value_repr" ], [ "LOAD_FAST", "values" ], [ "LOOKUP_METHOD", "values.append" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "values.append(value_repr)" ], [ "LOAD_GLOBAL", "truncate_list" ], [ "LOAD_FAST", "values" ], [ "CALL_FUNCTION", "truncate_list(values, 11)" ], [ "LOAD_FAST", "values" ], [ "STORE_SUBSCR", "values[:]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exception')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.comprehension_variables" ], [ "LOOKUP_METHOD", "self.comprehension_variables.items" ], [ "CALL_METHOD", "self.comprehension_variables.items()" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.local_reprs" ], [ "LOOKUP_METHOD", "self.local_reprs.items" ], [ "CALL_METHOD", "self.local_reprs.items()" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "old_local_reprs" ], [ "COMPARE_OP", "name not in old_local_reprs" ], [ "LOAD_FAST", "old_local_reprs" ], [ "LOAD_FAST", "name" ], [ "BINARY_SUBSCR", "old_local_reprs[name]" ], [ "LOAD_FAST", "value_repr" ], [ "COMPARE_OP", "old_local_reprs[name] != value_repr" ], [ "LOAD_FAST", "variables" ], [ "LOOKUP_METHOD", "variables.append" ], [ "LOAD_FAST", "name" ], [ "LOAD_FAST", "value_repr" ], [ "CALL_METHOD", "variables.append((name, value_repr))" ], [ "LOAD_FAST", "variables" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "my_cheap_repr" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "my_cheap_repr(value)" ], [ "LOAD_FAST", "name" ], [ "LOOKUP_METHOD", "', '.join" ], [ "LOAD_FAST", "values" ], [ "CALL_METHOD", "', '.join(values)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_varnames" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_cellvars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_freevars" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.keys" ], [ "CALL_METHOD", "frame.f_locals.keys()" ], [ "CALL_FUNCTION", "tuple(frame.f_locals.keys())" ], [ "BINARY_ADD", "code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys())" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_locals" ], [ "LOOKUP_METHOD", "frame.f_locals.items" ], [ "CALL_METHOD", "frame.f_locals.items()" ], [ "CALL_FUNCTION", "sorted(\n frame.f_locals.items(),\n key=lambda key_value: vars_order.index(key_value[0])\n )" ], [ "LOAD_FAST", "watch" ], [ "LOAD_GLOBAL", "sorted" ], [ "LOAD_FAST", "variable" ], [ "LOOKUP_METHOD", "variable.items" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "variable.items(frame)" ], [ "CALL_FUNCTION", "sorted(variable.items(frame))" ], [ "LOAD_FAST", "result_items" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "LOAD_FAST", "watch_extras" ], [ "LOAD_FAST", "extra" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "value" ], [ "CALL_FUNCTION", "extra(source, value)" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "pair" ], [ "COMPARE_OP", "pair is not None" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "pair" ], [ "CALL_FUNCTION", "len(pair)" ], [ "COMPARE_OP", "len(pair) == 2" ], [ "LOAD_FAST", "pair" ], [ "LOAD_DEREF", "vars_order" ], [ "LOOKUP_METHOD", "vars_order.index" ], [ "LOAD_FAST", "key_value" ], [ "BINARY_SUBSCR", "key_value[0]" ], [ "CALL_METHOD", "vars_order.index(key_value[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "mcs" ], [ "CALL_FUNCTION", "super(TracerMeta, mcs)" ], [ "LOAD_ATTR", "super(TracerMeta, mcs).__new__" ], [ "LOAD_FAST", "mcs" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, mcs).__new__(mcs, *args, **kwargs)" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "result()" ], [ "LOAD_FAST", "result" ], [ "STORE_ATTR", "result.default" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_FAST", "cls" ], [ "LOOKUP_METHOD", "cls.default" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "cls.default(args[0])" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "TracerMeta" ], [ "LOAD_FAST", "cls" ], [ "CALL_FUNCTION", "super(TracerMeta, cls)" ], [ "LOAD_ATTR", "super(TracerMeta, cls).__call__" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "super(TracerMeta, cls).__call__(*args, **kwargs)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOOKUP_METHOD", "self.default.__enter__" ], [ "CALL_METHOD", "self.default.__enter__(context=1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.default" ], [ "LOAD_ATTR", "self.default.__exit__" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION_VAR", "self.default.__exit__(*args, context=1)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch" ], [ "CALL_FUNCTION", "ensure_tuple(watch)" ], [ "LOAD_GLOBAL", "ensure_tuple" ], [ "LOAD_FAST", "watch_explode" ], [ "CALL_FUNCTION", "ensure_tuple(watch_explode)" ], [ "BINARY_ADD", "[\n v if isinstance(v, BaseVariable) else CommonVariable(v)\n for v in ensure_tuple(watch)\n ] + [\n v if isinstance(v, BaseVariable) else Exploding(v)\n for v in ensure_tuple(watch_explode)\n ]" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.watch" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_GLOBAL", "FrameInfo" ], [ "CALL_FUNCTION", "ArgDefaultDict(FrameInfo)" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "depth" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth >= 1" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_codes" ], [ "LOAD_GLOBAL", "set" ], [ "CALL_FUNCTION", "set()" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.target_frames" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "CommonVariable" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "CommonVariable(v)" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "BaseVariable" ], [ "CALL_FUNCTION", "isinstance(v, BaseVariable)" ], [ "LOAD_FAST", "v" ], [ "LOAD_GLOBAL", "Exploding" ], [ "LOAD_FAST", "v" ], [ "CALL_FUNCTION", "Exploding(v)" ], [ "LOAD_GLOBAL", "iscoroutinefunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_FUNCTION", "iscoroutinefunction(function)" ], [ "LOAD_GLOBAL", "NotImplementedError" ], [ "CALL_FUNCTION", "NotImplementedError(\"coroutines are not supported, sorry!\")" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "LOOKUP_METHOD", "self.target_codes.add" ], [ "LOAD_DEREF", "function" ], [ "LOAD_ATTR", "function.__code__" ], [ "CALL_METHOD", "self.target_codes.add(function.__code__)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "functools.wraps(function)" ], [ "CALL_FUNCTION", "functools.wraps(function)" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isgeneratorfunction" ], [ "LOAD_DEREF", "function" ], [ "CALL_METHOD", "inspect.isgeneratorfunction(function)" ], [ "LOAD_FAST", "generator_wrapper" ], [ "LOAD_FAST", "simple_wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_DEREF", "function" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "function(*args, **kwargs)" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_DEREF", "self" ], [ "LOAD_FAST", "method" ], [ "LOAD_FAST", "incoming" ], [ "CALL_FUNCTION", "method(incoming)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.send" ], [ "LOAD_FAST", "outgoing" ], [ "LOAD_GLOBAL", "Exception" ], [ "LOAD_FAST", "gen" ], [ "LOAD_ATTR", "gen.throw" ], [ "LOAD_FAST", "e" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self._is_internal_frame(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "STORE_ATTR", "calling_frame.f_trace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.add" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.add(calling_frame)" ], [ "LOAD_FAST", "calling_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'enter', None)" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.__dict__" ], [ "LOOKUP_METHOD", "thread_global.__dict__.setdefault" ], [ "CALL_METHOD", "thread_global.__dict__.setdefault('original_trace_functions', [])" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.append" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.gettrace" ], [ "CALL_METHOD", "sys.gettrace()" ], [ "CALL_METHOD", "stack.append(sys.gettrace())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "CALL_METHOD", "sys.settrace(self.trace)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_GLOBAL", "thread_global" ], [ "LOAD_ATTR", "thread_global.original_trace_functions" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys.settrace" ], [ "LOAD_FAST", "stack" ], [ "LOOKUP_METHOD", "stack.pop" ], [ "CALL_METHOD", "stack.pop()" ], [ "CALL_METHOD", "sys.settrace(stack.pop())" ], [ "LOAD_GLOBAL", "sys" ], [ "LOOKUP_METHOD", "sys._getframe" ], [ "LOAD_FAST", "context" ], [ "BINARY_ADD", "context + 1" ], [ "CALL_METHOD", "sys._getframe(context + 1)" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.trace" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.trace(calling_frame, 'exit', None)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "LOOKUP_METHOD", "self.target_frames.discard" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.target_frames.discard(calling_frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOOKUP_METHOD", "self.frame_infos.pop" ], [ "LOAD_FAST", "calling_frame" ], [ "CALL_METHOD", "self.frame_infos.pop(calling_frame, None)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_filename" ], [ "LOOKUP_METHOD", "frame.f_code.co_filename.startswith" ], [ "LOAD_GLOBAL", "internal_directories" ], [ "CALL_METHOD", "frame.f_code.co_filename.startswith(internal_directories)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_codes" ], [ "COMPARE_OP", "frame.f_code in self.target_codes" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.target_frames" ], [ "COMPARE_OP", "frame in self.target_frames" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_traced_frame(frame)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "self.depth == 1" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_METHOD", "self._is_internal_frame(frame)" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "frame" ], [ "CALL_FUNCTION", "is_comprehension_frame(frame)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_GLOBAL", "is_comprehension_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_FUNCTION", "is_comprehension_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_traced_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_traced_frame(candidate)" ], [ "LOAD_FAST", "candidate" ], [ "LOAD_ATTR", "candidate.f_back" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.depth" ], [ "COMPARE_OP", "i >= self.depth" ], [ "LOAD_FAST", "candidate" ], [ "COMPARE_OP", "candidate is None" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self._is_internal_frame" ], [ "LOAD_FAST", "candidate" ], [ "CALL_METHOD", "self._is_internal_frame(candidate)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.thread_local" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.__dict__" ], [ "LOOKUP_METHOD", "thread_local.__dict__.setdefault" ], [ "CALL_METHOD", "thread_local.__dict__.setdefault('depth', -1)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "BINARY_SUBSCR", "self.frame_infos[frame]" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('call', 'enter')" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.last_frame" ], [ "LOAD_FAST", "frame" ], [ "COMPARE_OP", "self.config.last_frame is not frame" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_ATTR", "frame_info.last_line_no" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "line_no" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth, line_no=line_no)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format_line_only" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format_line_only(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "line" ], [ "CALL_METHOD", "self.config.write(line)" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event == 'exception'" ], [ "LOAD_FAST", "frame_info" ], [ "STORE_ATTR", "frame_info.had_exception" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "STORE_ATTR", "self.config.last_frame" ], [ "LOAD_GLOBAL", "Event" ], [ "LOAD_FAST", "frame_info" ], [ "LOAD_FAST", "event" ], [ "LOAD_FAST", "arg" ], [ "LOAD_FAST", "thread_local" ], [ "LOAD_ATTR", "thread_local.depth" ], [ "CALL_FUNCTION", "Event(frame_info, event, arg, thread_local.depth)" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name == ''" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event not in ('return', 'exception')" ], [ "LOAD_FAST", "frame_info" ], [ "LOOKUP_METHOD", "frame_info.update_variables" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.watch" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.watch_extras" ], [ "LOAD_FAST", "event" ], [ "CALL_METHOD", "frame_info.update_variables(\n self.watch,\n self.config.watch_extras,\n event,\n )" ], [ "LOAD_FAST", "trace_event" ], [ "STORE_ATTR", "trace_event.variables" ], [ "LOAD_FAST", "event" ], [ "COMPARE_OP", "event in ('return', 'exit')" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.frame_infos" ], [ "LOAD_FAST", "frame" ], [ "LOAD_FAST", "thread_local" ], [ "STORE_ATTR", "thread_local.depth" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.formatter" ], [ "LOOKUP_METHOD", "self.config.formatter.format" ], [ "LOAD_FAST", "trace_event" ], [ "CALL_METHOD", "self.config.formatter.format(trace_event)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOOKUP_METHOD", "self.config.write" ], [ "LOAD_FAST", "formatted" ], [ "CALL_METHOD", "self.config.write(formatted)" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.trace" ], [ "LOAD_FAST", "config" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.config" ], [ "LOAD_GLOBAL", "NO_ASTTOKENS" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"birdseye doesn't support this version of Python\")" ], [ "LOAD_GLOBAL", "ImportError" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"You must install birdseye separately to use spy: pip install birdseye\")" ], [ "LOAD_GLOBAL", "no_args_decorator" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION", "no_args_decorator(args, kwargs)" ], [ "LOAD_DEREF", "self" ], [ "LOOKUP_METHOD", "self._trace" ], [ "LOAD_DEREF", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "self._trace(args[0])" ], [ "LOAD_FAST", "decorator" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self._trace" ], [ "LOAD_FAST", "func" ], [ "LOAD_DEREF", "args" ], [ "LOAD_DEREF", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self._trace(func, *args, **kwargs)" ], [ "LOAD_FAST", "eye" ], [ "LOAD_DEREF", "func" ], [ "CALL_FUNCTION", "eye(func)" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.snoop" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "kwargs" ], [ "CALL_FUNCTION_VAR_KW", "self.config.snoop(*args, **kwargs)" ], [ "LOAD_DEREF", "traced" ], [ "CALL_FUNCTION", "self.config.snoop(*args, **kwargs)(traced)" ], [ "LOAD_GLOBAL", "functools" ], [ "LOOKUP_METHOD", "functools.wraps" ], [ "LOAD_DEREF", "func" ], [ "CALL_METHOD", "functools.wraps(func)" ], [ "CALL_FUNCTION", "functools.wraps(func)" ], [ "LOAD_FAST", "wrapper" ], [ "LOAD_DEREF", "self" ], [ "LOAD_ATTR", "self.config" ], [ "LOAD_ATTR", "self.config.enabled" ], [ "LOAD_DEREF", "traced" ], [ "LOAD_DEREF", "func" ], [ "LOAD_FAST", "final_func" ], [ "LOAD_FAST", "func_args" ], [ "LOAD_FAST", "func_kwargs" ], [ "CALL_FUNCTION_VAR_KW", "final_func(*func_args, **func_kwargs)" ] ]python-executing-2.2.0/tests/sample_results/utils-py-2.7.json000066400000000000000000000403531474076367500242460ustar00rootroot00000000000000[ [ "LOAD_NAME", "standard_library" ], [ "LOAD_ATTR", "standard_library.install_aliases" ], [ "CALL_FUNCTION", "standard_library.install_aliases()" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "version_info" ], [ "LOAD_ATTR", "version_info.major" ], [ "COMPARE_OP", "version_info.major == 2" ], [ "LOAD_NAME", "PY2" ], [ "UNARY_NOT", "not PY2" ], [ "LOAD_NAME", "TypeVar" ], [ "CALL_FUNCTION", "TypeVar('T')" ], [ "LOAD_NAME", "TypeVar" ], [ "CALL_FUNCTION", "TypeVar('RT')" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "unicode" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "PY2" ], [ "LOAD_NAME", "type" ], [ "LOAD_NAME", "json" ], [ "LOAD_ATTR", "json.JSONEncoder" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_GLOBAL", "ntpath" ], [ "LOAD_ATTR", "ntpath.split" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "ntpath.split(path)" ], [ "LOAD_FAST", "tail" ], [ "LOAD_GLOBAL", "ntpath" ], [ "LOAD_ATTR", "ntpath.basename" ], [ "LOAD_FAST", "head" ], [ "CALL_FUNCTION", "ntpath.basename(head)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.commonprefix" ], [ "LOAD_FAST", "paths" ], [ "CALL_FUNCTION", "os.path.commonprefix(paths)" ], [ "LOAD_GLOBAL", "ntpath" ], [ "LOAD_ATTR", "ntpath.split" ], [ "LOAD_FAST", "prefix" ], [ "CALL_FUNCTION", "ntpath.split(prefix)" ], [ "BINARY_SUBSCR", "ntpath.split(prefix)[0]" ], [ "LOAD_FAST", "paths" ], [ "BINARY_SUBSCR", "paths[0]" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "prefix" ], [ "CALL_FUNCTION", "len(prefix)" ], [ "BINARY_SUBSCR", "paths[0][len(prefix)]" ], [ "LOAD_FAST", "first_char_after" ], [ "COMPARE_OP", "first_char_after in r'\\/'" ], [ "LOAD_FAST", "first_char_after" ], [ "LOAD_FAST", "prefix" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "all_paths" ], [ "LOAD_FAST", "f" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "f != IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "f" ], [ "LOAD_GLOBAL", "common_ancestor" ], [ "LOAD_FAST", "all_paths" ], [ "CALL_FUNCTION", "common_ancestor(all_paths)" ], [ "LOAD_FAST", "prefix" ], [ "COMPARE_OP", "prefix in r'\\/'" ], [ "LOAD_GLOBAL", "strip_required_prefix" ], [ "LOAD_FAST", "path" ], [ "LOAD_FAST", "prefix" ], [ "CALL_FUNCTION", "strip_required_prefix(path, prefix)" ], [ "LOAD_GLOBAL", "path_leaf" ], [ "LOAD_FAST", "path" ], [ "CALL_FUNCTION", "path_leaf(path)" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "IPYTHON_FILE_PATH" ], [ "COMPARE_OP", "path == IPYTHON_FILE_PATH" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.sep" ], [ "COMPARE_OP", "os.path.sep == '/'" ], [ "LOAD_FAST", "path" ], [ "LOAD_ATTR", "path.startswith" ], [ "CALL_FUNCTION", "path.startswith('/')" ], [ "UNARY_NOT", "not path.startswith('/')" ], [ "LOAD_FAST", "path" ], [ "BINARY_ADD", "'/' + path" ], [ "LOAD_FAST", "path" ], [ "LOAD_GLOBAL", "type" ], [ "LOAD_FAST", "obj" ], [ "CALL_FUNCTION", "type(obj)" ], [ "LOAD_FAST", "t" ], [ "LOAD_GLOBAL", "types" ], [ "LOAD_ATTR", "types.InstanceType" ], [ "COMPARE_OP", "t is types.InstanceType" ], [ "LOAD_FAST", "obj" ], [ "LOAD_ATTR", "obj.__class__" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "iterable" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_DEREF", "type_or_tuple" ], [ "CALL_FUNCTION", "isinstance(x, type_or_tuple)" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "next" ], [ "LOAD_FAST", "it" ], [ "CALL_FUNCTION", "next(it)" ], [ "LOAD_GLOBAL", "StopIteration" ], [ "LOAD_GLOBAL", "raise_from" ], [ "LOAD_GLOBAL", "RuntimeError" ], [ "LOAD_FAST", "e" ], [ "CALL_FUNCTION", "raise_from(RuntimeError, e)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "expression" ], [ "CALL_FUNCTION", "hasattr(expression, 'one_or_none')" ], [ "LOAD_FAST", "expression" ], [ "LOAD_ATTR", "expression.one_or_none" ], [ "CALL_FUNCTION", "expression.one_or_none()" ], [ "LOAD_FAST", "expression" ], [ "LOAD_ATTR", "expression.all" ], [ "CALL_FUNCTION", "expression.all()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "len(result)" ], [ "COMPARE_OP", "len(result) == 0" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "result" ], [ "CALL_FUNCTION", "len(result)" ], [ "COMPARE_OP", "len(result) == 1" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[0]" ], [ "LOAD_GLOBAL", "Exception" ], [ "CALL_FUNCTION", "Exception(\"There is more than one item returned for the supplied filter\")" ], [ "LOAD_FAST", "lst" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "CALL_FUNCTION", "isinstance(x, list)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.extend" ], [ "LOAD_GLOBAL", "flatten_list" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "flatten_list(x)" ], [ "CALL_FUNCTION", "result.extend(flatten_list(x))" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.append" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "result.append(x)" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "f" ], [ "LOAD_ATTR", "f.__code__" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_name" ], [ "LOAD_ATTR", "(lambda: 0).__code__" ], [ "LOAD_ATTR", "(lambda: 0).__code__.co_name" ], [ "COMPARE_OP", "code.co_name == (lambda: 0).__code__.co_name" ], [ "LOAD_FAST", "o" ], [ "LOAD_ATTR", "o.as_json" ], [ "LOAD_GLOBAL", "AttributeError" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ProtocolEncoder" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ProtocolEncoder, self)" ], [ "LOAD_ATTR", "super(ProtocolEncoder, self).default" ], [ "LOAD_FAST", "o" ], [ "CALL_FUNCTION", "super(ProtocolEncoder, self).default(o)" ], [ "LOAD_FAST", "method" ], [ "CALL_FUNCTION", "method()" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.open" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "io.open(filename, 'rb')" ], [ "LOAD_GLOBAL", "detect_encoding" ], [ "LOAD_FAST", "fp" ], [ "LOAD_ATTR", "fp.readline" ], [ "CALL_FUNCTION", "detect_encoding(fp.readline)" ], [ "LOAD_FAST", "fp" ], [ "LOAD_ATTR", "fp.seek" ], [ "CALL_FUNCTION", "fp.seek(0)" ], [ "LOAD_GLOBAL", "io" ], [ "LOAD_ATTR", "io.TextIOWrapper" ], [ "LOAD_FAST", "fp" ], [ "LOAD_FAST", "encoding" ], [ "LOAD_GLOBAL", "True" ], [ "CALL_FUNCTION", "io.TextIOWrapper(fp, encoding, line_buffering=True)" ], [ "LOAD_FAST", "text" ], [ "STORE_ATTR", "text.mode" ], [ "LOAD_FAST", "text" ], [ "LOAD_FAST", "fp" ], [ "LOAD_ATTR", "fp.close" ], [ "CALL_FUNCTION", "fp.close()" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "filename.endswith" ], [ "CALL_FUNCTION", "filename.endswith('.pyc')" ], [ "LOAD_FAST", "filename" ], [ "SLICE+2", "filename[:-1]" ], [ "LOAD_GLOBAL", "open_with_encoding_check" ], [ "LOAD_FAST", "filename" ], [ "CALL_FUNCTION", "open_with_encoding_check(filename)" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_GLOBAL", "enumerate" ], [ "LOAD_FAST", "f" ], [ "CALL_FUNCTION", "enumerate(f)" ], [ "LOAD_FAST", "i" ], [ "COMPARE_OP", "i < 2" ], [ "LOAD_FAST", "cookie_re" ], [ "LOAD_ATTR", "cookie_re.match" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "cookie_re.match(line)" ], [ "LOAD_FAST", "line" ], [ "CALL_FUNCTION", "''.join([\n '\\n' if i < 2 and cookie_re.match(line)\n else line\n for i, line in enumerate(f)\n ])" ], [ "LOAD_GLOBAL", "safe_next" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.get_tokens" ], [ "LOAD_FAST", "function_node" ], [ "CALL_FUNCTION", "tokens.get_tokens(function_node)" ], [ "CALL_FUNCTION", "safe_next(t for t in tokens.get_tokens(function_node)\n if t.string == 'def' and t.type == token.NAME)" ], [ "LOAD_FAST", "def_token" ], [ "LOAD_ATTR", "def_token.startpos" ], [ "LOAD_FAST", "tokens" ], [ "LOAD_ATTR", "tokens.text" ], [ "LOAD_FAST", "startpos" ], [ "LOAD_FAST", "function_node" ], [ "LOAD_ATTR", "function_node.last_token" ], [ "LOAD_ATTR", "function_node.last_token.endpos" ], [ "SLICE+3", "tokens.text[startpos:function_node.last_token.endpos]" ], [ "LOAD_ATTR", "tokens.text[startpos:function_node.last_token.endpos].rstrip" ], [ "CALL_FUNCTION", "tokens.text[startpos:function_node.last_token.endpos].rstrip()" ], [ "LOAD_FAST", "source" ], [ "LOAD_ATTR", "source.startswith" ], [ "CALL_FUNCTION", "source.startswith('def')" ], [ "LOAD_FAST", "startpos" ], [ "LOAD_FAST", "source" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.string" ], [ "COMPARE_OP", "t.string == 'def'" ], [ "LOAD_FAST", "t" ], [ "LOAD_ATTR", "t.type" ], [ "LOAD_GLOBAL", "token" ], [ "LOAD_ATTR", "token.NAME" ], [ "COMPARE_OP", "t.type == token.NAME" ], [ "LOAD_FAST", "t" ], [ "LOAD_FAST", "args" ], [ "LOAD_GLOBAL", "print" ], [ "LOAD_FAST", "arg" ], [ "CALL_FUNCTION", "print(arg)" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "LOAD_FAST", "args" ], [ "LOAD_FAST", "filename" ], [ "LOAD_ATTR", "filename.startswith" ], [ "CALL_FUNCTION", "filename.startswith(' str\n # http://stackoverflow.com/a/8384788/2482744\n head, tail = ntpath.split(path)\n return tail or ntpath.basename(head)" ], [ "STORE_NAME", "def common_ancestor(paths):\n # type: (List[str]) -> str\n \"\"\"\n Returns a path to a directory that contains all the given absolute paths\n \"\"\"\n prefix = os.path.commonprefix(paths)\n\n # Ensure that the prefix doesn't end in part of the name of a file/directory\n prefix = ntpath.split(prefix)[0]\n\n # Ensure that it ends with a slash\n first_char_after = paths[0][len(prefix)]\n if first_char_after in r'\\/':\n prefix += first_char_after\n\n return prefix" ], [ "STORE_NAME", "def short_path(path, all_paths):\n # type: (str, List[str]) -> str\n if path == IPYTHON_FILE_PATH:\n return path\n\n all_paths = [f for f in all_paths\n if f != IPYTHON_FILE_PATH]\n prefix = common_ancestor(all_paths)\n if prefix in r'\\/':\n prefix = ''\n return strip_required_prefix(path, prefix) or path_leaf(path)" ], [ "STORE_NAME", "def fix_abs_path(path):\n if path == IPYTHON_FILE_PATH:\n return path\n if os.path.sep == '/' and not path.startswith('/'):\n path = '/' + path\n return path" ], [ "LOAD_NAME", "PY2" ], [ "STORE_NAME", " def correct_type(obj):\n \"\"\"\n Returns the correct type of obj, regardless of __class__ assignment\n or old-style classes:\n\n >>> class A:\n ... pass\n ...\n ...\n ... class B(object):\n ... pass\n ...\n ...\n ... class C(object):\n ... __class__ = A\n ...\n >>> correct_type(A()) is A\n True\n >>> correct_type(B()) is B\n True\n >>> correct_type(C()) is C\n True\n \"\"\"\n t = type(obj)\n # noinspection PyUnresolvedReferences\n if t is types.InstanceType:\n return obj.__class__\n return t" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "correct_type" ], [ "STORE_NAME", "def of_type(type_or_tuple, iterable):\n # type: (Union[type, Tuple[Union[type, tuple], ...]], Iterable[Any]) -> Iterator[Any]\n return (x for x in iterable if isinstance(x, type_or_tuple))" ], [ "STORE_NAME", "def safe_next(it):\n # type: (Iterator[T]) -> T\n \"\"\"\n next() can raise a StopIteration which can cause strange bugs inside generators.\n \"\"\"\n try:\n return next(it)\n except StopIteration as e:\n raise_from(RuntimeError, e)\n raise" ], [ "STORE_NAME", "def one_or_none(expression):\n \"\"\"Performs a one_or_none on a sqlalchemy expression.\"\"\"\n if hasattr(expression, 'one_or_none'):\n return expression.one_or_none()\n result = expression.all()\n if len(result) == 0:\n return None\n elif len(result) == 1:\n return result[0]\n else:\n raise Exception(\"There is more than one item returned for the supplied filter\")" ], [ "STORE_NAME", "def flatten_list(lst):\n result = []\n for x in lst:\n if isinstance(x, list):\n result.extend(flatten_list(x))\n else:\n result.append(x)\n return result" ], [ "STORE_NAME", "def is_lambda(f):\n try:\n code = f.__code__\n except AttributeError:\n return False\n return code.co_name == (lambda: 0).__code__.co_name" ], [ "LOAD_NAME", "json" ], [ "LOAD_ATTR", "json.JSONEncoder" ], [ "CALL", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "from tokenize import open as open_with_encoding_check" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", "from lib2to3.pgen2.tokenize import detect_encoding" ], [ "STORE_NAME", "import io" ], [ "STORE_NAME", " def open_with_encoding_check(filename): # type: ignore\n \"\"\"Open a file in read only mode using the encoding detected by\n detect_encoding().\n \"\"\"\n fp = io.open(filename, 'rb')\n try:\n encoding, lines = detect_encoding(fp.readline)\n fp.seek(0)\n text = io.TextIOWrapper(fp, encoding, line_buffering=True)\n text.mode = 'r'\n return text\n except:\n fp.close()\n raise" ], [ "STORE_NAME", "def read_source_file(filename):\n from lib2to3.pgen2.tokenize import cookie_re\n\n if filename.endswith('.pyc'):\n filename = filename[:-1]\n\n with open_with_encoding_check(filename) as f:\n return ''.join([\n '\\n' if i < 2 and cookie_re.match(line)\n else line\n for i, line in enumerate(f)\n ])" ], [ "STORE_NAME", "def source_without_decorators(tokens, function_node):\n def_token = safe_next(t for t in tokens.get_tokens(function_node)\n if t.string == 'def' and t.type == token.NAME)\n\n startpos = def_token.startpos\n source = tokens.text[startpos:function_node.last_token.endpos].rstrip()\n assert source.startswith('def')\n\n return startpos, source" ], [ "STORE_NAME", "def prn(*args):\n for arg in args:\n print(arg)\n if len(args) == 1:\n return args[0]\n return args" ], [ "STORE_NAME", "def is_ipython_cell(filename):\n return filename.startswith(' str\n # http://stackoverflow.com/a/8384788/2482744\n head, tail = ntpath.split(path)\n return tail or ntpath.basename(head)" ], [ "STORE_NAME", "def common_ancestor(paths):\n # type: (List[str]) -> str\n \"\"\"\n Returns a path to a directory that contains all the given absolute paths\n \"\"\"\n prefix = os.path.commonprefix(paths)\n\n # Ensure that the prefix doesn't end in part of the name of a file/directory\n prefix = ntpath.split(prefix)[0]\n\n # Ensure that it ends with a slash\n first_char_after = paths[0][len(prefix)]\n if first_char_after in r'\\/':\n prefix += first_char_after\n\n return prefix" ], [ "STORE_NAME", "def short_path(path, all_paths):\n # type: (str, List[str]) -> str\n if path == IPYTHON_FILE_PATH:\n return path\n\n all_paths = [f for f in all_paths\n if f != IPYTHON_FILE_PATH]\n prefix = common_ancestor(all_paths)\n if prefix in r'\\/':\n prefix = ''\n return strip_required_prefix(path, prefix) or path_leaf(path)" ], [ "STORE_NAME", "def fix_abs_path(path):\n if path == IPYTHON_FILE_PATH:\n return path\n if os.path.sep == '/' and not path.startswith('/'):\n path = '/' + path\n return path" ], [ "LOAD_NAME", "PY2" ], [ "STORE_NAME", " def correct_type(obj):\n \"\"\"\n Returns the correct type of obj, regardless of __class__ assignment\n or old-style classes:\n\n >>> class A:\n ... pass\n ...\n ...\n ... class B(object):\n ... pass\n ...\n ...\n ... class C(object):\n ... __class__ = A\n ...\n >>> correct_type(A()) is A\n True\n >>> correct_type(B()) is B\n True\n >>> correct_type(C()) is C\n True\n \"\"\"\n t = type(obj)\n # noinspection PyUnresolvedReferences\n if t is types.InstanceType:\n return obj.__class__\n return t" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "correct_type" ], [ "STORE_NAME", "def of_type(type_or_tuple, iterable):\n # type: (Union[type, Tuple[Union[type, tuple], ...]], Iterable[Any]) -> Iterator[Any]\n return (x for x in iterable if isinstance(x, type_or_tuple))" ], [ "STORE_NAME", "def safe_next(it):\n # type: (Iterator[T]) -> T\n \"\"\"\n next() can raise a StopIteration which can cause strange bugs inside generators.\n \"\"\"\n try:\n return next(it)\n except StopIteration as e:\n raise_from(RuntimeError, e)\n raise" ], [ "STORE_NAME", "def one_or_none(expression):\n \"\"\"Performs a one_or_none on a sqlalchemy expression.\"\"\"\n if hasattr(expression, 'one_or_none'):\n return expression.one_or_none()\n result = expression.all()\n if len(result) == 0:\n return None\n elif len(result) == 1:\n return result[0]\n else:\n raise Exception(\"There is more than one item returned for the supplied filter\")" ], [ "STORE_NAME", "def flatten_list(lst):\n result = []\n for x in lst:\n if isinstance(x, list):\n result.extend(flatten_list(x))\n else:\n result.append(x)\n return result" ], [ "STORE_NAME", "def is_lambda(f):\n try:\n code = f.__code__\n except AttributeError:\n return False\n return code.co_name == (lambda: 0).__code__.co_name" ], [ "LOAD_NAME", "json" ], [ "LOAD_ATTR", "json.JSONEncoder" ], [ "CALL", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "from tokenize import open as open_with_encoding_check" ], [ "STORE_NAME", "def read_source_file(filename):\n from lib2to3.pgen2.tokenize import cookie_re\n\n if filename.endswith('.pyc'):\n filename = filename[:-1]\n\n with open_with_encoding_check(filename) as f:\n return ''.join([\n '\\n' if i < 2 and cookie_re.match(line)\n else line\n for i, line in enumerate(f)\n ])" ], [ "STORE_NAME", "def source_without_decorators(tokens, function_node):\n def_token = safe_next(t for t in tokens.get_tokens(function_node)\n if t.string == 'def' and t.type == token.NAME)\n\n startpos = def_token.startpos\n source = tokens.text[startpos:function_node.last_token.endpos].rstrip()\n assert source.startswith('def')\n\n return startpos, source" ], [ "STORE_NAME", "def prn(*args):\n for arg in args:\n print(arg)\n if len(args) == 1:\n return args[0]\n return args" ], [ "STORE_NAME", "def is_ipython_cell(filename):\n return filename.startswith(' str\n # http://stackoverflow.com/a/8384788/2482744\n head, tail = ntpath.split(path)\n return tail or ntpath.basename(head)" ], [ "STORE_NAME", "def common_ancestor(paths):\n # type: (List[str]) -> str\n \"\"\"\n Returns a path to a directory that contains all the given absolute paths\n \"\"\"\n prefix = os.path.commonprefix(paths)\n\n # Ensure that the prefix doesn't end in part of the name of a file/directory\n prefix = ntpath.split(prefix)[0]\n\n # Ensure that it ends with a slash\n first_char_after = paths[0][len(prefix)]\n if first_char_after in r'\\/':\n prefix += first_char_after\n\n return prefix" ], [ "STORE_NAME", "def short_path(path, all_paths):\n # type: (str, List[str]) -> str\n if path == IPYTHON_FILE_PATH:\n return path\n\n all_paths = [f for f in all_paths\n if f != IPYTHON_FILE_PATH]\n prefix = common_ancestor(all_paths)\n if prefix in r'\\/':\n prefix = ''\n return strip_required_prefix(path, prefix) or path_leaf(path)" ], [ "STORE_NAME", "def fix_abs_path(path):\n if path == IPYTHON_FILE_PATH:\n return path\n if os.path.sep == '/' and not path.startswith('/'):\n path = '/' + path\n return path" ], [ "LOAD_NAME", "PY2" ], [ "STORE_NAME", " def correct_type(obj):\n \"\"\"\n Returns the correct type of obj, regardless of __class__ assignment\n or old-style classes:\n\n >>> class A:\n ... pass\n ...\n ...\n ... class B(object):\n ... pass\n ...\n ...\n ... class C(object):\n ... __class__ = A\n ...\n >>> correct_type(A()) is A\n True\n >>> correct_type(B()) is B\n True\n >>> correct_type(C()) is C\n True\n \"\"\"\n t = type(obj)\n # noinspection PyUnresolvedReferences\n if t is types.InstanceType:\n return obj.__class__\n return t" ], [ "LOAD_NAME", "type" ], [ "STORE_NAME", "correct_type" ], [ "STORE_NAME", "def of_type(type_or_tuple, iterable):\n # type: (Union[type, Tuple[Union[type, tuple], ...]], Iterable[Any]) -> Iterator[Any]\n return (x for x in iterable if isinstance(x, type_or_tuple))" ], [ "STORE_NAME", "def safe_next(it):\n # type: (Iterator[T]) -> T\n \"\"\"\n next() can raise a StopIteration which can cause strange bugs inside generators.\n \"\"\"\n try:\n return next(it)\n except StopIteration as e:\n raise_from(RuntimeError, e)\n raise" ], [ "STORE_NAME", "def one_or_none(expression):\n \"\"\"Performs a one_or_none on a sqlalchemy expression.\"\"\"\n if hasattr(expression, 'one_or_none'):\n return expression.one_or_none()\n result = expression.all()\n if len(result) == 0:\n return None\n elif len(result) == 1:\n return result[0]\n else:\n raise Exception(\"There is more than one item returned for the supplied filter\")" ], [ "STORE_NAME", "def flatten_list(lst):\n result = []\n for x in lst:\n if isinstance(x, list):\n result.extend(flatten_list(x))\n else:\n result.append(x)\n return result" ], [ "STORE_NAME", "def is_lambda(f):\n try:\n code = f.__code__\n except AttributeError:\n return False\n return code.co_name == (lambda: 0).__code__.co_name" ], [ "LOAD_NAME", "json" ], [ "LOAD_ATTR", "json.JSONEncoder" ], [ "CALL", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "class ProtocolEncoder(json.JSONEncoder):\n def default(self, o):\n try:\n method = o.as_json\n except AttributeError:\n return super(ProtocolEncoder, self).default(o)\n else:\n return method()" ], [ "STORE_NAME", "from tokenize import open as open_with_encoding_check" ], [ "STORE_NAME", "def read_source_file(filename):\n from lib2to3.pgen2.tokenize import cookie_re\n\n if filename.endswith('.pyc'):\n filename = filename[:-1]\n\n with open_with_encoding_check(filename) as f:\n return ''.join([\n '\\n' if i < 2 and cookie_re.match(line)\n else line\n for i, line in enumerate(f)\n ])" ], [ "STORE_NAME", "def source_without_decorators(tokens, function_node):\n def_token = safe_next(t for t in tokens.get_tokens(function_node)\n if t.string == 'def' and t.type == token.NAME)\n\n startpos = def_token.startpos\n source = tokens.text[startpos:function_node.last_token.endpos].rstrip()\n assert source.startswith('def')\n\n return startpos, source" ], [ "STORE_NAME", "def prn(*args):\n for arg in args:\n print(arg)\n if len(args) == 1:\n return args[0]\n return args" ], [ "STORE_NAME", "def is_ipython_cell(filename):\n return filename.startswith(' max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "SLICE+2", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "SLICE+1", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.replace" ], [ "CALL_FUNCTION", "x.replace(',', ' ')" ], [ "LOAD_ATTR", "x.replace(',', ' ').split" ], [ "CALL_FUNCTION", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_FUNCTION", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.endswith" ], [ "CALL_FUNCTION", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "SLICE+2", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_ATTR", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_ATTR", "super(ArgDefaultDict, self).__init__" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_ATTR", "x.__class__.__name__.lower" ], [ "CALL_FUNCTION", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_FUNCTION", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.10.json000066400000000000000000000376311474076367500244100ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "CONTAINS_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOAD_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "CONTAINS_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.11.json000066400000000000000000000561641474076367500244130ustar00rootroot00000000000000[ [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from itertools import chain" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "CONTAINS_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "STORE_NAME", "NO_ASTTOKENS" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "STORE_NAME", "file_reading_errors" ], [ "STORE_NAME", "def shitcode(s):\n return ''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_NAME", "def truncate(seq, max_length, middle):\n if len(seq) > max_length:\n left = (max_length - len(middle)) // 2\n right = max_length - len(middle) - left\n seq = seq[:left] + middle + seq[-right:]\n return seq" ], [ "STORE_NAME", "def truncate_string(string, max_length):\n return truncate(string, max_length, '...')" ], [ "STORE_NAME", "def truncate_list(lst, max_length):\n return truncate(lst, max_length, ['...'])" ], [ "STORE_NAME", "def ensure_tuple(x, split=False):\n if split and isinstance(x, six.string_types):\n x = x.replace(',', ' ').split()\n if not isinstance(x, (list, set, tuple)):\n x = (x,)\n return tuple(x)" ], [ "STORE_NAME", "def short_filename(code):\n result = os.path.basename(code.co_filename)\n if result.endswith('.pyc'):\n result = result[:-1]\n return result" ], [ "STORE_NAME", "def is_comprehension_frame(frame):\n return frame.f_code.co_name in ('', '', '')" ], [ "STORE_NAME", "def needs_parentheses(source):\n def code(s):\n return compile(s.format(source), '', 'eval').co_code\n\n try:\n without_parens = code('{}.x')\n except SyntaxError:\n # Likely a multiline expression that needs parentheses to be valid\n code('({})')\n return True\n else:\n return without_parens != code('({}).x')" ], [ "STORE_NAME", "def with_needed_parentheses(source):\n if needs_parentheses(source):\n return '({})'.format(source)\n else:\n return source" ], [ "STORE_NAME", "REPR_TARGET_LENGTH" ], [ "STORE_NAME", "def my_cheap_repr(x):\n return cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_NAME", "dict" ], [ "CALL", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "def optional_numeric_label(i, lst):\n if len(lst) == 1:\n return ''\n else:\n return ' ' + str(i + 1)" ], [ "STORE_NAME", "def is_pathlike(x):\n if hasattr(os, 'PathLike'):\n return isinstance(x, os.PathLike)\n\n return (\n hasattr(x, '__fspath__') or\n # Make a concession for older `pathlib` versions:\n (hasattr(x, 'open') and\n 'path' in x.__class__.__name__.lower())\n )" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "STORE_NAME", "iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "STORE_NAME", " def iscoroutinefunction(_):\n return False" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"__builtin__\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"builtins\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "STORE_NAME", "FormattedValue" ], [ "LOAD_NAME", "object" ], [ "CALL", " class FormattedValue(object):\n pass" ], [ "STORE_NAME", " class FormattedValue(object):\n pass" ], [ "STORE_NAME", "def no_args_decorator(args, kwargs):\n return len(args) == 1 and inspect.isfunction(args[0]) and not kwargs" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", "from backports.functools_lru_cache import lru_cache" ], [ "LOAD_NAME", "str" ], [ "CALL", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "CALL", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_FAST", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "BINARY_OP", "(max_length - len(middle)) // 2" ], [ "STORE_FAST", "left" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_OP", "max_length - len(middle) - left" ], [ "STORE_FAST", "right" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_OP", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_OP", "seq[:left] + middle + seq[-right:]" ], [ "STORE_FAST", "seq" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_METHOD", "x.replace" ], [ "CALL", "x.replace(',', ' ')" ], [ "LOAD_METHOD", "x.replace(',', ' ').split" ], [ "CALL", "x.replace(',', ' ').split()" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL", "os.path.basename(code.co_filename)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.endswith" ], [ "CALL", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "STORE_FAST", " def code(s):\n return compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('{}.x')" ], [ "STORE_FAST", "without_parens" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('({})')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL", "s.format(source)" ], [ "CALL", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL", "needs_parentheses(source)" ], [ "LOAD_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "STORE_NAME", " def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory" ], [ "STORE_NAME", " def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL", "super(ArgDefaultDict, self)" ], [ "LOAD_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL", "self.factory(key)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "CALL", "str(i + 1)" ], [ "BINARY_OP", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_METHOD", "x.__class__.__name__.lower" ], [ "CALL", "x.__class__.__name__.lower()" ], [ "CONTAINS_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "STORE_NAME", " def __repr__(self):\n return self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_METHOD", "x.index[i:i + 1].format" ], [ "CALL", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.12.json000066400000000000000000000560241474076367500244070ustar00rootroot00000000000000[ [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from itertools import chain" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SLICE", "sys.version_info[:2]" ], [ "CONTAINS_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "STORE_NAME", "NO_ASTTOKENS" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "STORE_NAME", "file_reading_errors" ], [ "STORE_NAME", "def shitcode(s):\n return ''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_NAME", "def truncate(seq, max_length, middle):\n if len(seq) > max_length:\n left = (max_length - len(middle)) // 2\n right = max_length - len(middle) - left\n seq = seq[:left] + middle + seq[-right:]\n return seq" ], [ "STORE_NAME", "def truncate_string(string, max_length):\n return truncate(string, max_length, '...')" ], [ "STORE_NAME", "def truncate_list(lst, max_length):\n return truncate(lst, max_length, ['...'])" ], [ "STORE_NAME", "def ensure_tuple(x, split=False):\n if split and isinstance(x, six.string_types):\n x = x.replace(',', ' ').split()\n if not isinstance(x, (list, set, tuple)):\n x = (x,)\n return tuple(x)" ], [ "STORE_NAME", "def short_filename(code):\n result = os.path.basename(code.co_filename)\n if result.endswith('.pyc'):\n result = result[:-1]\n return result" ], [ "STORE_NAME", "def is_comprehension_frame(frame):\n return frame.f_code.co_name in ('', '', '')" ], [ "STORE_NAME", "def needs_parentheses(source):\n def code(s):\n return compile(s.format(source), '', 'eval').co_code\n\n try:\n without_parens = code('{}.x')\n except SyntaxError:\n # Likely a multiline expression that needs parentheses to be valid\n code('({})')\n return True\n else:\n return without_parens != code('({}).x')" ], [ "STORE_NAME", "def with_needed_parentheses(source):\n if needs_parentheses(source):\n return '({})'.format(source)\n else:\n return source" ], [ "STORE_NAME", "REPR_TARGET_LENGTH" ], [ "STORE_NAME", "def my_cheap_repr(x):\n return cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_NAME", "dict" ], [ "CALL", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "def optional_numeric_label(i, lst):\n if len(lst) == 1:\n return ''\n else:\n return ' ' + str(i + 1)" ], [ "STORE_NAME", "def is_pathlike(x):\n if hasattr(os, 'PathLike'):\n return isinstance(x, os.PathLike)\n\n return (\n hasattr(x, '__fspath__') or\n # Make a concession for older `pathlib` versions:\n (hasattr(x, 'open') and\n 'path' in x.__class__.__name__.lower())\n )" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "STORE_NAME", "iscoroutinefunction" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"__builtin__\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "STORE_NAME", "FormattedValue" ], [ "STORE_NAME", "def no_args_decorator(args, kwargs):\n return len(args) == 1 and inspect.isfunction(args[0]) and not kwargs" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "LOAD_NAME", "str" ], [ "CALL", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "LOAD_NAME", "AttributeError" ], [ "STORE_NAME", " def iscoroutinefunction(_):\n return False" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"builtins\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "object" ], [ "CALL", " class FormattedValue(object):\n pass" ], [ "STORE_NAME", " class FormattedValue(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", "from backports.functools_lru_cache import lru_cache" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "CALL", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_FAST", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "BINARY_OP", "(max_length - len(middle)) // 2" ], [ "STORE_FAST", "left" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_OP", "max_length - len(middle) - left" ], [ "STORE_FAST", "right" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SLICE", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_OP", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SLICE", "seq[-right:]" ], [ "BINARY_OP", "seq[:left] + middle + seq[-right:]" ], [ "STORE_FAST", "seq" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.replace" ], [ "CALL", "x.replace(',', ' ')" ], [ "LOAD_ATTR", "x.replace(',', ' ').split" ], [ "CALL", "x.replace(',', ' ').split()" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL", "os.path.basename(code.co_filename)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.endswith" ], [ "CALL", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SLICE", "result[:-1]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "STORE_FAST", " def code(s):\n return compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('{}.x')" ], [ "STORE_FAST", "without_parens" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('({})')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL", "s.format(source)" ], [ "CALL", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL", "needs_parentheses(source)" ], [ "LOAD_ATTR", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "STORE_NAME", " def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory" ], [ "STORE_NAME", " def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(ArgDefaultDict, self).__init__" ], [ "CALL", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL", "self.factory(key)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "CALL", "str(i + 1)" ], [ "BINARY_OP", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_ATTR", "x.__class__.__name__.lower" ], [ "CALL", "x.__class__.__name__.lower()" ], [ "CONTAINS_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "STORE_NAME", " def __repr__(self):\n return self" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.13.json000066400000000000000000000544571474076367500244200ustar00rootroot00000000000000[ [ "STORE_NAME", "import ast" ], [ "STORE_NAME", "import inspect" ], [ "STORE_NAME", "import os" ], [ "STORE_NAME", "import sys" ], [ "STORE_NAME", "from itertools import chain" ], [ "STORE_NAME", "import six" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "STORE_NAME", "from cheap_repr import cheap_repr, try_register_repr" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SLICE", "sys.version_info[:2]" ], [ "CONTAINS_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "STORE_NAME", "NO_ASTTOKENS" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "STORE_NAME", "file_reading_errors" ], [ "STORE_NAME", "def shitcode(s):\n return ''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_NAME", "def truncate(seq, max_length, middle):\n if len(seq) > max_length:\n left = (max_length - len(middle)) // 2\n right = max_length - len(middle) - left\n seq = seq[:left] + middle + seq[-right:]\n return seq" ], [ "STORE_NAME", "def truncate_string(string, max_length):\n return truncate(string, max_length, '...')" ], [ "STORE_NAME", "def truncate_list(lst, max_length):\n return truncate(lst, max_length, ['...'])" ], [ "STORE_NAME", "def ensure_tuple(x, split=False):\n if split and isinstance(x, six.string_types):\n x = x.replace(',', ' ').split()\n if not isinstance(x, (list, set, tuple)):\n x = (x,)\n return tuple(x)" ], [ "STORE_NAME", "def short_filename(code):\n result = os.path.basename(code.co_filename)\n if result.endswith('.pyc'):\n result = result[:-1]\n return result" ], [ "STORE_NAME", "def is_comprehension_frame(frame):\n return frame.f_code.co_name in ('', '', '')" ], [ "STORE_NAME", "def needs_parentheses(source):\n def code(s):\n return compile(s.format(source), '', 'eval').co_code\n\n try:\n without_parens = code('{}.x')\n except SyntaxError:\n # Likely a multiline expression that needs parentheses to be valid\n code('({})')\n return True\n else:\n return without_parens != code('({}).x')" ], [ "STORE_NAME", "def with_needed_parentheses(source):\n if needs_parentheses(source):\n return '({})'.format(source)\n else:\n return source" ], [ "STORE_NAME", "REPR_TARGET_LENGTH" ], [ "STORE_NAME", "def my_cheap_repr(x):\n return cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_NAME", "dict" ], [ "CALL", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "class ArgDefaultDict(dict):\n def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory\n\n def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", "def optional_numeric_label(i, lst):\n if len(lst) == 1:\n return ''\n else:\n return ' ' + str(i + 1)" ], [ "STORE_NAME", "def is_pathlike(x):\n if hasattr(os, 'PathLike'):\n return isinstance(x, os.PathLike)\n\n return (\n hasattr(x, '__fspath__') or\n # Make a concession for older `pathlib` versions:\n (hasattr(x, 'open') and\n 'path' in x.__class__.__name__.lower())\n )" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "STORE_NAME", "iscoroutinefunction" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"__builtin__\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "STORE_NAME", "FormattedValue" ], [ "STORE_NAME", "def no_args_decorator(args, kwargs):\n return len(args) == 1 and inspect.isfunction(args[0]) and not kwargs" ], [ "STORE_NAME", "from functools import lru_cache" ], [ "LOAD_NAME", "str" ], [ "CALL", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "class DirectRepr(str):\n def __repr__(self):\n return self" ], [ "STORE_NAME", "from django.db.models import QuerySet" ], [ "STORE_NAME", "def _sample_indices(length, max_length):\n if length <= max_length + 2:\n return range(length)\n else:\n return chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "CALL", "try_register_repr('pandas', 'Series')" ], [ "STORE_NAME", "@try_register_repr('pandas', 'Series')\ndef _repr_series_one_line(x, helper):\n n = len(x)\n if n == 0:\n return repr(x)\n newlevel = helper.level - 1\n pieces = []\n maxparts = _repr_series_one_line.maxparts\n for i in _sample_indices(n, maxparts):\n k = x.index[i:i + 1].format(sparsify=False)[0]\n v = x.iloc[i]\n pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))\n if n > maxparts + 2:\n pieces.insert(maxparts // 2, '...')\n return '; '.join(pieces)" ], [ "LOAD_NAME", "AttributeError" ], [ "STORE_NAME", " def iscoroutinefunction(_):\n return False" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "STORE_NAME", "try_statement" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL", "__import__(\"builtins\")" ], [ "STORE_NAME", "builtins" ], [ "LOAD_NAME", "object" ], [ "CALL", " class FormattedValue(object):\n pass" ], [ "STORE_NAME", " class FormattedValue(object):\n pass" ], [ "LOAD_NAME", "ImportError" ], [ "STORE_NAME", "from backports.functools_lru_cache import lru_cache" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "CALL", " class QuerySet(object):\n pass" ], [ "STORE_NAME", " class QuerySet(object):\n pass" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "CALL", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_FAST", "(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "STORE_FAST", "c" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL", "ord(c)" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "COMPARE_OP", "0 < ord(c) < 256" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "BINARY_OP", "(max_length - len(middle)) // 2" ], [ "STORE_FAST", "left" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL", "len(middle)" ], [ "BINARY_OP", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_OP", "max_length - len(middle) - left" ], [ "STORE_FAST", "right" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SLICE", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_OP", "seq[:left] + middle" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SLICE", "seq[-right:]" ], [ "BINARY_OP", "seq[:left] + middle + seq[-right:]" ], [ "STORE_FAST", "seq" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "CALL", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "CALL", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.replace" ], [ "CALL", "x.replace(',', ' ')" ], [ "LOAD_ATTR", "x.replace(',', ' ').split" ], [ "CALL", "x.replace(',', ' ').split()" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "STORE_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL", "os.path.basename(code.co_filename)" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.endswith" ], [ "CALL", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SLICE", "result[:-1]" ], [ "STORE_FAST", "result" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", " def code(s):\n return compile(s.format(source), '', 'eval').co_code" ], [ "STORE_FAST", " def code(s):\n return compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('{}.x')" ], [ "STORE_FAST", "without_parens" ], [ "CALL", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL", "code('({})')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL", "s.format(source)" ], [ "CALL", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL", "needs_parentheses(source)" ], [ "LOAD_ATTR", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "STORE_NAME", " def __init__(self, factory):\n super(ArgDefaultDict, self).__init__()\n self.factory = factory" ], [ "STORE_NAME", " def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "STORE_NAME", " def __missing__(self, key):\n result = self[key] = self.factory(key)\n return result" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "LOAD_SUPER_ATTR", "super(ArgDefaultDict, self).__init__" ], [ "CALL", "super(ArgDefaultDict, self).__init__()" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL", "self.factory(key)" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_OP", "i + 1" ], [ "CALL", "str(i + 1)" ], [ "BINARY_OP", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_ATTR", "x.__class__.__name__.lower" ], [ "CALL", "x.__class__.__name__.lower()" ], [ "CONTAINS_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "STORE_NAME", " def __repr__(self):\n return self" ], [ "STORE_NAME", " def __repr__(self):\n return self" ], [ "LOAD_FAST", "self" ], [ "BINARY_OP", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_OP", "max_length // 2" ], [ "CALL", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "BINARY_OP", "max_length // 2" ], [ "BINARY_OP", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL", "range(length - max_length // 2,\n length)" ], [ "CALL", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL", "len(x)" ], [ "STORE_FAST", "n" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_OP", "helper.level - 1" ], [ "STORE_FAST", "newlevel" ], [ "STORE_FAST", "pieces" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "STORE_FAST", "maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "CALL", "_sample_indices(n, maxparts)" ], [ "STORE_FAST", "i" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "BINARY_OP", "i + 1" ], [ "BINARY_SLICE", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "STORE_FAST", "k" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "STORE_FAST", "v" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "CALL", "cheap_repr(v, newlevel)" ], [ "BUILD_STRING", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "BINARY_OP", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_OP", "maxparts // 2" ], [ "CALL", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL", "'; '.join(pieces)" ], [ "STORE_NAME", "pass" ], [ "STORE_NAME", "pass" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.5.json000066400000000000000000000376171474076367500243400ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL_FUNCTION", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.replace" ], [ "CALL_FUNCTION", "x.replace(',', ' ')" ], [ "LOAD_ATTR", "x.replace(',', ' ').split" ], [ "CALL_FUNCTION", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_FUNCTION", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.endswith" ], [ "CALL_FUNCTION", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_ATTR", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_ATTR", "super(ArgDefaultDict, self).__init__" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_ATTR", "x.__class__.__name__.lower" ], [ "CALL_FUNCTION", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.6.json000066400000000000000000000376251474076367500243400ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_ATTR", "sys.version.lower" ], [ "CALL_FUNCTION", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_ATTR", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_FUNCTION", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.replace" ], [ "CALL_FUNCTION", "x.replace(',', ' ')" ], [ "LOAD_ATTR", "x.replace(',', ' ').split" ], [ "CALL_FUNCTION", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_ATTR", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_FUNCTION", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_ATTR", "result.endswith" ], [ "CALL_FUNCTION", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_ATTR", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_FUNCTION", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_ATTR", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_ATTR", "super(ArgDefaultDict, self).__init__" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_ATTR", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_FUNCTION", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_ATTR", "x.__class__.__name__.lower" ], [ "CALL_FUNCTION", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_ATTR", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_FUNCTION", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_FUNCTION", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_ATTR", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_FUNCTION", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_ATTR", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_FUNCTION", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.7.json000066400000000000000000000376251474076367500243410ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOAD_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.8.json000066400000000000000000000376251474076367500243420ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOAD_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-py-3.9.json000066400000000000000000000376311474076367500243400ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOAD_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "CONTAINS_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "CONTAINS_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOAD_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOAD_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOAD_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOAD_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOAD_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "CONTAINS_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOAD_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOAD_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION_KW", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOAD_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOAD_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOAD_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "CONTAINS_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOAD_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOAD_ATTR", "x.index[i:i + 1].format" ], [ "CALL_FUNCTION_KW", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOAD_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOAD_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-pypy-2.7.json000066400000000000000000000412071474076367500247000ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "SLICE+2", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "False" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "SLICE+2", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "SLICE+1", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOOKUP_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOOKUP_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "SLICE+2", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_GLOBAL", "True" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOOKUP_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOOKUP_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOOKUP_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "False" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "SLICE+3", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "LOAD_GLOBAL", "False" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-pypy-3.5.json000066400000000000000000000376571474076367500247150ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOOKUP_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOOKUP_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOOKUP_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOOKUP_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOOKUP_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/sample_results/utils2-pypy-3.6.json000066400000000000000000000376571474076367500247160ustar00rootroot00000000000000[ [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version" ], [ "LOOKUP_METHOD", "sys.version.lower" ], [ "CALL_METHOD", "sys.version.lower()" ], [ "COMPARE_OP", "'pypy' in sys.version.lower()" ], [ "LOAD_NAME", "sys" ], [ "LOAD_ATTR", "sys.version_info" ], [ "BINARY_SUBSCR", "sys.version_info[:2]" ], [ "COMPARE_OP", "sys.version_info[:2] in [(3, 4), (3, 8)]" ], [ "LOAD_NAME", "IOError" ], [ "LOAD_NAME", "OSError" ], [ "LOAD_NAME", "ValueError" ], [ "LOAD_NAME", "dict" ], [ "LOAD_NAME", "inspect" ], [ "LOAD_ATTR", "inspect.iscoroutinefunction" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.Try" ], [ "LOAD_NAME", "AttributeError" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.TryExcept" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"__builtin__\")" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "__import__" ], [ "CALL_FUNCTION", "__import__(\"builtins\")" ], [ "LOAD_NAME", "ast" ], [ "LOAD_ATTR", "ast.FormattedValue" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "str" ], [ "LOAD_NAME", "ImportError" ], [ "LOAD_NAME", "object" ], [ "LOAD_NAME", "try_register_repr" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "CALL_FUNCTION", "try_register_repr('pandas', 'Series')" ], [ "LOOKUP_METHOD", "''.join" ], [ "LOAD_FAST", "s" ], [ "CALL_METHOD", "''.join(\n (c if (0 < ord(c) < 256) else '?') for c in s\n )" ], [ "LOAD_GLOBAL", "ord" ], [ "LOAD_FAST", "c" ], [ "CALL_FUNCTION", "ord(c)" ], [ "LOAD_FAST", "c" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "seq" ], [ "CALL_FUNCTION", "len(seq)" ], [ "LOAD_FAST", "max_length" ], [ "COMPARE_OP", "len(seq) > max_length" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "BINARY_FLOOR_DIVIDE", "(max_length - len(middle)) // 2" ], [ "LOAD_FAST", "max_length" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "middle" ], [ "CALL_FUNCTION", "len(middle)" ], [ "BINARY_SUBTRACT", "max_length - len(middle)" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBTRACT", "max_length - len(middle) - left" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "left" ], [ "BINARY_SUBSCR", "seq[:left]" ], [ "LOAD_FAST", "middle" ], [ "BINARY_ADD", "seq[:left] + middle" ], [ "LOAD_FAST", "seq" ], [ "LOAD_FAST", "right" ], [ "UNARY_NEGATIVE", "-right" ], [ "BINARY_SUBSCR", "seq[-right:]" ], [ "BINARY_ADD", "seq[:left] + middle + seq[-right:]" ], [ "LOAD_FAST", "seq" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "string" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(string, max_length, '...')" ], [ "LOAD_GLOBAL", "truncate" ], [ "LOAD_FAST", "lst" ], [ "LOAD_FAST", "max_length" ], [ "CALL_FUNCTION", "truncate(lst, max_length, ['...'])" ], [ "LOAD_FAST", "split" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "six" ], [ "LOAD_ATTR", "six.string_types" ], [ "CALL_FUNCTION", "isinstance(x, six.string_types)" ], [ "LOAD_FAST", "x" ], [ "LOOKUP_METHOD", "x.replace" ], [ "CALL_METHOD", "x.replace(',', ' ')" ], [ "LOOKUP_METHOD", "x.replace(',', ' ').split" ], [ "CALL_METHOD", "x.replace(',', ' ').split()" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "list" ], [ "LOAD_GLOBAL", "set" ], [ "LOAD_GLOBAL", "tuple" ], [ "CALL_FUNCTION", "isinstance(x, (list, set, tuple))" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "tuple" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "tuple(x)" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.path" ], [ "LOOKUP_METHOD", "os.path.basename" ], [ "LOAD_FAST", "code" ], [ "LOAD_ATTR", "code.co_filename" ], [ "CALL_METHOD", "os.path.basename(code.co_filename)" ], [ "LOAD_FAST", "result" ], [ "LOOKUP_METHOD", "result.endswith" ], [ "CALL_METHOD", "result.endswith('.pyc')" ], [ "LOAD_FAST", "result" ], [ "BINARY_SUBSCR", "result[:-1]" ], [ "LOAD_FAST", "result" ], [ "LOAD_FAST", "frame" ], [ "LOAD_ATTR", "frame.f_code" ], [ "LOAD_ATTR", "frame.f_code.co_name" ], [ "COMPARE_OP", "frame.f_code.co_name in ('', '', '')" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('{}.x')" ], [ "LOAD_GLOBAL", "SyntaxError" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({})')" ], [ "LOAD_FAST", "without_parens" ], [ "LOAD_FAST", "code" ], [ "CALL_FUNCTION", "code('({}).x')" ], [ "COMPARE_OP", "without_parens != code('({}).x')" ], [ "LOAD_GLOBAL", "compile" ], [ "LOAD_FAST", "s" ], [ "LOOKUP_METHOD", "s.format" ], [ "LOAD_DEREF", "source" ], [ "CALL_METHOD", "s.format(source)" ], [ "CALL_FUNCTION", "compile(s.format(source), '', 'eval')" ], [ "LOAD_ATTR", "compile(s.format(source), '', 'eval').co_code" ], [ "LOAD_GLOBAL", "needs_parentheses" ], [ "LOAD_FAST", "source" ], [ "CALL_FUNCTION", "needs_parentheses(source)" ], [ "LOOKUP_METHOD", "'({})'.format" ], [ "LOAD_FAST", "source" ], [ "CALL_METHOD", "'({})'.format(source)" ], [ "LOAD_FAST", "source" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "REPR_TARGET_LENGTH" ], [ "CALL_FUNCTION", "cheap_repr(x, target_length=REPR_TARGET_LENGTH)" ], [ "LOAD_GLOBAL", "super" ], [ "LOAD_GLOBAL", "ArgDefaultDict" ], [ "LOAD_FAST", "self" ], [ "CALL_FUNCTION", "super(ArgDefaultDict, self)" ], [ "LOOKUP_METHOD", "super(ArgDefaultDict, self).__init__" ], [ "CALL_METHOD", "super(ArgDefaultDict, self).__init__()" ], [ "LOAD_FAST", "factory" ], [ "LOAD_FAST", "self" ], [ "STORE_ATTR", "self.factory" ], [ "LOAD_FAST", "self" ], [ "LOOKUP_METHOD", "self.factory" ], [ "LOAD_FAST", "key" ], [ "CALL_METHOD", "self.factory(key)" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "key" ], [ "STORE_SUBSCR", "self[key]" ], [ "LOAD_FAST", "result" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "lst" ], [ "CALL_FUNCTION", "len(lst)" ], [ "COMPARE_OP", "len(lst) == 1" ], [ "LOAD_GLOBAL", "str" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "CALL_FUNCTION", "str(i + 1)" ], [ "BINARY_ADD", "' ' + str(i + 1)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_GLOBAL", "os" ], [ "CALL_FUNCTION", "hasattr(os, 'PathLike')" ], [ "LOAD_GLOBAL", "isinstance" ], [ "LOAD_FAST", "x" ], [ "LOAD_GLOBAL", "os" ], [ "LOAD_ATTR", "os.PathLike" ], [ "CALL_FUNCTION", "isinstance(x, os.PathLike)" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, '__fspath__')" ], [ "LOAD_GLOBAL", "hasattr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "hasattr(x, 'open')" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.__class__" ], [ "LOAD_ATTR", "x.__class__.__name__" ], [ "LOOKUP_METHOD", "x.__class__.__name__.lower" ], [ "CALL_METHOD", "x.__class__.__name__.lower()" ], [ "COMPARE_OP", "'path' in x.__class__.__name__.lower()" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "args" ], [ "CALL_FUNCTION", "len(args)" ], [ "COMPARE_OP", "len(args) == 1" ], [ "LOAD_GLOBAL", "inspect" ], [ "LOOKUP_METHOD", "inspect.isfunction" ], [ "LOAD_FAST", "args" ], [ "BINARY_SUBSCR", "args[0]" ], [ "CALL_METHOD", "inspect.isfunction(args[0])" ], [ "LOAD_FAST", "kwargs" ], [ "UNARY_NOT", "not kwargs" ], [ "LOAD_FAST", "self" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_ADD", "max_length + 2" ], [ "COMPARE_OP", "length <= max_length + 2" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length)" ], [ "LOAD_GLOBAL", "chain" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "CALL_FUNCTION", "range(max_length // 2)" ], [ "LOAD_GLOBAL", "range" ], [ "LOAD_FAST", "length" ], [ "LOAD_FAST", "max_length" ], [ "BINARY_FLOOR_DIVIDE", "max_length // 2" ], [ "BINARY_SUBTRACT", "length - max_length // 2" ], [ "LOAD_FAST", "length" ], [ "CALL_FUNCTION", "range(length - max_length // 2,\n length)" ], [ "CALL_FUNCTION", "chain(range(max_length // 2),\n range(length - max_length // 2,\n length))" ], [ "LOAD_GLOBAL", "len" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "len(x)" ], [ "LOAD_FAST", "n" ], [ "COMPARE_OP", "n == 0" ], [ "LOAD_GLOBAL", "repr" ], [ "LOAD_FAST", "x" ], [ "CALL_FUNCTION", "repr(x)" ], [ "LOAD_FAST", "helper" ], [ "LOAD_ATTR", "helper.level" ], [ "BINARY_SUBTRACT", "helper.level - 1" ], [ "LOAD_GLOBAL", "_repr_series_one_line" ], [ "LOAD_ATTR", "_repr_series_one_line.maxparts" ], [ "LOAD_GLOBAL", "_sample_indices" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "CALL_FUNCTION", "_sample_indices(n, maxparts)" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.index" ], [ "LOAD_FAST", "i" ], [ "LOAD_FAST", "i" ], [ "BINARY_ADD", "i + 1" ], [ "BINARY_SUBSCR", "x.index[i:i + 1]" ], [ "LOOKUP_METHOD", "x.index[i:i + 1].format" ], [ "CALL_METHOD", "x.index[i:i + 1].format(sparsify=False)" ], [ "BINARY_SUBSCR", "x.index[i:i + 1].format(sparsify=False)[0]" ], [ "LOAD_FAST", "x" ], [ "LOAD_ATTR", "x.iloc" ], [ "LOAD_FAST", "i" ], [ "BINARY_SUBSCR", "x.iloc[i]" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.append" ], [ "LOAD_FAST", "k" ], [ "LOAD_GLOBAL", "cheap_repr" ], [ "LOAD_FAST", "v" ], [ "LOAD_FAST", "newlevel" ], [ "CALL_FUNCTION", "cheap_repr(v, newlevel)" ], [ "BINARY_MODULO", "'%s = %s' % (k, cheap_repr(v, newlevel))" ], [ "CALL_METHOD", "pieces.append('%s = %s' % (k, cheap_repr(v, newlevel)))" ], [ "LOAD_FAST", "n" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_ADD", "maxparts + 2" ], [ "COMPARE_OP", "n > maxparts + 2" ], [ "LOAD_FAST", "pieces" ], [ "LOOKUP_METHOD", "pieces.insert" ], [ "LOAD_FAST", "maxparts" ], [ "BINARY_FLOOR_DIVIDE", "maxparts // 2" ], [ "CALL_METHOD", "pieces.insert(maxparts // 2, '...')" ], [ "LOOKUP_METHOD", "'; '.join" ], [ "LOAD_FAST", "pieces" ], [ "CALL_METHOD", "'; '.join(pieces)" ] ]python-executing-2.2.0/tests/samples/000077500000000000000000000000001474076367500176565ustar00rootroot00000000000000python-executing-2.2.0/tests/samples/_parser.py000066400000000000000000000541471474076367500216760ustar00rootroot00000000000000# SPDX-License-Identifier: MIT # SPDX-FileCopyrightText: 2021 Taneli Hukkinen # Licensed to PSF under a Contributor Agreement. from __future__ import annotations from collections.abc import Iterable import string from types import MappingProxyType from typing import Any, BinaryIO, NamedTuple from ._re import ( RE_DATETIME, RE_LOCALTIME, RE_NUMBER, match_to_datetime, match_to_localtime, match_to_number, ) from ._types import Key, ParseFloat, Pos ASCII_CTRL = frozenset(chr(i) for i in range(32)) | frozenset(chr(127)) # Neither of these sets include quotation mark or backslash. They are # currently handled as separate cases in the parser functions. ILLEGAL_BASIC_STR_CHARS = ASCII_CTRL - frozenset("\t") ILLEGAL_MULTILINE_BASIC_STR_CHARS = ASCII_CTRL - frozenset("\t\n") ILLEGAL_LITERAL_STR_CHARS = ILLEGAL_BASIC_STR_CHARS ILLEGAL_MULTILINE_LITERAL_STR_CHARS = ILLEGAL_MULTILINE_BASIC_STR_CHARS ILLEGAL_COMMENT_CHARS = ILLEGAL_BASIC_STR_CHARS TOML_WS = frozenset(" \t") TOML_WS_AND_NEWLINE = TOML_WS | frozenset("\n") BARE_KEY_CHARS = frozenset(string.ascii_letters + string.digits + "-_") KEY_INITIAL_CHARS = BARE_KEY_CHARS | frozenset("\"'") HEXDIGIT_CHARS = frozenset(string.hexdigits) BASIC_STR_ESCAPE_REPLACEMENTS = MappingProxyType( { "\\b": "\u0008", # backspace "\\t": "\u0009", # tab "\\n": "\u000A", # linefeed "\\f": "\u000C", # form feed "\\r": "\u000D", # carriage return '\\"': "\u0022", # quote "\\\\": "\u005C", # backslash } ) class TOMLDecodeError(ValueError): """An error raised if a document is not valid TOML.""" def load(fp: BinaryIO, /, *, parse_float: ParseFloat = float) -> dict[str, Any]: """Parse TOML from a binary file object.""" b = fp.read() try: s = b.decode() except AttributeError: raise TypeError( "File must be opened in binary mode, e.g. use `open('foo.toml', 'rb')`" ) from None return loads(s, parse_float=parse_float) def loads(s: str, /, *, parse_float: ParseFloat = float) -> dict[str, Any]: # noqa: C901 """Parse TOML from a string.""" # The spec allows converting "\r\n" to "\n", even in string # literals. Let's do so to simplify parsing. src = s.replace("\r\n", "\n") pos = 0 out = Output(NestedDict(), Flags()) header: Key = () parse_float = make_safe_parse_float(parse_float) # Parse one statement at a time # (typically means one line in TOML source) while True: # 1. Skip line leading whitespace pos = skip_chars(src, pos, TOML_WS) # 2. Parse rules. Expect one of the following: # - end of file # - end of line # - comment # - key/value pair # - append dict to list (and move to its namespace) # - create dict (and move to its namespace) # Skip trailing whitespace when applicable. try: char = src[pos] except IndexError: break if char == "\n": pos += 1 continue if char in KEY_INITIAL_CHARS: pos = key_value_rule(src, pos, out, header, parse_float) pos = skip_chars(src, pos, TOML_WS) elif char == "[": try: second_char: str | None = src[pos + 1] except IndexError: second_char = None out.flags.finalize_pending() if second_char == "[": pos, header = create_list_rule(src, pos, out) else: pos, header = create_dict_rule(src, pos, out) pos = skip_chars(src, pos, TOML_WS) elif char != "#": raise suffixed_err(src, pos, "Invalid statement") # 3. Skip comment pos = skip_comment(src, pos) # 4. Expect end of line or end of file try: char = src[pos] except IndexError: break if char != "\n": raise suffixed_err( src, pos, "Expected newline or end of document after a statement" ) pos += 1 return out.data.dict class Flags: """Flags that map to parsed keys/namespaces.""" # Marks an immutable namespace (inline array or inline table). FROZEN = 0 # Marks a nest that has been explicitly created and can no longer # be opened using the "[table]" syntax. EXPLICIT_NEST = 1 def __init__(self) -> None: self._flags: dict[str, dict] = {} self._pending_flags: set[tuple[Key, int]] = set() def add_pending(self, key: Key, flag: int) -> None: self._pending_flags.add((key, flag)) def finalize_pending(self) -> None: for key, flag in self._pending_flags: self.set(key, flag, recursive=False) self._pending_flags.clear() def unset_all(self, key: Key) -> None: cont = self._flags for k in key[:-1]: if k not in cont: return cont = cont[k]["nested"] cont.pop(key[-1], None) def set(self, key: Key, flag: int, *, recursive: bool) -> None: # noqa: A003 cont = self._flags key_parent, key_stem = key[:-1], key[-1] for k in key_parent: if k not in cont: cont[k] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont = cont[k]["nested"] if key_stem not in cont: cont[key_stem] = {"flags": set(), "recursive_flags": set(), "nested": {}} cont[key_stem]["recursive_flags" if recursive else "flags"].add(flag) def is_(self, key: Key, flag: int) -> bool: if not key: return False # document root has no flags cont = self._flags for k in key[:-1]: if k not in cont: return False inner_cont = cont[k] if flag in inner_cont["recursive_flags"]: return True cont = inner_cont["nested"] key_stem = key[-1] if key_stem in cont: cont = cont[key_stem] return flag in cont["flags"] or flag in cont["recursive_flags"] return False class NestedDict: def __init__(self) -> None: # The parsed content of the TOML document self.dict: dict[str, Any] = {} def get_or_create_nest( self, key: Key, *, access_lists: bool = True, ) -> dict: cont: Any = self.dict for k in key: if k not in cont: cont[k] = {} cont = cont[k] if access_lists and isinstance(cont, list): cont = cont[-1] if not isinstance(cont, dict): raise KeyError("There is no nest behind this key") return cont def append_nest_to_list(self, key: Key) -> None: cont = self.get_or_create_nest(key[:-1]) last_key = key[-1] if last_key in cont: list_ = cont[last_key] if not isinstance(list_, list): raise KeyError("An object other than list found behind this key") list_.append({}) else: cont[last_key] = [{}] class Output(NamedTuple): data: NestedDict flags: Flags def skip_chars(src: str, pos: Pos, chars: Iterable[str]) -> Pos: try: while src[pos] in chars: pos += 1 except IndexError: pass return pos def skip_until( src: str, pos: Pos, expect: str, *, error_on: frozenset[str], error_on_eof: bool, ) -> Pos: try: new_pos = src.index(expect, pos) except ValueError: new_pos = len(src) if error_on_eof: raise suffixed_err(src, new_pos, f"Expected {expect!r}") from None if not error_on.isdisjoint(src[pos:new_pos]): while src[pos] not in error_on: pos += 1 raise suffixed_err(src, pos, f"Found invalid character {src[pos]!r}") return new_pos def skip_comment(src: str, pos: Pos) -> Pos: try: char: str | None = src[pos] except IndexError: char = None if char == "#": return skip_until( src, pos + 1, "\n", error_on=ILLEGAL_COMMENT_CHARS, error_on_eof=False ) return pos def skip_comments_and_array_ws(src: str, pos: Pos) -> Pos: while True: pos_before_skip = pos pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) pos = skip_comment(src, pos) if pos == pos_before_skip: return pos def create_dict_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 1 # Skip "[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.EXPLICIT_NEST) or out.flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot declare {key} twice") out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.get_or_create_nest(key) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if not src.startswith("]", pos): raise suffixed_err(src, pos, "Expected ']' at the end of a table declaration") return pos + 1, key def create_list_rule(src: str, pos: Pos, out: Output) -> tuple[Pos, Key]: pos += 2 # Skip "[[" pos = skip_chars(src, pos, TOML_WS) pos, key = parse_key(src, pos) if out.flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot mutate immutable namespace {key}") # Free the namespace now that it points to another empty list item... out.flags.unset_all(key) # ...but this key precisely is still prohibited from table declaration out.flags.set(key, Flags.EXPLICIT_NEST, recursive=False) try: out.data.append_nest_to_list(key) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if not src.startswith("]]", pos): raise suffixed_err(src, pos, "Expected ']]' at the end of an array declaration") return pos + 2, key def key_value_rule( src: str, pos: Pos, out: Output, header: Key, parse_float: ParseFloat ) -> Pos: pos, key, value = parse_key_value_pair(src, pos, parse_float) key_parent, key_stem = key[:-1], key[-1] abs_key_parent = header + key_parent relative_path_cont_keys = (header + key[:i] for i in range(1, len(key))) for cont_key in relative_path_cont_keys: # Check that dotted key syntax does not redefine an existing table if out.flags.is_(cont_key, Flags.EXPLICIT_NEST): raise suffixed_err(src, pos, f"Cannot redefine namespace {cont_key}") # Containers in the relative path can't be opened with the table syntax or # dotted key/value syntax in following table sections. out.flags.add_pending(cont_key, Flags.EXPLICIT_NEST) if out.flags.is_(abs_key_parent, Flags.FROZEN): raise suffixed_err( src, pos, f"Cannot mutate immutable namespace {abs_key_parent}" ) try: nest = out.data.get_or_create_nest(abs_key_parent) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if key_stem in nest: raise suffixed_err(src, pos, "Cannot overwrite a value") # Mark inline table and array namespaces recursively immutable if isinstance(value, (dict, list)): out.flags.set(header + key, Flags.FROZEN, recursive=True) nest[key_stem] = value return pos def parse_key_value_pair( src: str, pos: Pos, parse_float: ParseFloat ) -> tuple[Pos, Key, Any]: pos, key = parse_key(src, pos) try: char: str | None = src[pos] except IndexError: char = None if char != "=": raise suffixed_err(src, pos, "Expected '=' after a key in a key/value pair") pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, value = parse_value(src, pos, parse_float) return pos, key, value def parse_key(src: str, pos: Pos) -> tuple[Pos, Key]: pos, key_part = parse_key_part(src, pos) key: Key = (key_part,) pos = skip_chars(src, pos, TOML_WS) while True: try: char: str | None = src[pos] except IndexError: char = None if char != ".": return pos, key pos += 1 pos = skip_chars(src, pos, TOML_WS) pos, key_part = parse_key_part(src, pos) key += (key_part,) pos = skip_chars(src, pos, TOML_WS) def parse_key_part(src: str, pos: Pos) -> tuple[Pos, str]: try: char: str | None = src[pos] except IndexError: char = None if char in BARE_KEY_CHARS: start_pos = pos pos = skip_chars(src, pos, BARE_KEY_CHARS) return pos, src[start_pos:pos] if char == "'": return parse_literal_str(src, pos) if char == '"': return parse_one_line_basic_str(src, pos) raise suffixed_err(src, pos, "Invalid initial character for a key part") def parse_one_line_basic_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 return parse_basic_str(src, pos, multiline=False) def parse_array(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, list]: pos += 1 array: list = [] pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array while True: pos, val = parse_value(src, pos, parse_float) array.append(val) pos = skip_comments_and_array_ws(src, pos) c = src[pos : pos + 1] if c == "]": return pos + 1, array if c != ",": raise suffixed_err(src, pos, "Unclosed array") pos += 1 pos = skip_comments_and_array_ws(src, pos) if src.startswith("]", pos): return pos + 1, array def parse_inline_table(src: str, pos: Pos, parse_float: ParseFloat) -> tuple[Pos, dict]: pos += 1 nested_dict = NestedDict() flags = Flags() pos = skip_chars(src, pos, TOML_WS) if src.startswith("}", pos): return pos + 1, nested_dict.dict while True: pos, key, value = parse_key_value_pair(src, pos, parse_float) key_parent, key_stem = key[:-1], key[-1] if flags.is_(key, Flags.FROZEN): raise suffixed_err(src, pos, f"Cannot mutate immutable namespace {key}") try: nest = nested_dict.get_or_create_nest(key_parent, access_lists=False) except KeyError: raise suffixed_err(src, pos, "Cannot overwrite a value") from None if key_stem in nest: raise suffixed_err(src, pos, f"Duplicate inline table key {key_stem!r}") nest[key_stem] = value pos = skip_chars(src, pos, TOML_WS) c = src[pos : pos + 1] if c == "}": return pos + 1, nested_dict.dict if c != ",": raise suffixed_err(src, pos, "Unclosed inline table") if isinstance(value, (dict, list)): flags.set(key, Flags.FROZEN, recursive=True) pos += 1 pos = skip_chars(src, pos, TOML_WS) def parse_basic_str_escape( src: str, pos: Pos, *, multiline: bool = False ) -> tuple[Pos, str]: escape_id = src[pos : pos + 2] pos += 2 if multiline and escape_id in {"\\ ", "\\\t", "\\\n"}: # Skip whitespace until next non-whitespace character or end of # the doc. Error if non-whitespace is found before newline. if escape_id != "\\\n": pos = skip_chars(src, pos, TOML_WS) try: char = src[pos] except IndexError: return pos, "" if char != "\n": raise suffixed_err(src, pos, "Unescaped '\\' in a string") pos += 1 pos = skip_chars(src, pos, TOML_WS_AND_NEWLINE) return pos, "" if escape_id == "\\u": return parse_hex_char(src, pos, 4) if escape_id == "\\U": return parse_hex_char(src, pos, 8) try: return pos, BASIC_STR_ESCAPE_REPLACEMENTS[escape_id] except KeyError: raise suffixed_err(src, pos, "Unescaped '\\' in a string") from None def parse_basic_str_escape_multiline(src: str, pos: Pos) -> tuple[Pos, str]: return parse_basic_str_escape(src, pos, multiline=True) def parse_hex_char(src: str, pos: Pos, hex_len: int) -> tuple[Pos, str]: hex_str = src[pos : pos + hex_len] if len(hex_str) != hex_len or not HEXDIGIT_CHARS.issuperset(hex_str): raise suffixed_err(src, pos, "Invalid hex value") pos += hex_len hex_int = int(hex_str, 16) if not is_unicode_scalar_value(hex_int): raise suffixed_err(src, pos, "Escaped character is not a Unicode scalar value") return pos, chr(hex_int) def parse_literal_str(src: str, pos: Pos) -> tuple[Pos, str]: pos += 1 # Skip starting apostrophe start_pos = pos pos = skip_until( src, pos, "'", error_on=ILLEGAL_LITERAL_STR_CHARS, error_on_eof=True ) return pos + 1, src[start_pos:pos] # Skip ending apostrophe def parse_multiline_str(src: str, pos: Pos, *, literal: bool) -> tuple[Pos, str]: pos += 3 if src.startswith("\n", pos): pos += 1 if literal: delim = "'" end_pos = skip_until( src, pos, "'''", error_on=ILLEGAL_MULTILINE_LITERAL_STR_CHARS, error_on_eof=True, ) result = src[pos:end_pos] pos = end_pos + 3 else: delim = '"' pos, result = parse_basic_str(src, pos, multiline=True) # Add at maximum two extra apostrophes/quotes if the end sequence # is 4 or 5 chars long instead of just 3. if not src.startswith(delim, pos): return pos, result pos += 1 if not src.startswith(delim, pos): return pos, result + delim pos += 1 return pos, result + (delim * 2) def parse_basic_str(src: str, pos: Pos, *, multiline: bool) -> tuple[Pos, str]: if multiline: error_on = ILLEGAL_MULTILINE_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape_multiline else: error_on = ILLEGAL_BASIC_STR_CHARS parse_escapes = parse_basic_str_escape result = "" start_pos = pos while True: try: char = src[pos] except IndexError: raise suffixed_err(src, pos, "Unterminated string") from None if char == '"': if not multiline: return pos + 1, result + src[start_pos:pos] if src.startswith('"""', pos): return pos + 3, result + src[start_pos:pos] pos += 1 continue if char == "\\": result += src[start_pos:pos] pos, parsed_escape = parse_escapes(src, pos) result += parsed_escape start_pos = pos continue if char in error_on: raise suffixed_err(src, pos, f"Illegal character {char!r}") pos += 1 def parse_value( # noqa: C901 src: str, pos: Pos, parse_float: ParseFloat ) -> tuple[Pos, Any]: try: char: str | None = src[pos] except IndexError: char = None # IMPORTANT: order conditions based on speed of checking and likelihood # Basic strings if char == '"': if src.startswith('"""', pos): return parse_multiline_str(src, pos, literal=False) return parse_one_line_basic_str(src, pos) # Literal strings if char == "'": if src.startswith("'''", pos): return parse_multiline_str(src, pos, literal=True) return parse_literal_str(src, pos) # Booleans if char == "t": if src.startswith("true", pos): return pos + 4, True if char == "f": if src.startswith("false", pos): return pos + 5, False # Arrays if char == "[": return parse_array(src, pos, parse_float) # Inline tables if char == "{": return parse_inline_table(src, pos, parse_float) # Dates and times datetime_match = RE_DATETIME.match(src, pos) if datetime_match: try: datetime_obj = match_to_datetime(datetime_match) except ValueError as e: raise suffixed_err(src, pos, "Invalid date or datetime") from e return datetime_match.end(), datetime_obj localtime_match = RE_LOCALTIME.match(src, pos) if localtime_match: return localtime_match.end(), match_to_localtime(localtime_match) # Integers and "normal" floats. # The regex will greedily match any type starting with a decimal # char, so needs to be located after handling of dates and times. number_match = RE_NUMBER.match(src, pos) if number_match: return number_match.end(), match_to_number(number_match, parse_float) # Special floats first_three = src[pos : pos + 3] if first_three in {"inf", "nan"}: return pos + 3, parse_float(first_three) first_four = src[pos : pos + 4] if first_four in {"-inf", "+inf", "-nan", "+nan"}: return pos + 4, parse_float(first_four) raise suffixed_err(src, pos, "Invalid value") def suffixed_err(src: str, pos: Pos, msg: str) -> TOMLDecodeError: """Return a `TOMLDecodeError` where error message is suffixed with coordinates in source.""" def coord_repr(src: str, pos: Pos) -> str: if pos >= len(src): return "end of document" line = src.count("\n", 0, pos) + 1 if line == 1: column = pos + 1 else: column = pos - src.rindex("\n", 0, pos) return f"line {line}, column {column}" return TOMLDecodeError(f"{msg} (at {coord_repr(src, pos)})") def is_unicode_scalar_value(codepoint: int) -> bool: return (0 <= codepoint <= 55295) or (57344 <= codepoint <= 1114111) def make_safe_parse_float(parse_float: ParseFloat) -> ParseFloat: """A decorator to make `parse_float` safe. `parse_float` must not return dicts or lists, because these types would be mixed with parsed TOML tables and arrays, thus confusing the parser. The returned decorated callable raises `ValueError` instead of returning illegal types. """ # The default `float` callable never returns illegal types. Optimize it. if parse_float is float: # type: ignore[comparison-overlap] return float def safe_parse_float(float_str: str) -> Any: float_value = parse_float(float_str) if isinstance(float_value, (dict, list)): raise ValueError("parse_float must not return dicts or lists") return float_value return safe_parse_float python-executing-2.2.0/tests/samples/bird.py000066400000000000000000001211141474076367500211500ustar00rootroot00000000000000from __future__ import absolute_import, division, print_function from future import standard_library standard_library.install_aliases() from future.utils import iteritems from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Iterable, Union, cast from types import FrameType, TracebackType, CodeType, FunctionType, ModuleType import typing import ast # noinspection PyCompatibility import html import inspect import json import os import traceback from collections import defaultdict, Sequence, Set, Mapping, deque, namedtuple, Counter from functools import partial from itertools import chain, islice from threading import Lock from uuid import uuid4 import hashlib import sys from asttokens import ASTTokens from littleutils import group_by_key_func, only from outdated import warn_if_outdated from cached_property import cached_property from cheap_repr import cheap_repr, try_register_repr from cheap_repr.utils import safe_qualname, exception_string from birdseye.db import Database, retry_db from birdseye.tracer import TreeTracerBase, TracedFile, EnterCallInfo, ExitCallInfo, FrameInfo, ChangeValue, Loop from birdseye import tracer from birdseye.utils import correct_type, PY3, PY2, one_or_none, \ of_type, Deque, Text, flatten_list, lru_cache, ProtocolEncoder, IPYTHON_FILE_PATH, source_without_decorators, \ is_future_import, get_unfrozen_datetime, FILE_SENTINEL_NAME, read_source_file from birdseye import __version__ try: from numpy import ndarray except ImportError: class ndarray(object): pass try: from pandas import DataFrame, Series except ImportError: class DataFrame(object): pass class Series(object): pass try: from django.db.models import QuerySet except ImportError: class QuerySet(object): pass warn_if_outdated('birdseye', __version__) CodeInfo = namedtuple('CodeInfo', 'db_func traced_file arg_names') class BirdsEye(TreeTracerBase): """ Decorate functions with an instance of this class to debug them, or just use the existing instance `eye`. """ def __init__(self, db_uri=None, num_samples=None): """ Set db_uri to specify where the database lives, as an alternative to the environment variable BIRDSEYE_DB. """ super(BirdsEye, self).__init__() self._db_uri = db_uri self._code_infos = {} # type: Dict[CodeType, CodeInfo] self._last_call_id = None self._ipython_cell_value = None self.num_samples = num_samples or dict( big=dict( attributes=50, dict=50, list=30, set=30, pandas_rows=20, pandas_cols=100, ), small=dict( attributes=50, dict=10, list=6, set=6, pandas_rows=6, pandas_cols=10, ), ) @cached_property def db(self): return Database(self._db_uri) def parse_extra(self, root, source, filename): # type: (ast.Module, str, str) -> None for node in ast.walk(root): # type: ast.AST node._loops = tracer.loops(node) if isinstance(node, ast.expr): node._is_interesting_expression = is_interesting_expression(node) @lru_cache() def compile(self, source, filename, flags=0): traced_file = super(BirdsEye, self).compile(source, filename, flags) traced_file.tokens = ASTTokens(source, tree=traced_file.root) return traced_file def before_stmt(self, node, frame): # type: (ast.stmt, FrameType) -> None if frame.f_code not in self._code_infos: return if isinstance(node.parent, ast.For) and node is node.parent.body[0]: self._add_iteration(node._loops, frame) def before_expr(self, node, frame): if isinstance(node.parent, ast.While) and node is node.parent.test: self._add_iteration(node._loops, frame) def _add_iteration(self, loops, frame): # type: (typing.Sequence[Loop], FrameType) -> None """ Given one or more nested loops, add an iteration for the innermost loop (the last in the sequence). """ iteration = self.stack[frame].iteration # type: Iteration for i, loop_node in enumerate(loops): loop = iteration.loops[loop_node._tree_index] if i == len(loops) - 1: loop.append(Iteration()) else: iteration = loop.last() def after_expr(self, node, frame, value, exc_value, exc_tb): # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue] if _tracing_recursively(frame): return None if frame.f_code not in self._code_infos: return None if node._is_interesting_expression: # If this is an expression statement and the last statement # in the body, the value is returned from the cell magic # to be displayed as usual if (self._code_infos[frame.f_code].traced_file.is_ipython_cell and isinstance(node.parent, ast.Expr) and node.parent is node.parent.parent.body[-1]): self._ipython_cell_value = value if is_obvious_builtin(node, self.stack[frame].expression_values[node]): return None frame_info = self.stack[frame] if exc_value: node_value = self._exception_value(node, frame, exc_value) else: node_value = NodeValue.expression( self.num_samples, value, level=max(1, 3 - len(node._loops) * (not self._is_first_loop_iteration(node, frame))), ) self._set_node_value(node, frame, node_value) self._check_inner_call(frame_info, node, node_value) # i.e. is `node` the `y` in `[f(x) for x in y]`, making `node.parent` the `for x in y` is_special_comprehension_iter = ( isinstance(node.parent, ast.comprehension) and node is node.parent.iter and # Generators execute in their own time and aren't directly attached to the parent frame not isinstance(node.parent.parent, ast.GeneratorExp)) if not is_special_comprehension_iter: return None # Mark `for x in y` as a bit that executed, so it doesn't show as grey self._set_node_value(node.parent, frame, NodeValue.covered()) if exc_value: return None # Track each iteration over `y` so that the 'loop' can be stepped through loops = node._loops + (node.parent,) # type: Tuple[Loop, ...] def comprehension_iter_proxy(): for item in value: self._add_iteration(loops, frame) yield item # This effectively changes to code to `for x in comprehension_iter_proxy()` return ChangeValue(comprehension_iter_proxy()) def _check_inner_call(self, frame_info, node, node_value): # type: (FrameInfo, Union[ast.stmt, ast.expr], NodeValue) -> None inner_calls = frame_info.inner_calls.pop(node, None) if inner_calls: node_value.set_meta('inner_calls', inner_calls) def _is_first_loop_iteration(self, node, frame): # type: (ast.AST, FrameType) -> bool iteration = self.stack[frame].iteration # type: Iteration for loop_node in node._loops: # type: ast.AST loop = iteration.loops[loop_node._tree_index] iteration = loop.last() if iteration.index > 0: return False return True def _set_node_value(self, node, frame, value): # type: (ast.AST, FrameType, NodeValue) -> None iteration = self.stack[frame].iteration # type: Iteration for loop_node in node._loops: # type: ast.AST loop = iteration.loops[loop_node._tree_index] loop.recorded_node(node) iteration = loop.last() iteration.vals[node._tree_index] = value def _exception_value(self, node, frame, exc_value): # type: (Union[ast.expr, ast.stmt], FrameType, BaseException) -> NodeValue value = NodeValue.exception(exc_value) self._set_node_value(node, frame, value) return value def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node): # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool] if frame.f_code not in self._code_infos or _tracing_recursively(frame): return None if exc_value and node is exc_node: value = self._exception_value(node, frame, exc_value) else: value = NodeValue.covered() self._set_node_value(node, frame, value) self._check_inner_call(self.stack[frame], node, value) return None def enter_call(self, enter_info): # type: (EnterCallInfo) -> None frame = enter_info.current_frame # type: FrameType if frame.f_code not in self._code_infos or _tracing_recursively(frame): return frame_info = self.stack[frame] frame_info.start_time = get_unfrozen_datetime() frame_info.iteration = Iteration() code_info = self._code_infos[frame.f_code] if isinstance(enter_info.enter_node.parent, ast.Module): arguments = [] else: f_locals = frame.f_locals.copy() # type: Dict[str, Any] arguments = [(name, f_locals.pop(name)) for name in code_info.arg_names if name] + [ # Local variables other than actual arguments. These are variables from # the enclosing scope. It's handy to treat them like arguments in the UI it for it in f_locals.items() if it[0][0] != '.' # Appears when using nested tuple arguments ] frame_info.arguments = json.dumps([[k, cheap_repr(v)] for k, v in arguments]) frame_info.call_id = self._call_id() frame_info.inner_calls = defaultdict(list) prev = self.stack.get(enter_info.caller_frame) if prev: inner_calls = getattr(prev, 'inner_calls', None) if inner_calls is not None: inner_calls[enter_info.call_node].append(frame_info.call_id) def _call_id(self): # type: () -> Text return uuid4().hex def exit_call(self, exit_info): # type: (ExitCallInfo) -> None """ This is where all the data collected during the call is gathered up and sent to the database. """ frame = exit_info.current_frame # type: FrameType if frame.f_code not in self._code_infos or _tracing_recursively(frame): return frame_info = self.stack[frame] top_iteration = frame_info.iteration # type: Iteration node_values = _deep_dict() self._extract_node_values(top_iteration, (), node_values) db_func = self._code_infos[frame.f_code].db_func exc = exit_info.exc_value # type: Optional[Exception] if exc: traceback_str = ''.join(traceback.format_exception(type(exc), exc, exit_info.exc_tb)) exception = exception_string(exc) else: traceback_str = exception = None @retry_db def add_call(): Call = self.db.Call call = Call(id=frame_info.call_id, function_id=db_func, arguments=frame_info.arguments, return_value=cheap_repr(exit_info.return_value), exception=exception, traceback=traceback_str, data=json.dumps( dict( node_values=node_values, loop_iterations=top_iteration.extract_iterations()['loops'], type_names=type_registry.names(), num_special_types=type_registry.num_special_types, ), cls=ProtocolEncoder, separators=(',', ':') ), start_time=frame_info.start_time) with self.db.session_scope() as session: session.add(call) add_call() self._last_call_id = frame_info.call_id def _extract_node_values(self, iteration, path, node_values): # type: (Iteration, Tuple[int, ...], dict) -> None """ Populates node_values with values inside iteration. """ # Each element of `path` is an index of a loop iteration # e.g. given the nested loops: # # for i in [0, 1, 2]: # for j in [0, 1, 2, 3]: # # path may be (i, j) for each of the iterations for tree_index, node_value in iteration.vals.items(): # So this `full_path` is a tuple of ints, but the first # int has a different meaning from the others full_path = (tree_index,) + path # Given a path (a, b, c) we're making node_values 'contain' # this structure: # {a: {b: {c: node_value}}} d = node_values for path_k in full_path[:-1]: d = d[path_k] d[full_path[-1]] = node_value for loop in iteration.loops.values(): for i, iteration in enumerate(loop): self._extract_node_values(iteration, path + (i,), node_values) def trace_function(self, func): # type: (FunctionType) -> FunctionType new_func = super(BirdsEye, self).trace_function(func) code_info = self._code_infos.get(new_func.__code__) if code_info: return new_func lines, start_lineno = inspect.getsourcelines(func) # type: List[Text], int end_lineno = start_lineno + len(lines) name = safe_qualname(func) source_file = inspect.getsourcefile(func) if source_file.startswith('= 0: frame = frame.f_back filename = inspect.getsourcefile(frame) if filename is not None: context -= 1 filename = os.path.abspath(filename) if frame.f_globals.get('__name__') != '__main__': if PY3 and self._treetrace_hidden_with_stmt.__name__ not in frame.f_globals: raise RuntimeError( 'To trace an imported module, you must import birdseye before ' 'importing that module.') return lines = read_source_file(filename).splitlines() lines[:frame.f_lineno] = [''] * frame.f_lineno source = '\n'.join(lines) self.exec_string(source, filename, frame.f_globals, frame.f_locals, deep) sys.exit(0) def exec_string(self, source, filename, globs=None, locs=None, deep=False): globs = globs or {} locs = locs or {} traced_file = self.compile(source, filename) globs.update(self._trace_methods_dict(traced_file)) self._trace(FILE_SENTINEL_NAME, filename, traced_file, traced_file.code, 'module', source) if deep: nodes_by_lineno = { node.lineno: node for node in traced_file.nodes if isinstance(node, ast.FunctionDef) } def find_code(root_code): # type: (CodeType) -> None for code in root_code.co_consts: # type: CodeType if not inspect.iscode(code) or code.co_name.startswith('<'): continue find_code(code) lineno = code.co_firstlineno node = nodes_by_lineno.get(lineno) if not node: continue self._trace( code.co_name, filename, traced_file, code, typ='function', source=source, start_lineno=lineno, end_lineno=node.last_token.end[0] + 1, ) find_code(traced_file.code) exec(traced_file.code, globs, locs) def _trace( self, name, filename, traced_file, code, typ, source='', start_lineno=1, end_lineno=None, arg_names=(), ): if not end_lineno: end_lineno = start_lineno + len(source.splitlines()) nodes = list(self._nodes_of_interest(traced_file, start_lineno, end_lineno)) html_body = self._nodes_html(nodes, start_lineno, end_lineno, traced_file) data_dict = dict( # This maps each node to the loops enclosing that node node_loops={ node._tree_index: [n._tree_index for n in node._loops] for node, _ in nodes if node._loops }, ) if typ == 'function': tokens = traced_file.tokens func_node = only(node for node, _ in nodes if isinstance(node, ast.FunctionDef) and node.first_token.start[0] == start_lineno) func_startpos, source = source_without_decorators(tokens, func_node) # These are for the PyCharm plugin data_dict.update( node_ranges=list(self._node_ranges(nodes, tokens, func_startpos)), loop_ranges=list(self._loop_ranges(nodes, tokens, func_startpos)), ) data = json.dumps(data_dict, sort_keys=True) db_func = self._db_func(data, filename, html_body, name, start_lineno, source, typ) self._code_infos[code] = CodeInfo(db_func, traced_file, arg_names) def _loop_ranges(self, nodes, tokens, func_start): # For a for loop, e.g. # # for x in y: # # this yields the range of the target 'x'. # # For a while loop, e.g. # # while x < 10: # # this yields the range of the condition 'x < 10'. for node, (classes, _, __) in nodes: if 'loop' not in classes: continue try: target = node.target # for loop except AttributeError: target = node.test # while loop start, end = tokens.get_text_range(target) start -= func_start end -= func_start yield dict( tree_index=node._tree_index, start=start, end=end ) def _node_ranges(self, nodes, tokens, func_start): for node, (classes, _, __) in nodes: start, end = tokens.get_text_range(node) start -= func_start end -= func_start if start < 0: assert (end < 0 # nodes before the def, i.e. decorators or isinstance(node, ast.FunctionDef)) continue yield dict( tree_index=node._tree_index, start=start, end=end, depth=node._depth, classes=classes, ) @retry_db def _db_func(self, data, filename, html_body, name, start_lineno, source, typ): """ Retrieve the Function object from the database if one exists, or create one. """ def h(s): return hashlib.sha256(s.encode('utf8')).hexdigest() function_hash = h(filename + name + html_body + data + str(start_lineno)) Function = self.db.Function with self.db.session_scope() as session: db_func = one_or_none(session.query(Function).filter_by(hash=function_hash)) # type: Optional[Function] if not db_func: db_func = Function(file=filename, name=name, type=typ, html_body=html_body, lineno=start_lineno, data=data, body_hash=h(source), hash=function_hash) session.add(db_func) session.commit() # ensure .id exists assert isinstance(db_func.id, int) return db_func.id def _nodes_of_interest(self, traced_file, start_lineno, end_lineno): # type: (TracedFile, int, int) -> Iterator[Tuple[ast.AST, Tuple]] """ Nodes that may have a value, show up as a box in the UI, and lie within the given line range. """ for node in traced_file.nodes: classes = [] if (isinstance(node, (ast.While, ast.For, ast.comprehension)) and not isinstance(node.parent, ast.GeneratorExp)): classes.append('loop') if isinstance(node, ast.stmt): classes.append('stmt') if isinstance(node, ast.expr): if not node._is_interesting_expression: continue elif not classes: continue assert isinstance(node, ast.AST) # In particular FormattedValue is missing this if not hasattr(node, 'first_token'): continue if not start_lineno <= node.first_token.start[0] <= end_lineno: continue start, end = traced_file.tokens.get_text_range(node) # type: int, int if start == end == 0: continue yield node, (classes, start, end) def _nodes_html(self, nodes, start_lineno, end_lineno, traced_file): # type: (list, int, int, TracedFile) -> str """ The algorithm for generating the HTML works as follows. We generate a list of HTMLPositions, which are essentially places to insert HTML into the source plus some metadata. The order of the fields of HTMLPosition ensure that when the list is sorted, the resulting HTML is valid and correct. Specifically, the fields are: 1. index: the index in the source string where the HTML would be inserted 2. is_start: Indicates if this piece of HTML is the start of a tag, rather than the end. Ends should appear first, so that the resulting HTML looks like: ... ... rather than: ... ... (I think this might actually be unnecessary, since I can't think of any cases of two expressions right next to each other with nothing in between) 3. depth: the depth of the corresponding node in the AST. We want the start of a tag from a node to appear before the start of a tag nested within, e.g. `foo()` should become: foo() rather than: foo() 4. html: the actual HTML to insert. Not important for ordering. Mostly the list contains pairs of HTMLPositions corresponding to AST nodes, one for the start and one for the end. After the list is sorted, the HTML generated is essentially: source[0:positions[0].index] + positions[0].html + source[positions[0].index:positions[1].index] + positions[1].html + ... """ traced_file.root._depth = 0 for node in ast.walk(traced_file.root): # type: ast.AST for child in ast.iter_child_nodes(node): child._depth = node._depth + 1 positions = [] # type: List[HTMLPosition] for node, (classes, start, end) in nodes: # noinspection PyArgumentList positions.extend(map( HTMLPosition, [start, end], [True, False], # is_start [node._depth, node._depth], ['' % (node._tree_index, ' '.join(classes)), ''])) end_lineno = self._separate_comprehensions( [n[0] for n in nodes], end_lineno, positions, traced_file) # This just makes the loop below simpler positions.append(HTMLPosition(len(traced_file.source), False, 0, '')) positions.sort() html_parts = [] start = 0 for position in positions: html_parts.append(html.escape(traced_file.source[start:position.index])) html_parts.append(position.html) start = position.index html_body = ''.join(html_parts) html_body = '\n'.join(html_body.split('\n')[start_lineno - 1:end_lineno - 1]) return html_body.strip('\n') def _separate_comprehensions(self, nodes, end_lineno, positions, traced_file): # type: (list, int, List[HTMLPosition], TracedFile) -> int """ Comprehensions (e.g. list comprehensions) are troublesome because they can be navigated like loops, and the buttons for these need to be on separate lines. This function inserts newlines to turn: [x + y for x in range(3) for y in range(5)] and [[x + y for x in range(3)] for y in range(5)] into [x + y for x in range(3) for y in range(5)] and [[x + y for x in range(3)] for y in range(5)] """ comprehensions = group_by_key_func(of_type((ast.comprehension, ast.While, ast.For), nodes), lambda c: c.first_token.start[0] ) # type: Dict[Any, Iterable[ast.comprehension]] def get_start(n): # type: (ast.AST) -> int return traced_file.tokens.get_text_range(n)[0] for comp_list in comprehensions.values(): prev_start = None # type: Optional[int] for comp in sorted(comp_list, key=lambda c: c.first_token.startpos): if isinstance(comp, ast.comprehension) and comp is comp.parent.generators[0]: start = get_start(comp.parent) if prev_start is not None and start < prev_start: start = get_start(comp) else: start = get_start(comp) if prev_start is not None: positions.append(HTMLPosition(start, True, 0, '\n ')) end_lineno += 1 prev_start = start return end_lineno eye = BirdsEye() HTMLPosition = NamedTuple('HTMLPosition', [ ('index', int), ('is_start', bool), ('depth', int), ('html', str), ]) def _deep_dict(): return defaultdict(_deep_dict) _bad_codes = (eye.enter_call.__code__, eye.exit_call.__code__, eye.after_expr.__code__, eye.after_stmt.__code__) def _tracing_recursively(frame): while frame: if frame.f_code in _bad_codes: return True frame = frame.f_back class Iteration(object): """ Corresponds to an iteration of a loop during a call, OR the call itself (FrameInfo.iteration). """ def __init__(self): # Mapping of nodes (via node._tree_index) to the value of that # node in this iteration. Only contains nodes within the corresponding # loop or at the top of the function, but not in loops further within # (those will be somewhere within self.loops) # Therefore those nodes have at most one value. self.vals = {} # type: Dict[int, NodeValue] # Mapping of loop nodes (via node._tree_index) to IterationLists # for loops that happened during this iteration self.loops = defaultdict(IterationList) # type: Dict[int, IterationList] # 0-based index of this iteration self.index = None # type: int self.keep = False def extract_iterations(self): # type: () -> Dict[str, Union[int, Dict]] return { 'index': self.index, 'loops': { tree_index: [iteration.extract_iterations() for iteration in iteration_list] for tree_index, iteration_list in self.loops.items() } } class IterationList(Iterable[Iteration]): """ A list of Iterations, corresponding to a run of a loop. If the loop has many iterations, only contains the first and last few and any in the middle where unique nodes had values, so that any node which appeared during this loop exists in at least some iterations. """ side_len = 3 def __init__(self): # Contains the first few iterations # and any after that have unique nodes in them self.start = [] # type: List[Iteration] # Contains the last few iterations self.end = deque(maxlen=self.side_len) # type: Deque[Iteration] # Total number of iterations in the loop, not all of which # are kept self.length = 0 # type: int # Number of times each node has been recorded in this loop self.recorded = Counter() def append(self, iteration): # type: (Iteration) -> None if self.length < self.side_len: self.start.append(iteration) else: # If self.end is too long, the first element self.end[0] # is about to be dropped by the deque. If that iteration # should be kept because of some node that was recorded, # add it to self.start if len(self.end) >= self.side_len and self.end[0].keep: self.start.append(self.end[0]) self.end.append(iteration) iteration.index = self.length self.length += 1 def __iter__(self): # type: () -> Iterator[Iteration] return chain(self.start, self.end) def last(self): # type: () -> Iteration if self.end: return self.end[-1] else: return self.start[-1] def recorded_node(self, node): # type: (ast.AST) -> None if self.recorded[node] >= 2: # We've already seen this node enough return # This node is new(ish), make sure we keep this iteration self.last().keep = True self.recorded[node] += 1 class TypeRegistry(object): basic_types = (type(None), bool, int, float, complex) if PY2: basic_types += (long,) special_types = basic_types + (list, dict, tuple, set, frozenset, str) if PY2: special_types += (unicode if PY2 else bytes,) num_special_types = len(special_types) def __init__(self): self.lock = Lock() self.data = defaultdict(lambda: len(self.data)) # type: Dict[type, int] for t in self.special_types: _ = self.data[t] def __getitem__(self, item): t = correct_type(item) with self.lock: return self.data[t] def names(self): # type: () -> List[str] rev = dict((v, k) for k, v in self.data.items()) return [safe_qualname(rev[i]) for i in range(len(rev))] type_registry = TypeRegistry() class NodeValue(object): """ The 'value' of a node during a particular iteration. This can mean different things, see the classmethods. Can also contain some metadata, including links to other calls. """ __slots__ = ('val_repr', 'type_index', 'meta', 'children') def __init__(self, val_repr, type_index): self.val_repr = val_repr # type: str self.type_index = type_index # type: int self.meta = None # type: Optional[Dict[str, Any]] self.children = None # type: Optional[List[Tuple[str, NodeValue]]] def set_meta(self, key, value): # type: (str, Any) -> None self.meta = self.meta or {} self.meta[key] = value def add_child(self, samples, level, key, value): # type: (dict, int, str, Any) -> None self.children = self.children or [] self.children.append((key, NodeValue.expression(samples, value, level))) def as_json(self): result = [self.val_repr, self.type_index, self.meta or {}] # type: list if self.children: result.extend(self.children) return result @classmethod def covered(cls): """ Represents a bit of code, usually a statement, that executed successfully but doesn't have an actual value. """ return cls('', -2) @classmethod def exception(cls, exc_value): """ Means that exc_value was raised by a node when executing, and not any inner node. """ return cls(exception_string(exc_value), -1) @classmethod def expression(cls, samples, val, level): # type: (dict, Any, int) -> NodeValue """ The value of an expression or one of its children, with attributes, dictionary items, etc as children. Has a max depth of `level` levels. """ result = cls(cheap_repr(val), type_registry[val]) if isinstance(val, (TypeRegistry.basic_types, BirdsEye)): return result length = None if not isinstance(val, QuerySet): # len triggers a database query try: length = len(val) except: pass else: result.set_meta('len', length) if isinstance(val, ModuleType): level = min(level, 2) add_child = partial(result.add_child, samples, level - 1) if isinstance(val, (Series, ndarray)): attrs = ['dtype'] if isinstance(val, ndarray): attrs.append('shape') for name in attrs: try: attr = getattr(val, name) except AttributeError: pass else: add_child(name, attr) if level >= 3 or level >= 2 and isinstance(val, Series): sample_type = 'big' else: sample_type = 'small' samples = samples[sample_type] # Always expand DataFrames and Series regardless of level to # make the table view of DataFrames work if isinstance(val, DataFrame): meta = {} result.set_meta('dataframe', meta) max_rows = samples['pandas_rows'] max_cols = samples['pandas_cols'] if length > max_rows + 2: meta['row_break'] = max_rows // 2 columns = val.columns num_cols = len(columns) if num_cols > max_cols + 2: meta['col_break'] = max_cols // 2 indices = set(_sample_indices(num_cols, max_cols)) for i, (formatted_name, label) in enumerate(zip(val.columns.format(sparsify=False), val.columns)): if i in indices: add_child(formatted_name, val[label]) return result if isinstance(val, Series): for i in _sample_indices(length, samples['pandas_rows']): try: k = val.index[i:i + 1].format(sparsify=False)[0] v = val.iloc[i] except: pass else: add_child(k, v) return result if (level <= 0 or isinstance(val, (str, bytes, range) if PY3 else (str, unicode, xrange))): return result if isinstance(val, (Sequence, ndarray)) and length is not None: for i in _sample_indices(length, samples['list']): try: v = val[i] except: pass else: add_child(str(i), v) if isinstance(val, Mapping): for k, v in islice(_safe_iter(val, iteritems), samples['dict']): add_child(cheap_repr(k), v) if isinstance(val, Set): vals = _safe_iter(val) num_items = samples['set'] if length is None or length > num_items + 2: vals = islice(vals, num_items) for i, v in enumerate(vals): add_child('<%s>' % i, v) d = getattr(val, '__dict__', None) if d: for k in sorted(islice(_safe_iter(d), samples['attributes']), key=str): v = d[k] if isinstance(v, TracedFile): continue add_child(str(k), v) else: for s in sorted(getattr(type(val), '__slots__', None) or ()): try: attr = getattr(val, s) except AttributeError: pass else: add_child(str(s), attr) return result def _safe_iter(val, f=lambda x: x): try: for x in f(val): yield x except: pass def _sample_indices(length, max_length): if length <= max_length + 2: return range(length) else: return chain(range(max_length // 2), range(length - max_length // 2, length)) @try_register_repr('pandas', 'Series') def _repr_series_one_line(x, helper): n = len(x) if n == 0: return repr(x) newlevel = helper.level - 1 pieces = [] maxparts = _repr_series_one_line.maxparts for i in _sample_indices(n, maxparts): k = x.index[i:i + 1].format(sparsify=False)[0] v = x.iloc[i] pieces.append('%s = %s' % (k, cheap_repr(v, newlevel))) if n > maxparts + 2: pieces.insert(maxparts // 2, '...') return '; '.join(pieces) def is_interesting_expression(node): # type: (ast.AST) -> bool """ If this expression has a value that may not be exactly what it looks like, return True. Put differently, return False if this is just a literal. """ return (isinstance(node, ast.expr) and not (isinstance(node, (ast.Num, ast.Str, getattr(ast, 'NameConstant', ()))) or isinstance(getattr(node, 'ctx', None), (ast.Store, ast.Del)) or (isinstance(node, ast.UnaryOp) and isinstance(node.op, (ast.UAdd, ast.USub)) and isinstance(node.operand, ast.Num)) or (isinstance(node, (ast.List, ast.Tuple, ast.Dict)) and not any(is_interesting_expression(n) for n in ast.iter_child_nodes(node))))) def is_obvious_builtin(node, value): # type: (ast.expr, Any) -> bool """ Return True if this node looks like a builtin and it really is (i.e. hasn't been shadowed). """ # noinspection PyUnresolvedReferences builtins = cast(dict, __builtins__) return ((isinstance(node, ast.Name) and node.id in builtins and builtins[node.id] is value) or isinstance(node, getattr(ast, 'NameConstant', ()))) python-executing-2.2.0/tests/samples/configuration.py000066400000000000000000000170201474076367500230770ustar00rootroot00000000000000import inspect import os import sys import threading from collections import Set, Mapping, Sequence from io import open import six import snoop as package from snoop.formatting import DefaultFormatter from snoop.pp_module import PP from snoop.tracer import Spy, Tracer from snoop.utils import builtins as builtins_module, is_pathlike, shitcode, ensure_tuple, QuerySet try: # Enable ANSI escape codes in Windows 10 import ctypes kernel32 = ctypes.windll.kernel32 kernel32.SetConsoleMode(kernel32.GetStdHandle(-11), 7) can_color = True except Exception: can_color = os.name != 'nt' def install( builtins=True, snoop="snoop", pp="pp", spy="spy", out=None, prefix='', columns='time', overwrite=False, color=None, enabled=True, watch_extras=(), replace_watch_extras=None, formatter_class=DefaultFormatter, ): """ Configure output, enable or disable, and add names to builtins. Parameters: - builtins: set to False to not add any names to builtins, so importing will still be required. - snoop, pp, and spy: set to other strings to choose the names of these functions in builtins - `out`: determines the output destination. By default this is stderr. You can also pass: - A string or a `Path` object to write to a file at that location. By default this always will append to the file. Pass `overwrite=True` to clear the file initially. - Anything with a `write` method, e.g. `sys.stdout` or a file object. - Any callable with a single string argument, e.g. `logger.info`. - `color`: determines whether the output includes escape characters to display colored text in the console. If you see weird characters in your output, your console doesn't support colors, so pass `color=False`. - Code is syntax highlighted using [Pygments](http://pygments.org/), and this argument is passed as the style. You can choose a different color scheme by passing a string naming a style (see [this gallery](https://help.farbox.com/pygments.html)) or a style class. The default style is monokai. - By default this parameter is set to `out.isatty()`, which is usually true for stdout and stderr but will be false if they are redirected or piped. Pass `True` or a style if you want to force coloring. - To see colors in the PyCharm Run window, edit the Run Configuration and tick "Emulate terminal in output console". - `prefix`: Pass a string to start all snoop lines with that string so you can grep for them easily. - `columns`: This specifies the columns at the start of each output line. You can pass a string with the names of built in columns separated by spaces or commas. These are the available columns: - `time`: The current time. This is the only column by default. - `thread`: The name of the current thread. - `thread_ident`: The [identifier](https://docs.python.org/3/library/threading.html#threading.Thread.ident) of the current thread, in case thread names are not unique. - `file`: The filename (not the full path) of the current function. - `full_file`: The full path to the file (also shown anyway when the function is called). - `function`: The name of the current function. - `function_qualname`: The qualified name of the current function. If you want a custom column, please open an issue to tell me what you're interested in! In the meantime, you can pass a list, where the elements are either strings or callables. The callables should take one argument, which will be an `Event` object. It has attributes `frame`, `event`, and `arg`, as specified in [`sys.settrace()`](https://docs.python.org/3/library/sys.html#sys.settrace), and other attributes which may change. """ if builtins: setattr(builtins_module, snoop, package.snoop) setattr(builtins_module, pp, package.pp) setattr(builtins_module, spy, package.spy) config = Config( out=out, prefix=prefix, columns=columns, overwrite=overwrite, color=color, enabled=enabled, watch_extras=watch_extras, replace_watch_extras=replace_watch_extras, formatter_class=formatter_class, ) package.snoop.config = config package.pp.config = config package.spy.config = config class Config(object): """" If you need more control than the global `install` function, e.g. if you want to write to several different files in one process, you can create a `Config` object, e.g: `config = snoop.Config(out=filename)`. Then `config.snoop`, `config.pp` and `config.spy` will use that configuration rather than the global one. The arguments are the same as the arguments of `install()` relating to output configuration and `enabled`. """ def __init__( self, out=None, prefix='', columns='time', overwrite=False, color=None, enabled=True, watch_extras=(), replace_watch_extras=None, formatter_class=DefaultFormatter, ): if can_color: if color is None: isatty = getattr(out or sys.stderr, 'isatty', lambda: False) color = bool(isatty()) else: color = False self.write = get_write_function(out, overwrite) self.formatter = formatter_class(prefix, columns, color) self.enabled = enabled self.pp = PP(self) class ConfiguredTracer(Tracer): config = self self.snoop = ConfiguredTracer self.spy = Spy(self) self.last_frame = None self.thread_local = threading.local() if replace_watch_extras is not None: self.watch_extras = ensure_tuple(replace_watch_extras) else: self.watch_extras = (len_shape_watch, dtype_watch) + ensure_tuple(watch_extras) def len_shape_watch(source, value): try: shape = value.shape except Exception: pass else: if not inspect.ismethod(shape): return '{}.shape'.format(source), shape if isinstance(value, QuerySet): # Getting the length of a Django queryset evaluates it return None length = len(value) if ( (isinstance(value, six.string_types) and length < 50) or (isinstance(value, (Mapping, Set, Sequence)) and length == 0) ): return None return 'len({})'.format(source), length def dtype_watch(source, value): dtype = value.dtype if not inspect.ismethod(dtype): return '{}.dtype'.format(source), dtype def get_write_function(output, overwrite): is_path = ( isinstance(output, six.string_types) or is_pathlike(output) ) if is_path: return FileWriter(output, overwrite).write elif callable(output): write = output else: def write(s): stream = output if stream is None: stream = sys.stderr try: stream.write(s) except UnicodeEncodeError: # God damn Python 2 stream.write(shitcode(s)) return write class FileWriter(object): def __init__(self, path, overwrite): self.path = six.text_type(path) self.overwrite = overwrite def write(self, s): with open(self.path, 'w' if self.overwrite else 'a', encoding='utf-8') as f: f.write(s) self.overwrite = False python-executing-2.2.0/tests/samples/datetime.py000066400000000000000000002634461474076367500220430ustar00rootroot00000000000000"""Concrete date/time and related types. See http://www.iana.org/time-zones/repository/tz-link.html for time zone and DST data sources. """ __all__ = ("date", "datetime", "time", "timedelta", "timezone", "tzinfo", "MINYEAR", "MAXYEAR", "UTC") import time as _time import math as _math import sys from operator import index as _index def _cmp(x, y): return 0 if x == y else 1 if x > y else -1 MINYEAR = 1 MAXYEAR = 9999 _MAXORDINAL = 3652059 # date.max.toordinal() # Utility functions, adapted from Python's Demo/classes/Dates.py, which # also assumes the current Gregorian calendar indefinitely extended in # both directions. Difference: Dates.py calls January 1 of year 0 day # number 1. The code here calls January 1 of year 1 day number 1. This is # to match the definition of the "proleptic Gregorian" calendar in Dershowitz # and Reingold's "Calendrical Calculations", where it's the base calendar # for all computations. See the book for algorithms for converting between # proleptic Gregorian ordinals and many other calendar systems. # -1 is a placeholder for indexing purposes. _DAYS_IN_MONTH = [-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] _DAYS_BEFORE_MONTH = [-1] # -1 is a placeholder for indexing purposes. dbm = 0 for dim in _DAYS_IN_MONTH[1:]: _DAYS_BEFORE_MONTH.append(dbm) dbm += dim del dbm, dim def _is_leap(year): "year -> 1 if leap year, else 0." return year % 4 == 0 and (year % 100 != 0 or year % 400 == 0) def _days_before_year(year): "year -> number of days before January 1st of year." y = year - 1 return y*365 + y//4 - y//100 + y//400 def _days_in_month(year, month): "year, month -> number of days in that month in that year." assert 1 <= month <= 12, month if month == 2 and _is_leap(year): return 29 return _DAYS_IN_MONTH[month] def _days_before_month(year, month): "year, month -> number of days in year preceding first day of month." assert 1 <= month <= 12, 'month must be in 1..12' return _DAYS_BEFORE_MONTH[month] + (month > 2 and _is_leap(year)) def _ymd2ord(year, month, day): "year, month, day -> ordinal, considering 01-Jan-0001 as day 1." assert 1 <= month <= 12, 'month must be in 1..12' dim = _days_in_month(year, month) assert 1 <= day <= dim, ('day must be in 1..%d' % dim) return (_days_before_year(year) + _days_before_month(year, month) + day) _DI400Y = _days_before_year(401) # number of days in 400 years _DI100Y = _days_before_year(101) # " " " " 100 " _DI4Y = _days_before_year(5) # " " " " 4 " # A 4-year cycle has an extra leap day over what we'd get from pasting # together 4 single years. assert _DI4Y == 4 * 365 + 1 # Similarly, a 400-year cycle has an extra leap day over what we'd get from # pasting together 4 100-year cycles. assert _DI400Y == 4 * _DI100Y + 1 # OTOH, a 100-year cycle has one fewer leap day than we'd get from # pasting together 25 4-year cycles. assert _DI100Y == 25 * _DI4Y - 1 def _ord2ymd(n): "ordinal -> (year, month, day), considering 01-Jan-0001 as day 1." # n is a 1-based index, starting at 1-Jan-1. The pattern of leap years # repeats exactly every 400 years. The basic strategy is to find the # closest 400-year boundary at or before n, then work with the offset # from that boundary to n. Life is much clearer if we subtract 1 from # n first -- then the values of n at 400-year boundaries are exactly # those divisible by _DI400Y: # # D M Y n n-1 # -- --- ---- ---------- ---------------- # 31 Dec -400 -_DI400Y -_DI400Y -1 # 1 Jan -399 -_DI400Y +1 -_DI400Y 400-year boundary # ... # 30 Dec 000 -1 -2 # 31 Dec 000 0 -1 # 1 Jan 001 1 0 400-year boundary # 2 Jan 001 2 1 # 3 Jan 001 3 2 # ... # 31 Dec 400 _DI400Y _DI400Y -1 # 1 Jan 401 _DI400Y +1 _DI400Y 400-year boundary n -= 1 n400, n = divmod(n, _DI400Y) year = n400 * 400 + 1 # ..., -399, 1, 401, ... # Now n is the (non-negative) offset, in days, from January 1 of year, to # the desired date. Now compute how many 100-year cycles precede n. # Note that it's possible for n100 to equal 4! In that case 4 full # 100-year cycles precede the desired day, which implies the desired # day is December 31 at the end of a 400-year cycle. n100, n = divmod(n, _DI100Y) # Now compute how many 4-year cycles precede it. n4, n = divmod(n, _DI4Y) # And now how many single years. Again n1 can be 4, and again meaning # that the desired day is December 31 at the end of the 4-year cycle. n1, n = divmod(n, 365) year += n100 * 100 + n4 * 4 + n1 if n1 == 4 or n100 == 4: assert n == 0 return year-1, 12, 31 # Now the year is correct, and n is the offset from January 1. We find # the month via an estimate that's either exact or one too large. leapyear = n1 == 3 and (n4 != 24 or n100 == 3) assert leapyear == _is_leap(year) month = (n + 50) >> 5 preceding = _DAYS_BEFORE_MONTH[month] + (month > 2 and leapyear) if preceding > n: # estimate is too large month -= 1 preceding -= _DAYS_IN_MONTH[month] + (month == 2 and leapyear) n -= preceding assert 0 <= n < _days_in_month(year, month) # Now the year and month are correct, and n is the offset from the # start of that month: we're done! return year, month, n+1 # Month and day names. For localized versions, see the calendar module. _MONTHNAMES = [None, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] _DAYNAMES = [None, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"] def _build_struct_time(y, m, d, hh, mm, ss, dstflag): wday = (_ymd2ord(y, m, d) + 6) % 7 dnum = _days_before_month(y, m) + d return _time.struct_time((y, m, d, hh, mm, ss, wday, dnum, dstflag)) def _format_time(hh, mm, ss, us, timespec='auto'): specs = { 'hours': '{:02d}', 'minutes': '{:02d}:{:02d}', 'seconds': '{:02d}:{:02d}:{:02d}', 'milliseconds': '{:02d}:{:02d}:{:02d}.{:03d}', 'microseconds': '{:02d}:{:02d}:{:02d}.{:06d}' } if timespec == 'auto': # Skip trailing microseconds when us==0. timespec = 'microseconds' if us else 'seconds' elif timespec == 'milliseconds': us //= 1000 try: fmt = specs[timespec] except KeyError: raise ValueError('Unknown timespec value') else: return fmt.format(hh, mm, ss, us) def _format_offset(off): s = '' if off is not None: if off.days < 0: sign = "-" off = -off else: sign = "+" hh, mm = divmod(off, timedelta(hours=1)) mm, ss = divmod(mm, timedelta(minutes=1)) s += "%s%02d:%02d" % (sign, hh, mm) if ss or ss.microseconds: s += ":%02d" % ss.seconds if ss.microseconds: s += '.%06d' % ss.microseconds return s # Correctly substitute for %z and %Z escapes in strftime formats. def _wrap_strftime(object, format, timetuple): # Don't call utcoffset() or tzname() unless actually needed. freplace = None # the string to use for %f zreplace = None # the string to use for %z Zreplace = None # the string to use for %Z # Scan format for %z and %Z escapes, replacing as needed. newformat = [] push = newformat.append i, n = 0, len(format) while i < n: ch = format[i] i += 1 if ch == '%': if i < n: ch = format[i] i += 1 if ch == 'f': if freplace is None: freplace = '%06d' % getattr(object, 'microsecond', 0) newformat.append(freplace) elif ch == 'z': if zreplace is None: zreplace = "" if hasattr(object, "utcoffset"): offset = object.utcoffset() if offset is not None: sign = '+' if offset.days < 0: offset = -offset sign = '-' h, rest = divmod(offset, timedelta(hours=1)) m, rest = divmod(rest, timedelta(minutes=1)) s = rest.seconds u = offset.microseconds if u: zreplace = '%c%02d%02d%02d.%06d' % (sign, h, m, s, u) elif s: zreplace = '%c%02d%02d%02d' % (sign, h, m, s) else: zreplace = '%c%02d%02d' % (sign, h, m) assert '%' not in zreplace newformat.append(zreplace) elif ch == 'Z': if Zreplace is None: Zreplace = "" if hasattr(object, "tzname"): s = object.tzname() if s is not None: # strftime is going to have at this: escape % Zreplace = s.replace('%', '%%') newformat.append(Zreplace) else: push('%') push(ch) else: push('%') else: push(ch) newformat = "".join(newformat) return _time.strftime(newformat, timetuple) # Helpers for parsing the result of isoformat() def _is_ascii_digit(c): return c in "0123456789" def _find_isoformat_datetime_separator(dtstr): # See the comment in _datetimemodule.c:_find_isoformat_datetime_separator len_dtstr = len(dtstr) if len_dtstr == 7: return 7 assert len_dtstr > 7 date_separator = "-" week_indicator = "W" if dtstr[4] == date_separator: if dtstr[5] == week_indicator: if len_dtstr < 8: raise ValueError("Invalid ISO string") if len_dtstr > 8 and dtstr[8] == date_separator: if len_dtstr == 9: raise ValueError("Invalid ISO string") if len_dtstr > 10 and _is_ascii_digit(dtstr[10]): # This is as far as we need to resolve the ambiguity for # the moment - if we have YYYY-Www-##, the separator is # either a hyphen at 8 or a number at 10. # # We'll assume it's a hyphen at 8 because it's way more # likely that someone will use a hyphen as a separator than # a number, but at this point it's really best effort # because this is an extension of the spec anyway. # TODO(pganssle): Document this return 8 return 10 else: # YYYY-Www (8) return 8 else: # YYYY-MM-DD (10) return 10 else: if dtstr[4] == week_indicator: # YYYYWww (7) or YYYYWwwd (8) idx = 7 while idx < len_dtstr: if not _is_ascii_digit(dtstr[idx]): break idx += 1 if idx < 9: return idx if idx % 2 == 0: # If the index of the last number is even, it's YYYYWwwd return 7 else: return 8 else: # YYYYMMDD (8) return 8 def _parse_isoformat_date(dtstr): # It is assumed that this is an ASCII-only string of lengths 7, 8 or 10, # see the comment on Modules/_datetimemodule.c:_find_isoformat_datetime_separator assert len(dtstr) in (7, 8, 10) year = int(dtstr[0:4]) has_sep = dtstr[4] == '-' pos = 4 + has_sep if dtstr[pos:pos + 1] == "W": # YYYY-?Www-?D? pos += 1 weekno = int(dtstr[pos:pos + 2]) pos += 2 dayno = 1 if len(dtstr) > pos: if (dtstr[pos:pos + 1] == '-') != has_sep: raise ValueError("Inconsistent use of dash separator") pos += has_sep dayno = int(dtstr[pos:pos + 1]) return list(_isoweek_to_gregorian(year, weekno, dayno)) else: month = int(dtstr[pos:pos + 2]) pos += 2 if (dtstr[pos:pos + 1] == "-") != has_sep: raise ValueError("Inconsistent use of dash separator") pos += has_sep day = int(dtstr[pos:pos + 2]) return [year, month, day] _FRACTION_CORRECTION = [100000, 10000, 1000, 100, 10] def _parse_hh_mm_ss_ff(tstr): # Parses things of the form HH[:?MM[:?SS[{.,}fff[fff]]]] len_str = len(tstr) time_comps = [0, 0, 0, 0] pos = 0 for comp in range(0, 3): if (len_str - pos) < 2: raise ValueError("Incomplete time component") time_comps[comp] = int(tstr[pos:pos+2]) pos += 2 next_char = tstr[pos:pos+1] if comp == 0: has_sep = next_char == ':' if not next_char or comp >= 2: break if has_sep and next_char != ':': raise ValueError("Invalid time separator: %c" % next_char) pos += has_sep if pos < len_str: if tstr[pos] not in '.,': raise ValueError("Invalid microsecond component") else: pos += 1 len_remainder = len_str - pos if len_remainder >= 6: to_parse = 6 else: to_parse = len_remainder time_comps[3] = int(tstr[pos:(pos+to_parse)]) if to_parse < 6: time_comps[3] *= _FRACTION_CORRECTION[to_parse-1] if (len_remainder > to_parse and not all(map(_is_ascii_digit, tstr[(pos+to_parse):]))): raise ValueError("Non-digit values in unparsed fraction") return time_comps def _parse_isoformat_time(tstr): # Format supported is HH[:MM[:SS[.fff[fff]]]][+HH:MM[:SS[.ffffff]]] len_str = len(tstr) if len_str < 2: raise ValueError("Isoformat time too short") # This is equivalent to re.search('[+-Z]', tstr), but faster tz_pos = (tstr.find('-') + 1 or tstr.find('+') + 1 or tstr.find('Z') + 1) timestr = tstr[:tz_pos-1] if tz_pos > 0 else tstr time_comps = _parse_hh_mm_ss_ff(timestr) tzi = None if tz_pos == len_str and tstr[-1] == 'Z': tzi = timezone.utc elif tz_pos > 0: tzstr = tstr[tz_pos:] # Valid time zone strings are: # HH len: 2 # HHMM len: 4 # HH:MM len: 5 # HHMMSS len: 6 # HHMMSS.f+ len: 7+ # HH:MM:SS len: 8 # HH:MM:SS.f+ len: 10+ if len(tzstr) in (0, 1, 3): raise ValueError("Malformed time zone string") tz_comps = _parse_hh_mm_ss_ff(tzstr) if all(x == 0 for x in tz_comps): tzi = timezone.utc else: tzsign = -1 if tstr[tz_pos - 1] == '-' else 1 td = timedelta(hours=tz_comps[0], minutes=tz_comps[1], seconds=tz_comps[2], microseconds=tz_comps[3]) tzi = timezone(tzsign * td) time_comps.append(tzi) return time_comps # tuple[int, int, int] -> tuple[int, int, int] version of date.fromisocalendar def _isoweek_to_gregorian(year, week, day): # Year is bounded this way because 9999-12-31 is (9999, 52, 5) if not MINYEAR <= year <= MAXYEAR: raise ValueError(f"Year is out of range: {year}") if not 0 < week < 53: out_of_range = True if week == 53: # ISO years have 53 weeks in them on years starting with a # Thursday and leap years starting on a Wednesday first_weekday = _ymd2ord(year, 1, 1) % 7 if (first_weekday == 4 or (first_weekday == 3 and _is_leap(year))): out_of_range = False if out_of_range: raise ValueError(f"Invalid week: {week}") if not 0 < day < 8: raise ValueError(f"Invalid weekday: {day} (range is [1, 7])") # Now compute the offset from (Y, 1, 1) in days: day_offset = (week - 1) * 7 + (day - 1) # Calculate the ordinal day for monday, week 1 day_1 = _isoweek1monday(year) ord_day = day_1 + day_offset return _ord2ymd(ord_day) # Just raise TypeError if the arg isn't None or a string. def _check_tzname(name): if name is not None and not isinstance(name, str): raise TypeError("tzinfo.tzname() must return None or string, " "not '%s'" % type(name)) # name is the offset-producing method, "utcoffset" or "dst". # offset is what it returned. # If offset isn't None or timedelta, raises TypeError. # If offset is None, returns None. # Else offset is checked for being in range. # If it is, its integer value is returned. Else ValueError is raised. def _check_utc_offset(name, offset): assert name in ("utcoffset", "dst") if offset is None: return if not isinstance(offset, timedelta): raise TypeError("tzinfo.%s() must return None " "or timedelta, not '%s'" % (name, type(offset))) if not -timedelta(1) < offset < timedelta(1): raise ValueError("%s()=%s, must be strictly between " "-timedelta(hours=24) and timedelta(hours=24)" % (name, offset)) def _check_date_fields(year, month, day): year = _index(year) month = _index(month) day = _index(day) if not MINYEAR <= year <= MAXYEAR: raise ValueError('year must be in %d..%d' % (MINYEAR, MAXYEAR), year) if not 1 <= month <= 12: raise ValueError('month must be in 1..12', month) dim = _days_in_month(year, month) if not 1 <= day <= dim: raise ValueError('day must be in 1..%d' % dim, day) return year, month, day def _check_time_fields(hour, minute, second, microsecond, fold): hour = _index(hour) minute = _index(minute) second = _index(second) microsecond = _index(microsecond) if not 0 <= hour <= 23: raise ValueError('hour must be in 0..23', hour) if not 0 <= minute <= 59: raise ValueError('minute must be in 0..59', minute) if not 0 <= second <= 59: raise ValueError('second must be in 0..59', second) if not 0 <= microsecond <= 999999: raise ValueError('microsecond must be in 0..999999', microsecond) if fold not in (0, 1): raise ValueError('fold must be either 0 or 1', fold) return hour, minute, second, microsecond, fold def _check_tzinfo_arg(tz): if tz is not None and not isinstance(tz, tzinfo): raise TypeError("tzinfo argument must be None or of a tzinfo subclass") def _cmperror(x, y): raise TypeError("can't compare '%s' to '%s'" % ( type(x).__name__, type(y).__name__)) def _divide_and_round(a, b): """divide a by b and round result to the nearest integer When the ratio is exactly half-way between two integers, the even integer is returned. """ # Based on the reference implementation for divmod_near # in Objects/longobject.c. q, r = divmod(a, b) # round up if either r / b > 0.5, or r / b == 0.5 and q is odd. # The expression r / b > 0.5 is equivalent to 2 * r > b if b is # positive, 2 * r < b if b negative. r *= 2 greater_than_half = r > b if b > 0 else r < b if greater_than_half or r == b and q % 2 == 1: q += 1 return q class timedelta: """Represent the difference between two datetime objects. Supported operators: - add, subtract timedelta - unary plus, minus, abs - compare to timedelta - multiply, divide by int In addition, datetime supports subtraction of two datetime objects returning a timedelta, and addition or subtraction of a datetime and a timedelta giving a datetime. Representation: (days, seconds, microseconds). Why? Because I felt like it. """ __slots__ = '_days', '_seconds', '_microseconds', '_hashcode' def __new__(cls, days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0): # Doing this efficiently and accurately in C is going to be difficult # and error-prone, due to ubiquitous overflow possibilities, and that # C double doesn't have enough bits of precision to represent # microseconds over 10K years faithfully. The code here tries to make # explicit where go-fast assumptions can be relied on, in order to # guide the C implementation; it's way more convoluted than speed- # ignoring auto-overflow-to-long idiomatic Python could be. # XXX Check that all inputs are ints or floats. # Final values, all integer. # s and us fit in 32-bit signed ints; d isn't bounded. d = s = us = 0 # Normalize everything to days, seconds, microseconds. days += weeks*7 seconds += minutes*60 + hours*3600 microseconds += milliseconds*1000 # Get rid of all fractions, and normalize s and us. # Take a deep breath . if isinstance(days, float): dayfrac, days = _math.modf(days) daysecondsfrac, daysecondswhole = _math.modf(dayfrac * (24.*3600.)) assert daysecondswhole == int(daysecondswhole) # can't overflow s = int(daysecondswhole) assert days == int(days) d = int(days) else: daysecondsfrac = 0.0 d = days assert isinstance(daysecondsfrac, float) assert abs(daysecondsfrac) <= 1.0 assert isinstance(d, int) assert abs(s) <= 24 * 3600 # days isn't referenced again before redefinition if isinstance(seconds, float): secondsfrac, seconds = _math.modf(seconds) assert seconds == int(seconds) seconds = int(seconds) secondsfrac += daysecondsfrac assert abs(secondsfrac) <= 2.0 else: secondsfrac = daysecondsfrac # daysecondsfrac isn't referenced again assert isinstance(secondsfrac, float) assert abs(secondsfrac) <= 2.0 assert isinstance(seconds, int) days, seconds = divmod(seconds, 24*3600) d += days s += int(seconds) # can't overflow assert isinstance(s, int) assert abs(s) <= 2 * 24 * 3600 # seconds isn't referenced again before redefinition usdouble = secondsfrac * 1e6 assert abs(usdouble) < 2.1e6 # exact value not critical # secondsfrac isn't referenced again if isinstance(microseconds, float): microseconds = round(microseconds + usdouble) seconds, microseconds = divmod(microseconds, 1000000) days, seconds = divmod(seconds, 24*3600) d += days s += seconds else: microseconds = int(microseconds) seconds, microseconds = divmod(microseconds, 1000000) days, seconds = divmod(seconds, 24*3600) d += days s += seconds microseconds = round(microseconds + usdouble) assert isinstance(s, int) assert isinstance(microseconds, int) assert abs(s) <= 3 * 24 * 3600 assert abs(microseconds) < 3.1e6 # Just a little bit of carrying possible for microseconds and seconds. seconds, us = divmod(microseconds, 1000000) s += seconds days, s = divmod(s, 24*3600) d += days assert isinstance(d, int) assert isinstance(s, int) and 0 <= s < 24*3600 assert isinstance(us, int) and 0 <= us < 1000000 if abs(d) > 999999999: raise OverflowError("timedelta # of days is too large: %d" % d) self = object.__new__(cls) self._days = d self._seconds = s self._microseconds = us self._hashcode = -1 return self def __repr__(self): args = [] if self._days: args.append("days=%d" % self._days) if self._seconds: args.append("seconds=%d" % self._seconds) if self._microseconds: args.append("microseconds=%d" % self._microseconds) if not args: args.append('0') return "%s.%s(%s)" % (self.__class__.__module__, self.__class__.__qualname__, ', '.join(args)) def __str__(self): mm, ss = divmod(self._seconds, 60) hh, mm = divmod(mm, 60) s = "%d:%02d:%02d" % (hh, mm, ss) if self._days: def plural(n): return n, abs(n) != 1 and "s" or "" s = ("%d day%s, " % plural(self._days)) + s if self._microseconds: s = s + ".%06d" % self._microseconds return s def total_seconds(self): """Total seconds in the duration.""" return ((self.days * 86400 + self.seconds) * 10**6 + self.microseconds) / 10**6 # Read-only field accessors @property def days(self): """days""" return self._days @property def seconds(self): """seconds""" return self._seconds @property def microseconds(self): """microseconds""" return self._microseconds def __add__(self, other): if isinstance(other, timedelta): # for CPython compatibility, we cannot use # our __class__ here, but need a real timedelta return timedelta(self._days + other._days, self._seconds + other._seconds, self._microseconds + other._microseconds) return NotImplemented __radd__ = __add__ def __sub__(self, other): if isinstance(other, timedelta): # for CPython compatibility, we cannot use # our __class__ here, but need a real timedelta return timedelta(self._days - other._days, self._seconds - other._seconds, self._microseconds - other._microseconds) return NotImplemented def __rsub__(self, other): if isinstance(other, timedelta): return -self + other return NotImplemented def __neg__(self): # for CPython compatibility, we cannot use # our __class__ here, but need a real timedelta return timedelta(-self._days, -self._seconds, -self._microseconds) def __pos__(self): return self def __abs__(self): if self._days < 0: return -self else: return self def __mul__(self, other): if isinstance(other, int): # for CPython compatibility, we cannot use # our __class__ here, but need a real timedelta return timedelta(self._days * other, self._seconds * other, self._microseconds * other) if isinstance(other, float): usec = self._to_microseconds() a, b = other.as_integer_ratio() return timedelta(0, 0, _divide_and_round(usec * a, b)) return NotImplemented __rmul__ = __mul__ def _to_microseconds(self): return ((self._days * (24*3600) + self._seconds) * 1000000 + self._microseconds) def __floordiv__(self, other): if not isinstance(other, (int, timedelta)): return NotImplemented usec = self._to_microseconds() if isinstance(other, timedelta): return usec // other._to_microseconds() if isinstance(other, int): return timedelta(0, 0, usec // other) def __truediv__(self, other): if not isinstance(other, (int, float, timedelta)): return NotImplemented usec = self._to_microseconds() if isinstance(other, timedelta): return usec / other._to_microseconds() if isinstance(other, int): return timedelta(0, 0, _divide_and_round(usec, other)) if isinstance(other, float): a, b = other.as_integer_ratio() return timedelta(0, 0, _divide_and_round(b * usec, a)) def __mod__(self, other): if isinstance(other, timedelta): r = self._to_microseconds() % other._to_microseconds() return timedelta(0, 0, r) return NotImplemented def __divmod__(self, other): if isinstance(other, timedelta): q, r = divmod(self._to_microseconds(), other._to_microseconds()) return q, timedelta(0, 0, r) return NotImplemented # Comparisons of timedelta objects with other. def __eq__(self, other): if isinstance(other, timedelta): return self._cmp(other) == 0 else: return NotImplemented def __le__(self, other): if isinstance(other, timedelta): return self._cmp(other) <= 0 else: return NotImplemented def __lt__(self, other): if isinstance(other, timedelta): return self._cmp(other) < 0 else: return NotImplemented def __ge__(self, other): if isinstance(other, timedelta): return self._cmp(other) >= 0 else: return NotImplemented def __gt__(self, other): if isinstance(other, timedelta): return self._cmp(other) > 0 else: return NotImplemented def _cmp(self, other): assert isinstance(other, timedelta) return _cmp(self._getstate(), other._getstate()) def __hash__(self): if self._hashcode == -1: self._hashcode = hash(self._getstate()) return self._hashcode def __bool__(self): return (self._days != 0 or self._seconds != 0 or self._microseconds != 0) # Pickle support. def _getstate(self): return (self._days, self._seconds, self._microseconds) def __reduce__(self): return (self.__class__, self._getstate()) timedelta.min = timedelta(-999999999) timedelta.max = timedelta(days=999999999, hours=23, minutes=59, seconds=59, microseconds=999999) timedelta.resolution = timedelta(microseconds=1) class date: """Concrete date type. Constructors: __new__() fromtimestamp() today() fromordinal() Operators: __repr__, __str__ __eq__, __le__, __lt__, __ge__, __gt__, __hash__ __add__, __radd__, __sub__ (add/radd only with timedelta arg) Methods: timetuple() toordinal() weekday() isoweekday(), isocalendar(), isoformat() ctime() strftime() Properties (readonly): year, month, day """ __slots__ = '_year', '_month', '_day', '_hashcode' def __new__(cls, year, month=None, day=None): """Constructor. Arguments: year, month, day (required, base 1) """ if (month is None and isinstance(year, (bytes, str)) and len(year) == 4 and 1 <= ord(year[2:3]) <= 12): # Pickle support if isinstance(year, str): try: year = year.encode('latin1') except UnicodeEncodeError: # More informative error message. raise ValueError( "Failed to encode latin1 string when unpickling " "a date object. " "pickle.load(data, encoding='latin1') is assumed.") self = object.__new__(cls) self.__setstate(year) self._hashcode = -1 return self year, month, day = _check_date_fields(year, month, day) self = object.__new__(cls) self._year = year self._month = month self._day = day self._hashcode = -1 return self # Additional constructors @classmethod def fromtimestamp(cls, t): "Construct a date from a POSIX timestamp (like time.time())." y, m, d, hh, mm, ss, weekday, jday, dst = _time.localtime(t) return cls(y, m, d) @classmethod def today(cls): "Construct a date from time.time()." t = _time.time() return cls.fromtimestamp(t) @classmethod def fromordinal(cls, n): """Construct a date from a proleptic Gregorian ordinal. January 1 of year 1 is day 1. Only the year, month and day are non-zero in the result. """ y, m, d = _ord2ymd(n) return cls(y, m, d) @classmethod def fromisoformat(cls, date_string): """Construct a date from a string in ISO 8601 format.""" if not isinstance(date_string, str): raise TypeError('fromisoformat: argument must be str') if len(date_string) not in (7, 8, 10): raise ValueError(f'Invalid isoformat string: {date_string!r}') try: return cls(*_parse_isoformat_date(date_string)) except Exception: raise ValueError(f'Invalid isoformat string: {date_string!r}') @classmethod def fromisocalendar(cls, year, week, day): """Construct a date from the ISO year, week number and weekday. This is the inverse of the date.isocalendar() function""" return cls(*_isoweek_to_gregorian(year, week, day)) # Conversions to string def __repr__(self): """Convert to formal string, for repr(). >>> dt = datetime(2010, 1, 1) >>> repr(dt) 'datetime.datetime(2010, 1, 1, 0, 0)' >>> dt = datetime(2010, 1, 1, tzinfo=timezone.utc) >>> repr(dt) 'datetime.datetime(2010, 1, 1, 0, 0, tzinfo=datetime.timezone.utc)' """ return "%s.%s(%d, %d, %d)" % (self.__class__.__module__, self.__class__.__qualname__, self._year, self._month, self._day) # XXX These shouldn't depend on time.localtime(), because that # clips the usable dates to [1970 .. 2038). At least ctime() is # easily done without using strftime() -- that's better too because # strftime("%c", ...) is locale specific. def ctime(self): "Return ctime() style string." weekday = self.toordinal() % 7 or 7 return "%s %s %2d 00:00:00 %04d" % ( _DAYNAMES[weekday], _MONTHNAMES[self._month], self._day, self._year) def strftime(self, fmt): "Format using strftime()." return _wrap_strftime(self, fmt, self.timetuple()) def __format__(self, fmt): if not isinstance(fmt, str): raise TypeError("must be str, not %s" % type(fmt).__name__) if len(fmt) != 0: return self.strftime(fmt) return str(self) def isoformat(self): """Return the date formatted according to ISO. This is 'YYYY-MM-DD'. References: - http://www.w3.org/TR/NOTE-datetime - http://www.cl.cam.ac.uk/~mgk25/iso-time.html """ return "%04d-%02d-%02d" % (self._year, self._month, self._day) __str__ = isoformat # Read-only field accessors @property def year(self): """year (1-9999)""" return self._year @property def month(self): """month (1-12)""" return self._month @property def day(self): """day (1-31)""" return self._day # Standard conversions, __eq__, __le__, __lt__, __ge__, __gt__, # __hash__ (and helpers) def timetuple(self): "Return local time tuple compatible with time.localtime()." return _build_struct_time(self._year, self._month, self._day, 0, 0, 0, -1) def toordinal(self): """Return proleptic Gregorian ordinal for the year, month and day. January 1 of year 1 is day 1. Only the year, month and day values contribute to the result. """ return _ymd2ord(self._year, self._month, self._day) def replace(self, year=None, month=None, day=None): """Return a new date with new values for the specified fields.""" if year is None: year = self._year if month is None: month = self._month if day is None: day = self._day return type(self)(year, month, day) # Comparisons of date objects with other. def __eq__(self, other): if isinstance(other, date): return self._cmp(other) == 0 return NotImplemented def __le__(self, other): if isinstance(other, date): return self._cmp(other) <= 0 return NotImplemented def __lt__(self, other): if isinstance(other, date): return self._cmp(other) < 0 return NotImplemented def __ge__(self, other): if isinstance(other, date): return self._cmp(other) >= 0 return NotImplemented def __gt__(self, other): if isinstance(other, date): return self._cmp(other) > 0 return NotImplemented def _cmp(self, other): assert isinstance(other, date) y, m, d = self._year, self._month, self._day y2, m2, d2 = other._year, other._month, other._day return _cmp((y, m, d), (y2, m2, d2)) def __hash__(self): "Hash." if self._hashcode == -1: self._hashcode = hash(self._getstate()) return self._hashcode # Computations def __add__(self, other): "Add a date to a timedelta." if isinstance(other, timedelta): o = self.toordinal() + other.days if 0 < o <= _MAXORDINAL: return type(self).fromordinal(o) raise OverflowError("result out of range") return NotImplemented __radd__ = __add__ def __sub__(self, other): """Subtract two dates, or a date and a timedelta.""" if isinstance(other, timedelta): return self + timedelta(-other.days) if isinstance(other, date): days1 = self.toordinal() days2 = other.toordinal() return timedelta(days1 - days2) return NotImplemented def weekday(self): "Return day of the week, where Monday == 0 ... Sunday == 6." return (self.toordinal() + 6) % 7 # Day-of-the-week and week-of-the-year, according to ISO def isoweekday(self): "Return day of the week, where Monday == 1 ... Sunday == 7." # 1-Jan-0001 is a Monday return self.toordinal() % 7 or 7 def isocalendar(self): """Return a named tuple containing ISO year, week number, and weekday. The first ISO week of the year is the (Mon-Sun) week containing the year's first Thursday; everything else derives from that. The first week is 1; Monday is 1 ... Sunday is 7. ISO calendar algorithm taken from http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm (used with permission) """ year = self._year week1monday = _isoweek1monday(year) today = _ymd2ord(self._year, self._month, self._day) # Internally, week and day have origin 0 week, day = divmod(today - week1monday, 7) if week < 0: year -= 1 week1monday = _isoweek1monday(year) week, day = divmod(today - week1monday, 7) elif week >= 52: if today >= _isoweek1monday(year+1): year += 1 week = 0 return _IsoCalendarDate(year, week+1, day+1) # Pickle support. def _getstate(self): yhi, ylo = divmod(self._year, 256) return bytes([yhi, ylo, self._month, self._day]), def __setstate(self, string): yhi, ylo, self._month, self._day = string self._year = yhi * 256 + ylo def __reduce__(self): return (self.__class__, self._getstate()) _date_class = date # so functions w/ args named "date" can get at the class date.min = date(1, 1, 1) date.max = date(9999, 12, 31) date.resolution = timedelta(days=1) class tzinfo: """Abstract base class for time zone info classes. Subclasses must override the name(), utcoffset() and dst() methods. """ __slots__ = () def tzname(self, dt): "datetime -> string name of time zone." raise NotImplementedError("tzinfo subclass must override tzname()") def utcoffset(self, dt): "datetime -> timedelta, positive for east of UTC, negative for west of UTC" raise NotImplementedError("tzinfo subclass must override utcoffset()") def dst(self, dt): """datetime -> DST offset as timedelta, positive for east of UTC. Return 0 if DST not in effect. utcoffset() must include the DST offset. """ raise NotImplementedError("tzinfo subclass must override dst()") def fromutc(self, dt): "datetime in UTC -> datetime in local time." if not isinstance(dt, datetime): raise TypeError("fromutc() requires a datetime argument") if dt.tzinfo is not self: raise ValueError("dt.tzinfo is not self") dtoff = dt.utcoffset() if dtoff is None: raise ValueError("fromutc() requires a non-None utcoffset() " "result") # See the long comment block at the end of this file for an # explanation of this algorithm. dtdst = dt.dst() if dtdst is None: raise ValueError("fromutc() requires a non-None dst() result") delta = dtoff - dtdst if delta: dt += delta dtdst = dt.dst() if dtdst is None: raise ValueError("fromutc(): dt.dst gave inconsistent " "results; cannot convert") return dt + dtdst # Pickle support. def __reduce__(self): getinitargs = getattr(self, "__getinitargs__", None) if getinitargs: args = getinitargs() else: args = () return (self.__class__, args, self.__getstate__()) class IsoCalendarDate(tuple): def __new__(cls, year, week, weekday, /): return super().__new__(cls, (year, week, weekday)) @property def year(self): return self[0] @property def week(self): return self[1] @property def weekday(self): return self[2] def __reduce__(self): # This code is intended to pickle the object without making the # class public. See https://bugs.python.org/msg352381 return (tuple, (tuple(self),)) def __repr__(self): return (f'{self.__class__.__name__}' f'(year={self[0]}, week={self[1]}, weekday={self[2]})') _IsoCalendarDate = IsoCalendarDate del IsoCalendarDate _tzinfo_class = tzinfo class time: """Time with time zone. Constructors: __new__() Operators: __repr__, __str__ __eq__, __le__, __lt__, __ge__, __gt__, __hash__ Methods: strftime() isoformat() utcoffset() tzname() dst() Properties (readonly): hour, minute, second, microsecond, tzinfo, fold """ __slots__ = '_hour', '_minute', '_second', '_microsecond', '_tzinfo', '_hashcode', '_fold' def __new__(cls, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0): """Constructor. Arguments: hour, minute (required) second, microsecond (default to zero) tzinfo (default to None) fold (keyword only, default to zero) """ if (isinstance(hour, (bytes, str)) and len(hour) == 6 and ord(hour[0:1])&0x7F < 24): # Pickle support if isinstance(hour, str): try: hour = hour.encode('latin1') except UnicodeEncodeError: # More informative error message. raise ValueError( "Failed to encode latin1 string when unpickling " "a time object. " "pickle.load(data, encoding='latin1') is assumed.") self = object.__new__(cls) self.__setstate(hour, minute or None) self._hashcode = -1 return self hour, minute, second, microsecond, fold = _check_time_fields( hour, minute, second, microsecond, fold) _check_tzinfo_arg(tzinfo) self = object.__new__(cls) self._hour = hour self._minute = minute self._second = second self._microsecond = microsecond self._tzinfo = tzinfo self._hashcode = -1 self._fold = fold return self # Read-only field accessors @property def hour(self): """hour (0-23)""" return self._hour @property def minute(self): """minute (0-59)""" return self._minute @property def second(self): """second (0-59)""" return self._second @property def microsecond(self): """microsecond (0-999999)""" return self._microsecond @property def tzinfo(self): """timezone info object""" return self._tzinfo @property def fold(self): return self._fold # Standard conversions, __hash__ (and helpers) # Comparisons of time objects with other. def __eq__(self, other): if isinstance(other, time): return self._cmp(other, allow_mixed=True) == 0 else: return NotImplemented def __le__(self, other): if isinstance(other, time): return self._cmp(other) <= 0 else: return NotImplemented def __lt__(self, other): if isinstance(other, time): return self._cmp(other) < 0 else: return NotImplemented def __ge__(self, other): if isinstance(other, time): return self._cmp(other) >= 0 else: return NotImplemented def __gt__(self, other): if isinstance(other, time): return self._cmp(other) > 0 else: return NotImplemented def _cmp(self, other, allow_mixed=False): assert isinstance(other, time) mytz = self._tzinfo ottz = other._tzinfo myoff = otoff = None if mytz is ottz: base_compare = True else: myoff = self.utcoffset() otoff = other.utcoffset() base_compare = myoff == otoff if base_compare: return _cmp((self._hour, self._minute, self._second, self._microsecond), (other._hour, other._minute, other._second, other._microsecond)) if myoff is None or otoff is None: if allow_mixed: return 2 # arbitrary non-zero value else: raise TypeError("cannot compare naive and aware times") myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1) othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1) return _cmp((myhhmm, self._second, self._microsecond), (othhmm, other._second, other._microsecond)) def __hash__(self): """Hash.""" if self._hashcode == -1: if self.fold: t = self.replace(fold=0) else: t = self tzoff = t.utcoffset() if not tzoff: # zero or None self._hashcode = hash(t._getstate()[0]) else: h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff, timedelta(hours=1)) assert not m % timedelta(minutes=1), "whole minute" m //= timedelta(minutes=1) if 0 <= h < 24: self._hashcode = hash(time(h, m, self.second, self.microsecond)) else: self._hashcode = hash((h, m, self.second, self.microsecond)) return self._hashcode # Conversion to string def _tzstr(self): """Return formatted timezone offset (+xx:xx) or an empty string.""" off = self.utcoffset() return _format_offset(off) def __repr__(self): """Convert to formal string, for repr().""" if self._microsecond != 0: s = ", %d, %d" % (self._second, self._microsecond) elif self._second != 0: s = ", %d" % self._second else: s = "" s= "%s.%s(%d, %d%s)" % (self.__class__.__module__, self.__class__.__qualname__, self._hour, self._minute, s) if self._tzinfo is not None: assert s[-1:] == ")" s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")" if self._fold: assert s[-1:] == ")" s = s[:-1] + ", fold=1)" return s def isoformat(self, timespec='auto'): """Return the time formatted according to ISO. The full format is 'HH:MM:SS.mmmmmm+zz:zz'. By default, the fractional part is omitted if self.microsecond == 0. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are 'auto', 'hours', 'minutes', 'seconds', 'milliseconds' and 'microseconds'. """ s = _format_time(self._hour, self._minute, self._second, self._microsecond, timespec) tz = self._tzstr() if tz: s += tz return s __str__ = isoformat @classmethod def fromisoformat(cls, time_string): """Construct a time from a string in one of the ISO 8601 formats.""" if not isinstance(time_string, str): raise TypeError('fromisoformat: argument must be str') # The spec actually requires that time-only ISO 8601 strings start with # T, but the extended format allows this to be omitted as long as there # is no ambiguity with date strings. time_string = time_string.removeprefix('T') try: return cls(*_parse_isoformat_time(time_string)) except Exception: raise ValueError(f'Invalid isoformat string: {time_string!r}') def strftime(self, fmt): """Format using strftime(). The date part of the timestamp passed to underlying strftime should not be used. """ # The year must be >= 1000 else Python's strftime implementation # can raise a bogus exception. timetuple = (1900, 1, 1, self._hour, self._minute, self._second, 0, 1, -1) return _wrap_strftime(self, fmt, timetuple) def __format__(self, fmt): if not isinstance(fmt, str): raise TypeError("must be str, not %s" % type(fmt).__name__) if len(fmt) != 0: return self.strftime(fmt) return str(self) # Timezone functions def utcoffset(self): """Return the timezone offset as timedelta, positive east of UTC (negative west of UTC).""" if self._tzinfo is None: return None offset = self._tzinfo.utcoffset(None) _check_utc_offset("utcoffset", offset) return offset def tzname(self): """Return the timezone name. Note that the name is 100% informational -- there's no requirement that it mean anything in particular. For example, "GMT", "UTC", "-500", "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies. """ if self._tzinfo is None: return None name = self._tzinfo.tzname(None) _check_tzname(name) return name def dst(self): """Return 0 if DST is not in effect, or the DST offset (as timedelta positive eastward) if DST is in effect. This is purely informational; the DST offset has already been added to the UTC offset returned by utcoffset() if applicable, so there's no need to consult dst() unless you're interested in displaying the DST info. """ if self._tzinfo is None: return None offset = self._tzinfo.dst(None) _check_utc_offset("dst", offset) return offset def replace(self, hour=None, minute=None, second=None, microsecond=None, tzinfo=True, *, fold=None): """Return a new time with new values for the specified fields.""" if hour is None: hour = self.hour if minute is None: minute = self.minute if second is None: second = self.second if microsecond is None: microsecond = self.microsecond if tzinfo is True: tzinfo = self.tzinfo if fold is None: fold = self._fold return type(self)(hour, minute, second, microsecond, tzinfo, fold=fold) # Pickle support. def _getstate(self, protocol=3): us2, us3 = divmod(self._microsecond, 256) us1, us2 = divmod(us2, 256) h = self._hour if self._fold and protocol > 3: h += 128 basestate = bytes([h, self._minute, self._second, us1, us2, us3]) if self._tzinfo is None: return (basestate,) else: return (basestate, self._tzinfo) def __setstate(self, string, tzinfo): if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): raise TypeError("bad tzinfo state arg") h, self._minute, self._second, us1, us2, us3 = string if h > 127: self._fold = 1 self._hour = h - 128 else: self._fold = 0 self._hour = h self._microsecond = (((us1 << 8) | us2) << 8) | us3 self._tzinfo = tzinfo def __reduce_ex__(self, protocol): return (self.__class__, self._getstate(protocol)) def __reduce__(self): return self.__reduce_ex__(2) _time_class = time # so functions w/ args named "time" can get at the class time.min = time(0, 0, 0) time.max = time(23, 59, 59, 999999) time.resolution = timedelta(microseconds=1) class datetime(date): """datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]]) The year, month and day arguments are required. tzinfo may be None, or an instance of a tzinfo subclass. The remaining arguments may be ints. """ __slots__ = date.__slots__ + time.__slots__ def __new__(cls, year, month=None, day=None, hour=0, minute=0, second=0, microsecond=0, tzinfo=None, *, fold=0): if (isinstance(year, (bytes, str)) and len(year) == 10 and 1 <= ord(year[2:3])&0x7F <= 12): # Pickle support if isinstance(year, str): try: year = bytes(year, 'latin1') except UnicodeEncodeError: # More informative error message. raise ValueError( "Failed to encode latin1 string when unpickling " "a datetime object. " "pickle.load(data, encoding='latin1') is assumed.") self = object.__new__(cls) self.__setstate(year, month) self._hashcode = -1 return self year, month, day = _check_date_fields(year, month, day) hour, minute, second, microsecond, fold = _check_time_fields( hour, minute, second, microsecond, fold) _check_tzinfo_arg(tzinfo) self = object.__new__(cls) self._year = year self._month = month self._day = day self._hour = hour self._minute = minute self._second = second self._microsecond = microsecond self._tzinfo = tzinfo self._hashcode = -1 self._fold = fold return self # Read-only field accessors @property def hour(self): """hour (0-23)""" return self._hour @property def minute(self): """minute (0-59)""" return self._minute @property def second(self): """second (0-59)""" return self._second @property def microsecond(self): """microsecond (0-999999)""" return self._microsecond @property def tzinfo(self): """timezone info object""" return self._tzinfo @property def fold(self): return self._fold @classmethod def _fromtimestamp(cls, t, utc, tz): """Construct a datetime from a POSIX timestamp (like time.time()). A timezone info object may be passed in as well. """ frac, t = _math.modf(t) us = round(frac * 1e6) if us >= 1000000: t += 1 us -= 1000000 elif us < 0: t -= 1 us += 1000000 converter = _time.gmtime if utc else _time.localtime y, m, d, hh, mm, ss, weekday, jday, dst = converter(t) ss = min(ss, 59) # clamp out leap seconds if the platform has them result = cls(y, m, d, hh, mm, ss, us, tz) if tz is None and not utc: # As of version 2015f max fold in IANA database is # 23 hours at 1969-09-30 13:00:00 in Kwajalein. # Let's probe 24 hours in the past to detect a transition: max_fold_seconds = 24 * 3600 # On Windows localtime_s throws an OSError for negative values, # thus we can't perform fold detection for values of time less # than the max time fold. See comments in _datetimemodule's # version of this method for more details. if t < max_fold_seconds and sys.platform.startswith("win"): return result y, m, d, hh, mm, ss = converter(t - max_fold_seconds)[:6] probe1 = cls(y, m, d, hh, mm, ss, us, tz) trans = result - probe1 - timedelta(0, max_fold_seconds) if trans.days < 0: y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6] probe2 = cls(y, m, d, hh, mm, ss, us, tz) if probe2 == result: result._fold = 1 elif tz is not None: result = tz.fromutc(result) return result @classmethod def fromtimestamp(cls, t, tz=None): """Construct a datetime from a POSIX timestamp (like time.time()). A timezone info object may be passed in as well. """ _check_tzinfo_arg(tz) return cls._fromtimestamp(t, tz is not None, tz) @classmethod def utcfromtimestamp(cls, t): """Construct a naive UTC datetime from a POSIX timestamp.""" return cls._fromtimestamp(t, True, None) @classmethod def now(cls, tz=None): "Construct a datetime from time.time() and optional time zone info." t = _time.time() return cls.fromtimestamp(t, tz) @classmethod def utcnow(cls): "Construct a UTC datetime from time.time()." t = _time.time() return cls.utcfromtimestamp(t) @classmethod def combine(cls, date, time, tzinfo=True): "Construct a datetime from a given date and a given time." if not isinstance(date, _date_class): raise TypeError("date argument must be a date instance") if not isinstance(time, _time_class): raise TypeError("time argument must be a time instance") if tzinfo is True: tzinfo = time.tzinfo return cls(date.year, date.month, date.day, time.hour, time.minute, time.second, time.microsecond, tzinfo, fold=time.fold) @classmethod def fromisoformat(cls, date_string): """Construct a datetime from a string in one of the ISO 8601 formats.""" if not isinstance(date_string, str): raise TypeError('fromisoformat: argument must be str') if len(date_string) < 7: raise ValueError(f'Invalid isoformat string: {date_string!r}') # Split this at the separator try: separator_location = _find_isoformat_datetime_separator(date_string) dstr = date_string[0:separator_location] tstr = date_string[(separator_location+1):] date_components = _parse_isoformat_date(dstr) except ValueError: raise ValueError( f'Invalid isoformat string: {date_string!r}') from None if tstr: try: time_components = _parse_isoformat_time(tstr) except ValueError: raise ValueError( f'Invalid isoformat string: {date_string!r}') from None else: time_components = [0, 0, 0, 0, None] return cls(*(date_components + time_components)) def timetuple(self): "Return local time tuple compatible with time.localtime()." dst = self.dst() if dst is None: dst = -1 elif dst: dst = 1 else: dst = 0 return _build_struct_time(self.year, self.month, self.day, self.hour, self.minute, self.second, dst) def _mktime(self): """Return integer POSIX timestamp.""" epoch = datetime(1970, 1, 1) max_fold_seconds = 24 * 3600 t = (self - epoch) // timedelta(0, 1) def local(u): y, m, d, hh, mm, ss = _time.localtime(u)[:6] return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1) # Our goal is to solve t = local(u) for u. a = local(t) - t u1 = t - a t1 = local(u1) if t1 == t: # We found one solution, but it may not be the one we need. # Look for an earlier solution (if `fold` is 0), or a # later one (if `fold` is 1). u2 = u1 + (-max_fold_seconds, max_fold_seconds)[self.fold] b = local(u2) - u2 if a == b: return u1 else: b = t1 - u1 assert a != b u2 = t - b t2 = local(u2) if t2 == t: return u2 if t1 == t: return u1 # We have found both offsets a and b, but neither t - a nor t - b is # a solution. This means t is in the gap. return (max, min)[self.fold](u1, u2) def timestamp(self): "Return POSIX timestamp as float" if self._tzinfo is None: s = self._mktime() return s + self.microsecond / 1e6 else: return (self - _EPOCH).total_seconds() def utctimetuple(self): "Return UTC time tuple compatible with time.gmtime()." offset = self.utcoffset() if offset: self -= offset y, m, d = self.year, self.month, self.day hh, mm, ss = self.hour, self.minute, self.second return _build_struct_time(y, m, d, hh, mm, ss, 0) def date(self): "Return the date part." return date(self._year, self._month, self._day) def time(self): "Return the time part, with tzinfo None." return time(self.hour, self.minute, self.second, self.microsecond, fold=self.fold) def timetz(self): "Return the time part, with same tzinfo." return time(self.hour, self.minute, self.second, self.microsecond, self._tzinfo, fold=self.fold) def replace(self, year=None, month=None, day=None, hour=None, minute=None, second=None, microsecond=None, tzinfo=True, *, fold=None): """Return a new datetime with new values for the specified fields.""" if year is None: year = self.year if month is None: month = self.month if day is None: day = self.day if hour is None: hour = self.hour if minute is None: minute = self.minute if second is None: second = self.second if microsecond is None: microsecond = self.microsecond if tzinfo is True: tzinfo = self.tzinfo if fold is None: fold = self.fold return type(self)(year, month, day, hour, minute, second, microsecond, tzinfo, fold=fold) def _local_timezone(self): if self.tzinfo is None: ts = self._mktime() else: ts = (self - _EPOCH) // timedelta(seconds=1) localtm = _time.localtime(ts) local = datetime(*localtm[:6]) # Extract TZ data gmtoff = localtm.tm_gmtoff zone = localtm.tm_zone return timezone(timedelta(seconds=gmtoff), zone) def astimezone(self, tz=None): if tz is None: tz = self._local_timezone() elif not isinstance(tz, tzinfo): raise TypeError("tz argument must be an instance of tzinfo") mytz = self.tzinfo if mytz is None: mytz = self._local_timezone() myoffset = mytz.utcoffset(self) else: myoffset = mytz.utcoffset(self) if myoffset is None: mytz = self.replace(tzinfo=None)._local_timezone() myoffset = mytz.utcoffset(self) if tz is mytz: return self # Convert self to UTC, and attach the new time zone object. utc = (self - myoffset).replace(tzinfo=tz) # Convert from UTC to tz's local time. return tz.fromutc(utc) # Ways to produce a string. def ctime(self): "Return ctime() style string." weekday = self.toordinal() % 7 or 7 return "%s %s %2d %02d:%02d:%02d %04d" % ( _DAYNAMES[weekday], _MONTHNAMES[self._month], self._day, self._hour, self._minute, self._second, self._year) def isoformat(self, sep='T', timespec='auto'): """Return the time formatted according to ISO. The full format looks like 'YYYY-MM-DD HH:MM:SS.mmmmmm'. By default, the fractional part is omitted if self.microsecond == 0. If self.tzinfo is not None, the UTC offset is also attached, giving giving a full format of 'YYYY-MM-DD HH:MM:SS.mmmmmm+HH:MM'. Optional argument sep specifies the separator between date and time, default 'T'. The optional argument timespec specifies the number of additional terms of the time to include. Valid options are 'auto', 'hours', 'minutes', 'seconds', 'milliseconds' and 'microseconds'. """ s = ("%04d-%02d-%02d%c" % (self._year, self._month, self._day, sep) + _format_time(self._hour, self._minute, self._second, self._microsecond, timespec)) off = self.utcoffset() tz = _format_offset(off) if tz: s += tz return s def __repr__(self): """Convert to formal string, for repr().""" L = [self._year, self._month, self._day, # These are never zero self._hour, self._minute, self._second, self._microsecond] if L[-1] == 0: del L[-1] if L[-1] == 0: del L[-1] s = "%s.%s(%s)" % (self.__class__.__module__, self.__class__.__qualname__, ", ".join(map(str, L))) if self._tzinfo is not None: assert s[-1:] == ")" s = s[:-1] + ", tzinfo=%r" % self._tzinfo + ")" if self._fold: assert s[-1:] == ")" s = s[:-1] + ", fold=1)" return s def __str__(self): "Convert to string, for str()." return self.isoformat(sep=' ') @classmethod def strptime(cls, date_string, format): 'string, format -> new datetime parsed from a string (like time.strptime()).' import _strptime return _strptime._strptime_datetime(cls, date_string, format) def utcoffset(self): """Return the timezone offset as timedelta positive east of UTC (negative west of UTC).""" if self._tzinfo is None: return None offset = self._tzinfo.utcoffset(self) _check_utc_offset("utcoffset", offset) return offset def tzname(self): """Return the timezone name. Note that the name is 100% informational -- there's no requirement that it mean anything in particular. For example, "GMT", "UTC", "-500", "-5:00", "EDT", "US/Eastern", "America/New York" are all valid replies. """ if self._tzinfo is None: return None name = self._tzinfo.tzname(self) _check_tzname(name) return name def dst(self): """Return 0 if DST is not in effect, or the DST offset (as timedelta positive eastward) if DST is in effect. This is purely informational; the DST offset has already been added to the UTC offset returned by utcoffset() if applicable, so there's no need to consult dst() unless you're interested in displaying the DST info. """ if self._tzinfo is None: return None offset = self._tzinfo.dst(self) _check_utc_offset("dst", offset) return offset # Comparisons of datetime objects with other. def __eq__(self, other): if isinstance(other, datetime): return self._cmp(other, allow_mixed=True) == 0 elif not isinstance(other, date): return NotImplemented else: return False def __le__(self, other): if isinstance(other, datetime): return self._cmp(other) <= 0 elif not isinstance(other, date): return NotImplemented else: _cmperror(self, other) def __lt__(self, other): if isinstance(other, datetime): return self._cmp(other) < 0 elif not isinstance(other, date): return NotImplemented else: _cmperror(self, other) def __ge__(self, other): if isinstance(other, datetime): return self._cmp(other) >= 0 elif not isinstance(other, date): return NotImplemented else: _cmperror(self, other) def __gt__(self, other): if isinstance(other, datetime): return self._cmp(other) > 0 elif not isinstance(other, date): return NotImplemented else: _cmperror(self, other) def _cmp(self, other, allow_mixed=False): assert isinstance(other, datetime) mytz = self._tzinfo ottz = other._tzinfo myoff = otoff = None if mytz is ottz: base_compare = True else: myoff = self.utcoffset() otoff = other.utcoffset() # Assume that allow_mixed means that we are called from __eq__ if allow_mixed: if myoff != self.replace(fold=not self.fold).utcoffset(): return 2 if otoff != other.replace(fold=not other.fold).utcoffset(): return 2 base_compare = myoff == otoff if base_compare: return _cmp((self._year, self._month, self._day, self._hour, self._minute, self._second, self._microsecond), (other._year, other._month, other._day, other._hour, other._minute, other._second, other._microsecond)) if myoff is None or otoff is None: if allow_mixed: return 2 # arbitrary non-zero value else: raise TypeError("cannot compare naive and aware datetimes") # XXX What follows could be done more efficiently... diff = self - other # this will take offsets into account if diff.days < 0: return -1 return diff and 1 or 0 def __add__(self, other): "Add a datetime and a timedelta." if not isinstance(other, timedelta): return NotImplemented delta = timedelta(self.toordinal(), hours=self._hour, minutes=self._minute, seconds=self._second, microseconds=self._microsecond) delta += other hour, rem = divmod(delta.seconds, 3600) minute, second = divmod(rem, 60) if 0 < delta.days <= _MAXORDINAL: return type(self).combine(date.fromordinal(delta.days), time(hour, minute, second, delta.microseconds, tzinfo=self._tzinfo)) raise OverflowError("result out of range") __radd__ = __add__ def __sub__(self, other): "Subtract two datetimes, or a datetime and a timedelta." if not isinstance(other, datetime): if isinstance(other, timedelta): return self + -other return NotImplemented days1 = self.toordinal() days2 = other.toordinal() secs1 = self._second + self._minute * 60 + self._hour * 3600 secs2 = other._second + other._minute * 60 + other._hour * 3600 base = timedelta(days1 - days2, secs1 - secs2, self._microsecond - other._microsecond) if self._tzinfo is other._tzinfo: return base myoff = self.utcoffset() otoff = other.utcoffset() if myoff == otoff: return base if myoff is None or otoff is None: raise TypeError("cannot mix naive and timezone-aware time") return base + otoff - myoff def __hash__(self): if self._hashcode == -1: if self.fold: t = self.replace(fold=0) else: t = self tzoff = t.utcoffset() if tzoff is None: self._hashcode = hash(t._getstate()[0]) else: days = _ymd2ord(self.year, self.month, self.day) seconds = self.hour * 3600 + self.minute * 60 + self.second self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff) return self._hashcode # Pickle support. def _getstate(self, protocol=3): yhi, ylo = divmod(self._year, 256) us2, us3 = divmod(self._microsecond, 256) us1, us2 = divmod(us2, 256) m = self._month if self._fold and protocol > 3: m += 128 basestate = bytes([yhi, ylo, m, self._day, self._hour, self._minute, self._second, us1, us2, us3]) if self._tzinfo is None: return (basestate,) else: return (basestate, self._tzinfo) def __setstate(self, string, tzinfo): if tzinfo is not None and not isinstance(tzinfo, _tzinfo_class): raise TypeError("bad tzinfo state arg") (yhi, ylo, m, self._day, self._hour, self._minute, self._second, us1, us2, us3) = string if m > 127: self._fold = 1 self._month = m - 128 else: self._fold = 0 self._month = m self._year = yhi * 256 + ylo self._microsecond = (((us1 << 8) | us2) << 8) | us3 self._tzinfo = tzinfo def __reduce_ex__(self, protocol): return (self.__class__, self._getstate(protocol)) def __reduce__(self): return self.__reduce_ex__(2) datetime.min = datetime(1, 1, 1) datetime.max = datetime(9999, 12, 31, 23, 59, 59, 999999) datetime.resolution = timedelta(microseconds=1) def _isoweek1monday(year): # Helper to calculate the day number of the Monday starting week 1 # XXX This could be done more efficiently THURSDAY = 3 firstday = _ymd2ord(year, 1, 1) firstweekday = (firstday + 6) % 7 # See weekday() above week1monday = firstday - firstweekday if firstweekday > THURSDAY: week1monday += 7 return week1monday class timezone(tzinfo): __slots__ = '_offset', '_name' # Sentinel value to disallow None _Omitted = object() def __new__(cls, offset, name=_Omitted): if not isinstance(offset, timedelta): raise TypeError("offset must be a timedelta") if name is cls._Omitted: if not offset: return cls.utc name = None elif not isinstance(name, str): raise TypeError("name must be a string") if not cls._minoffset <= offset <= cls._maxoffset: raise ValueError("offset must be a timedelta " "strictly between -timedelta(hours=24) and " "timedelta(hours=24).") return cls._create(offset, name) @classmethod def _create(cls, offset, name=None): self = tzinfo.__new__(cls) self._offset = offset self._name = name return self def __getinitargs__(self): """pickle support""" if self._name is None: return (self._offset,) return (self._offset, self._name) def __eq__(self, other): if isinstance(other, timezone): return self._offset == other._offset return NotImplemented def __hash__(self): return hash(self._offset) def __repr__(self): """Convert to formal string, for repr(). >>> tz = timezone.utc >>> repr(tz) 'datetime.timezone.utc' >>> tz = timezone(timedelta(hours=-5), 'EST') >>> repr(tz) "datetime.timezone(datetime.timedelta(-1, 68400), 'EST')" """ if self is self.utc: return 'datetime.timezone.utc' if self._name is None: return "%s.%s(%r)" % (self.__class__.__module__, self.__class__.__qualname__, self._offset) return "%s.%s(%r, %r)" % (self.__class__.__module__, self.__class__.__qualname__, self._offset, self._name) def __str__(self): return self.tzname(None) def utcoffset(self, dt): if isinstance(dt, datetime) or dt is None: return self._offset raise TypeError("utcoffset() argument must be a datetime instance" " or None") def tzname(self, dt): if isinstance(dt, datetime) or dt is None: if self._name is None: return self._name_from_offset(self._offset) return self._name raise TypeError("tzname() argument must be a datetime instance" " or None") def dst(self, dt): if isinstance(dt, datetime) or dt is None: return None raise TypeError("dst() argument must be a datetime instance" " or None") def fromutc(self, dt): if isinstance(dt, datetime): if dt.tzinfo is not self: raise ValueError("fromutc: dt.tzinfo " "is not self") return dt + self._offset raise TypeError("fromutc() argument must be a datetime instance" " or None") _maxoffset = timedelta(hours=24, microseconds=-1) _minoffset = -_maxoffset @staticmethod def _name_from_offset(delta): if not delta: return 'UTC' if delta < timedelta(0): sign = '-' delta = -delta else: sign = '+' hours, rest = divmod(delta, timedelta(hours=1)) minutes, rest = divmod(rest, timedelta(minutes=1)) seconds = rest.seconds microseconds = rest.microseconds if microseconds: return (f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}' f'.{microseconds:06d}') if seconds: return f'UTC{sign}{hours:02d}:{minutes:02d}:{seconds:02d}' return f'UTC{sign}{hours:02d}:{minutes:02d}' UTC = timezone.utc = timezone._create(timedelta(0)) # bpo-37642: These attributes are rounded to the nearest minute for backwards # compatibility, even though the constructor will accept a wider range of # values. This may change in the future. timezone.min = timezone._create(-timedelta(hours=23, minutes=59)) timezone.max = timezone._create(timedelta(hours=23, minutes=59)) _EPOCH = datetime(1970, 1, 1, tzinfo=timezone.utc) # Some time zone algebra. For a datetime x, let # x.n = x stripped of its timezone -- its naive time. # x.o = x.utcoffset(), and assuming that doesn't raise an exception or # return None # x.d = x.dst(), and assuming that doesn't raise an exception or # return None # x.s = x's standard offset, x.o - x.d # # Now some derived rules, where k is a duration (timedelta). # # 1. x.o = x.s + x.d # This follows from the definition of x.s. # # 2. If x and y have the same tzinfo member, x.s = y.s. # This is actually a requirement, an assumption we need to make about # sane tzinfo classes. # # 3. The naive UTC time corresponding to x is x.n - x.o. # This is again a requirement for a sane tzinfo class. # # 4. (x+k).s = x.s # This follows from #2, and that datetime.timetz+timedelta preserves tzinfo. # # 5. (x+k).n = x.n + k # Again follows from how arithmetic is defined. # # Now we can explain tz.fromutc(x). Let's assume it's an interesting case # (meaning that the various tzinfo methods exist, and don't blow up or return # None when called). # # The function wants to return a datetime y with timezone tz, equivalent to x. # x is already in UTC. # # By #3, we want # # y.n - y.o = x.n [1] # # The algorithm starts by attaching tz to x.n, and calling that y. So # x.n = y.n at the start. Then it wants to add a duration k to y, so that [1] # becomes true; in effect, we want to solve [2] for k: # # (y+k).n - (y+k).o = x.n [2] # # By #1, this is the same as # # (y+k).n - ((y+k).s + (y+k).d) = x.n [3] # # By #5, (y+k).n = y.n + k, which equals x.n + k because x.n=y.n at the start. # Substituting that into [3], # # x.n + k - (y+k).s - (y+k).d = x.n; the x.n terms cancel, leaving # k - (y+k).s - (y+k).d = 0; rearranging, # k = (y+k).s - (y+k).d; by #4, (y+k).s == y.s, so # k = y.s - (y+k).d # # On the RHS, (y+k).d can't be computed directly, but y.s can be, and we # approximate k by ignoring the (y+k).d term at first. Note that k can't be # very large, since all offset-returning methods return a duration of magnitude # less than 24 hours. For that reason, if y is firmly in std time, (y+k).d must # be 0, so ignoring it has no consequence then. # # In any case, the new value is # # z = y + y.s [4] # # It's helpful to step back at look at [4] from a higher level: it's simply # mapping from UTC to tz's standard time. # # At this point, if # # z.n - z.o = x.n [5] # # we have an equivalent time, and are almost done. The insecurity here is # at the start of daylight time. Picture US Eastern for concreteness. The wall # time jumps from 1:59 to 3:00, and wall hours of the form 2:MM don't make good # sense then. The docs ask that an Eastern tzinfo class consider such a time to # be EDT (because it's "after 2"), which is a redundant spelling of 1:MM EST # on the day DST starts. We want to return the 1:MM EST spelling because that's # the only spelling that makes sense on the local wall clock. # # In fact, if [5] holds at this point, we do have the standard-time spelling, # but that takes a bit of proof. We first prove a stronger result. What's the # difference between the LHS and RHS of [5]? Let # # diff = x.n - (z.n - z.o) [6] # # Now # z.n = by [4] # (y + y.s).n = by #5 # y.n + y.s = since y.n = x.n # x.n + y.s = since z and y are have the same tzinfo member, # y.s = z.s by #2 # x.n + z.s # # Plugging that back into [6] gives # # diff = # x.n - ((x.n + z.s) - z.o) = expanding # x.n - x.n - z.s + z.o = cancelling # - z.s + z.o = by #2 # z.d # # So diff = z.d. # # If [5] is true now, diff = 0, so z.d = 0 too, and we have the standard-time # spelling we wanted in the endcase described above. We're done. Contrarily, # if z.d = 0, then we have a UTC equivalent, and are also done. # # If [5] is not true now, diff = z.d != 0, and z.d is the offset we need to # add to z (in effect, z is in tz's standard time, and we need to shift the # local clock into tz's daylight time). # # Let # # z' = z + z.d = z + diff [7] # # and we can again ask whether # # z'.n - z'.o = x.n [8] # # If so, we're done. If not, the tzinfo class is insane, according to the # assumptions we've made. This also requires a bit of proof. As before, let's # compute the difference between the LHS and RHS of [8] (and skipping some of # the justifications for the kinds of substitutions we've done several times # already): # # diff' = x.n - (z'.n - z'.o) = replacing z'.n via [7] # x.n - (z.n + diff - z'.o) = replacing diff via [6] # x.n - (z.n + x.n - (z.n - z.o) - z'.o) = # x.n - z.n - x.n + z.n - z.o + z'.o = cancel x.n # - z.n + z.n - z.o + z'.o = cancel z.n # - z.o + z'.o = #1 twice # -z.s - z.d + z'.s + z'.d = z and z' have same tzinfo # z'.d - z.d # # So z' is UTC-equivalent to x iff z'.d = z.d at this point. If they are equal, # we've found the UTC-equivalent so are done. In fact, we stop with [7] and # return z', not bothering to compute z'.d. # # How could z.d and z'd differ? z' = z + z.d [7], so merely moving z' by # a dst() offset, and starting *from* a time already in DST (we know z.d != 0), # would have to change the result dst() returns: we start in DST, and moving # a little further into it takes us out of DST. # # There isn't a sane case where this can happen. The closest it gets is at # the end of DST, where there's an hour in UTC with no spelling in a hybrid # tzinfo class. In US Eastern, that's 5:MM UTC = 0:MM EST = 1:MM EDT. During # that hour, on an Eastern clock 1:MM is taken as being in standard time (6:MM # UTC) because the docs insist on that, but 0:MM is taken as being in daylight # time (4:MM UTC). There is no local time mapping to 5:MM UTC. The local # clock jumps from 1:59 back to 1:00 again, and repeats the 1:MM hour in # standard time. Since that's what the local clock *does*, we want to map both # UTC hours 5:MM and 6:MM to 1:MM Eastern. The result is ambiguous # in local time, but so it goes -- it's the way the local clock works. # # When x = 5:MM UTC is the input to this algorithm, x.o=0, y.o=-5 and y.d=0, # so z=0:MM. z.d=60 (minutes) then, so [5] doesn't hold and we keep going. # z' = z + z.d = 1:MM then, and z'.d=0, and z'.d - z.d = -60 != 0 so [8] # (correctly) concludes that z' is not UTC-equivalent to x. # # Because we know z.d said z was in daylight time (else [5] would have held and # we would have stopped then), and we know z.d != z'.d (else [8] would have held # and we have stopped then), and there are only 2 possible values dst() can # return in Eastern, it follows that z'.d must be 0 (which it is in the example, # but the reasoning doesn't depend on the example -- it depends on there being # two possible dst() outcomes, one zero and the other non-zero). Therefore # z' must be in standard time, and is the spelling we want in this case. # # Note again that z' is not UTC-equivalent as far as the hybrid tzinfo class is # concerned (because it takes z' as being in standard time rather than the # daylight time we intend here), but returning it gives the real-life "local # clock repeats an hour" behavior when mapping the "unspellable" UTC hour into # tz. # # When the input is 6:MM, z=1:MM and z.d=0, and we stop at once, again with # the 1:MM standard time spelling we want. # # So how can this break? One of the assumptions must be violated. Two # possibilities: # # 1) [2] effectively says that y.s is invariant across all y belong to a given # time zone. This isn't true if, for political reasons or continental drift, # a region decides to change its base offset from UTC. # # 2) There may be versions of "double daylight" time where the tail end of # the analysis gives up a step too early. I haven't thought about that # enough to say. # # In any case, it's clear that the default fromutc() is strong enough to handle # "almost all" time zones: so long as the standard offset is invariant, it # doesn't matter if daylight time transition points change from year to year, or # if daylight time is skipped in some years; it doesn't matter how large or # small dst() may get within its bounds; and it doesn't even matter if some # perverse time zone returns a negative dst()). So a breaking case must be # pretty bizarre, and a tzinfo subclass can override fromutc() if it is. try: from _datetime import * except ImportError: pass else: # Clean up unused names del (_DAYNAMES, _DAYS_BEFORE_MONTH, _DAYS_IN_MONTH, _DI100Y, _DI400Y, _DI4Y, _EPOCH, _MAXORDINAL, _MONTHNAMES, _build_struct_time, _check_date_fields, _check_time_fields, _check_tzinfo_arg, _check_tzname, _check_utc_offset, _cmp, _cmperror, _date_class, _days_before_month, _days_before_year, _days_in_month, _format_time, _format_offset, _index, _is_leap, _isoweek1monday, _math, _ord2ymd, _time, _time_class, _tzinfo_class, _wrap_strftime, _ymd2ord, _divide_and_round, _parse_isoformat_date, _parse_isoformat_time, _parse_hh_mm_ss_ff, _IsoCalendarDate, _isoweek_to_gregorian, _find_isoformat_datetime_separator, _FRACTION_CORRECTION, _is_ascii_digit) # XXX Since import * above excludes names that start with _, # docstring does not get overwritten. In the future, it may be # appropriate to maintain a single module level docstring and # remove the following line. from _datetime import __doc__ python-executing-2.2.0/tests/samples/db.py000066400000000000000000000176261474076367500206310ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import functools import sys from future import standard_library from sqlalchemy.exc import OperationalError, InterfaceError, InternalError, ProgrammingError, ArgumentError standard_library.install_aliases() import json import os from typing import List from contextlib import contextmanager from humanize import naturaltime from markupsafe import Markup from sqlalchemy import Sequence, UniqueConstraint, create_engine, Column, Integer, Text, ForeignKey, DateTime, String, \ Index from sqlalchemy.ext.declarative import declarative_base, declared_attr from sqlalchemy.orm import backref, relationship, sessionmaker from sqlalchemy.dialects.mysql import LONGTEXT from littleutils import select_attrs, retry from birdseye.utils import IPYTHON_FILE_PATH, is_ipython_cell from sqlalchemy.dialects.mysql.base import RESERVED_WORDS RESERVED_WORDS.add('function') DB_VERSION = 1 class Database(object): def __init__(self, db_uri=None, _skip_version_check=False): self.db_uri = db_uri = ( db_uri or os.environ.get('BIRDSEYE_DB') or os.path.join(os.path.expanduser('~'), '.birdseye.db')) kwargs = dict( pool_recycle=280, echo=False, # for convenience when debugging ) try: engine = create_engine(db_uri, **kwargs) except ArgumentError: db_uri = 'sqlite:///' + db_uri engine = create_engine(db_uri, **kwargs) self.engine = engine self.Session = sessionmaker(bind=engine) class Base(object): @declared_attr def __tablename__(cls): return cls.__name__.lower() Base = declarative_base(cls=Base) # type: ignore class KeyValue(Base): key = Column(String(50), primary_key=True) value = Column(Text) db_self = self class KeyValueStore(object): def __getitem__(self, item): with db_self.session_scope() as session: return (session .query(KeyValue.value) .filter_by(key=item) .scalar()) def __setitem__(self, key, value): with db_self.session_scope() as session: session.query(KeyValue).filter_by(key=key).delete() session.add(KeyValue(key=key, value=str(value))) __getattr__ = __getitem__ __setattr__ = __setitem__ LongText = LONGTEXT if engine.name == 'mysql' else Text class Call(Base): id = Column(String(length=32), primary_key=True) function_id = Column(Integer, ForeignKey('function.id'), index=True) function = relationship('Function', backref=backref('calls', lazy='dynamic')) arguments = Column(Text) return_value = Column(Text) exception = Column(Text) traceback = Column(Text) data = Column(LongText) start_time = Column(DateTime, index=True) @property def pretty_start_time(self): return self._pretty_time(self.start_time) @staticmethod def _pretty_time(dt): if not dt: return '' return Markup('%s (%s)' % ( dt.strftime('%Y-%m-%d %H:%M:%S'), naturaltime(dt))) @property def state_icon(self): return Markup('' % ( ('ok', 'green') if self.success else ('remove', 'red'))) @property def success(self): if self.exception: assert self.traceback assert self.return_value == 'None' return False else: assert not self.traceback return True @property def result(self): if self.success: return str(self.return_value) else: return str(self.exception) @property def arguments_list(self): return json.loads(self.arguments) @property def parsed_data(self): return json.loads(self.data) @staticmethod def basic_dict(call): return dict(arguments=call.arguments_list, **select_attrs(call, 'id function_id return_value traceback ' 'exception start_time')) basic_columns = (id, function_id, return_value, traceback, exception, start_time, arguments) class Function(Base): id = Column(Integer, Sequence('function_id_seq'), primary_key=True) file = Column(Text) name = Column(Text) type = Column(Text) # function or module html_body = Column(LongText) lineno = Column(Integer) data = Column(LongText) hash = Column(String(length=64), index=True) body_hash = Column(String(length=64), index=True) __table_args__ = ( UniqueConstraint('hash', name='everything_unique'), Index('idx_file', 'file', mysql_length=256), Index('idx_name', 'name', mysql_length=32), ) @property def parsed_data(self): return json.loads(self.data) @staticmethod def basic_dict(func): return select_attrs(func, 'file name lineno hash body_hash type') basic_columns = (file, name, lineno, hash, body_hash, type) self.Call = Call self.Function = Function self._KeyValue = KeyValue self.key_value_store = kv = KeyValueStore() if _skip_version_check: return if not self.table_exists(Function): Base.metadata.create_all(engine) kv.version = DB_VERSION elif not self.table_exists(KeyValue) or int(kv.version) < DB_VERSION: sys.exit('The birdseye database schema is out of date. ' 'Run "python -m birdseye.clear_db" to delete the existing tables.') def table_exists(self, table): return self.engine.dialect.has_table(self.engine, table.__name__) def all_file_paths(self): # type: () -> List[str] with self.session_scope() as session: paths = [f[0] for f in session.query(self.Function.file).distinct() if not is_ipython_cell(f[0])] paths.sort() if IPYTHON_FILE_PATH in paths: paths.remove(IPYTHON_FILE_PATH) paths.insert(0, IPYTHON_FILE_PATH) return paths def clear(self): for model in [self.Call, self.Function, self._KeyValue]: if self.table_exists(model): model.__table__.drop(self.engine) @contextmanager def session_scope(self): """Provide a transactional scope around a series of operations.""" session = self.Session() try: yield session session.commit() except: session.rollback() raise finally: session.close() def provide_session(self, func): @functools.wraps(func) def wrapper(*args, **kwargs): with self.session_scope() as session: return func(session, *args, **kwargs) return retry_db(wrapper) # Based on https://docs.sqlalchemy.org/en/latest/errors.html#error-dbapi retry_db = retry(3, (InterfaceError, OperationalError, InternalError, ProgrammingError)) python-executing-2.2.0/tests/samples/executing.py000066400000000000000000000357741474076367500222430ustar00rootroot00000000000000""" Get information about what a frame is currently doing. Typical usage: import executing node = executing.Source.executing(frame).node # node will be an AST node or None """ import __future__ import ast import dis import functools import inspect import io import linecache import sys from collections import defaultdict, namedtuple, Sized from itertools import islice from lib2to3.pgen2.tokenize import cookie_re as encoding_pattern from operator import attrgetter from threading import RLock __all__ = ["Source"] PY3 = sys.version_info[0] == 3 if PY3: # noinspection PyUnresolvedReferences from functools import lru_cache # noinspection PyUnresolvedReferences from tokenize import detect_encoding cache = lru_cache(maxsize=None) text_type = str else: from lib2to3.pgen2.tokenize import detect_encoding def cache(func): d = {} @functools.wraps(func) def wrapper(*args): if args in d: return d[args] result = d[args] = func(*args) return result return wrapper # noinspection PyUnresolvedReferences text_type = unicode try: # noinspection PyUnresolvedReferences get_instructions = dis.get_instructions except AttributeError: Instruction = namedtuple('Instruction', 'offset argval opname') from dis import HAVE_ARGUMENT, EXTENDED_ARG, hasconst, opname # Based on dis.disassemble from 2.7 # Left as similar as possible for easy diff def get_instructions(co): code = co.co_code n = len(code) i = 0 extended_arg = 0 while i < n: offset = i c = code[i] op = ord(c) argval = None i = i + 1 if op >= HAVE_ARGUMENT: oparg = ord(code[i]) + ord(code[i + 1]) * 256 + extended_arg extended_arg = 0 i = i + 2 if op == EXTENDED_ARG: extended_arg = oparg * 65536 if op in hasconst: argval = co.co_consts[oparg] yield Instruction(offset, argval, opname[op]) class NotOneValueFound(Exception): pass def only(it): if isinstance(it, Sized): if len(it) != 1: raise NotOneValueFound('Expected one value, found %s' % len(it)) # noinspection PyTypeChecker return list(it)[0] lst = tuple(islice(it, 2)) if len(lst) == 0: raise NotOneValueFound('Expected one value, found 0') if len(lst) > 1: raise NotOneValueFound('Expected one value, found several') return lst[0] class Source(object): """ The source code of a single file and associated metadata. The main method of interest is the classmethod `executing(frame)`. If you want an instance of this class, don't construct it. Ideally use the classmethod `for_frame(frame)`. If you don't have a frame, use `for_filename(filename [, module_globals])`. These methods cache instances by filename, so at most one instance exists per filename. Attributes: - filename - text - tree: AST parsed from text, or None if text is not valid Python All nodes in the tree have an extra `parent` attribute Other methods of interest: - statements_at_line - asttokens - code_qualname """ def __init__(self, filename, text): """ Don't call this constructor, see the class docstring. """ self.filename = filename if not isinstance(text, text_type): text = self.decode_source(text) self.text = text if PY3: ast_text = text else: # In python 2 it's a syntax error to parse unicode # with an encoding declaration, so we remove it but # leave empty lines in its place to keep line numbers the same ast_text = ''.join([ '\n' if i < 2 and encoding_pattern.match(line) else line for i, line in enumerate(text.splitlines(True)) ]) self._nodes_by_line = defaultdict(list) self.tree = None self._qualnames = {} if text: try: self.tree = ast.parse(ast_text, filename=filename) except SyntaxError: pass else: for node in ast.walk(self.tree): for child in ast.iter_child_nodes(node): child.parent = node if hasattr(node, 'lineno'): self._nodes_by_line[node.lineno].append(node) visitor = QualnameVisitor() visitor.visit(self.tree) self._qualnames = visitor.qualnames @classmethod def for_frame(cls, frame): """ Returns the `Source` object corresponding to the file the frame is executing in. """ return cls.for_filename(frame.f_code.co_filename, frame.f_globals or {}) @classmethod def for_filename(cls, filename, module_globals=None): source_cache = cls._class_local('__source_cache', {}) try: return source_cache[filename] except KeyError: pass lines = linecache.getlines(filename, module_globals) result = source_cache[filename] = cls(filename, ''.join(lines)) return result @classmethod def lazycache(cls, frame): if hasattr(linecache, 'lazycache'): linecache.lazycache(frame.f_code.co_filename, frame.f_globals) @classmethod def executing(cls, frame): """ Returns an `Executing` object representing the operation currently executing in the given frame. """ key = (frame.f_code, frame.f_lasti) executing_cache = cls._class_local('__executing_cache', {}) try: args = executing_cache[key] except KeyError: source = cls.for_frame(frame) node = stmts = None if source.tree: stmts = source.statements_at_line(frame.f_lineno) try: node = NodeFinder(frame, stmts, source.tree).result except Exception: raise else: new_stmts = {statement_containing_node(node)} assert new_stmts <= stmts stmts = new_stmts args = source, node, stmts executing_cache[key] = args return Executing(frame, *args) @classmethod def _class_local(cls, name, default): """ Returns an attribute directly associated with this class (as opposed to subclasses), setting default if necessary """ # classes have a mappingproxy preventing us from using setdefault result = cls.__dict__.get(name, default) setattr(cls, name, result) return result @cache def statements_at_line(self, lineno): """ Returns the statement nodes overlapping the given line. Returns at most one statement unless semicolons are present. If the `text` attribute is not valid python, meaning `tree` is None, returns an empty set. Otherwise, `Source.for_frame(frame).statements_at_line(frame.f_lineno)` should return at least one statement. """ return { statement_containing_node(node) for node in self._nodes_by_line[lineno] } @cache def asttokens(self): """ Returns an ASTTokens object for getting the source of specific AST nodes. See http://asttokens.readthedocs.io/en/latest/api-index.html """ from asttokens import ASTTokens # must be installed separately return ASTTokens( self.text, tree=self.tree, filename=self.filename, ) @staticmethod def decode_source(source): if isinstance(source, bytes): encoding, _ = detect_encoding(io.BytesIO(source).readline) source = source.decode(encoding) return source def code_qualname(self, code): """ Imitates the __qualname__ attribute of functions for code objects. Given: - A function `func` - A frame `frame` for an execution of `func`, meaning: `frame.f_code is func.__code__` `Source.for_frame(frame).code_qualname(frame.f_code)` will be equal to `func.__qualname__`*. Works for Python 2 as well, where of course no `__qualname__` attribute exists. Falls back to `code.co_name` if there is no appropriate qualname. Based on https://github.com/wbolster/qualname (* unless `func` is a lambda nested inside another lambda on the same line, in which case the outer lambda's qualname will be returned for the codes of both lambdas) """ assert code.co_filename == self.filename return self._qualnames.get((code.co_name, code.co_firstlineno), code.co_name) class Executing(object): """ Information about the operation a frame is currently executing. Generally you will just want `node`, which is the AST node being executed, or None if it's unknown. Currently `node` can only be an `ast.Call` object, other operations will be supported in future. """ def __init__(self, frame, source, node, stmts): self.frame = frame self.source = source self.node = node self.statements = stmts def code_qualname(self): return self.source.code_qualname(self.frame.f_code) def text(self): return self.source.asttokens().get_text(self.node) def text_range(self): return self.source.asttokens().get_text_range(self.node) class QualnameVisitor(ast.NodeVisitor): def __init__(self): super(QualnameVisitor, self).__init__() self.stack = [] self.qualnames = {} def visit_FunctionDef(self, node, name=None): name = name or node.name self.stack.append(name) self.qualnames.setdefault((name, node.lineno), ".".join(self.stack)) self.stack.append('') if isinstance(node, ast.Lambda): children = [node.body] else: children = node.body for child in children: self.visit(child) self.stack.pop() self.stack.pop() # Find lambdas in the function definition outside the body, # e.g. decorators or default arguments # Based on iter_child_nodes for field, child in ast.iter_fields(node): if field == 'body': continue if isinstance(child, ast.AST): self.visit(child) elif isinstance(child, list): for grandchild in child: if isinstance(grandchild, ast.AST): self.visit(grandchild) def visit_Lambda(self, node): self.visit_FunctionDef(node, '') def visit_ClassDef(self, node): self.stack.append(node.name) self.generic_visit(node) self.stack.pop() future_flags = sum( getattr(__future__, fname).compiler_flag for fname in __future__.all_feature_names ) def compile_similar_to(source, matching_code): return compile( source, matching_code.co_filename, 'exec', flags=future_flags & matching_code.co_flags, dont_inherit=True, ) sentinel = '' class NodeFinder(object): def __init__(self, frame, stmts, tree): self.frame = frame self.tree = tree b = frame.f_code.co_code[frame.f_lasti] if not PY3: b = ord(b) op_name = dis.opname[b] if op_name.startswith('CALL_'): typ = ast.Call elif op_name == 'BINARY_SUBSCR': typ = ast.Subscript elif op_name.startswith('BINARY_'): typ = ast.BinOp elif op_name.startswith('UNARY_'): typ = ast.UnaryOp elif op_name in ('LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD'): typ = ast.Attribute elif op_name == 'COMPARE_OP': typ = ast.Compare else: raise RuntimeError(op_name) with lock: exprs = { node for stmt in stmts for node in ast.walk(stmt) if isinstance(node, typ) if not (hasattr(node, "ctx") and not isinstance(node.ctx, ast.Load)) } self.result = only(list(self.matching_nodes(exprs))) def matching_nodes(self, exprs): for i, expr in enumerate(exprs): setter = get_setter(expr) replacement = ast.BinOp( left=expr, op=ast.Pow(), right=ast.Str(s=sentinel), ) ast.fix_missing_locations(replacement) setter(replacement) try: instructions = self.compile_instructions() except SyntaxError: continue finally: setter(expr) indices = [ i for i, instruction in enumerate(instructions) if instruction.argval == sentinel ] if not indices: continue arg_index = only(indices) - 1 while instructions[arg_index].opname == 'EXTENDED_ARG': arg_index -= 1 if instructions[arg_index].offset == self.frame.f_lasti: yield expr def compile_instructions(self): module_code = compile_similar_to(self.tree, self.frame.f_code) code = only(find_codes(module_code, self.frame.f_code)) return list(get_instructions(code)) def get_setter(node): parent = node.parent for name, field in ast.iter_fields(parent): if field is node: return lambda new_node: setattr(parent, name, new_node) elif isinstance(field, list): for i, item in enumerate(field): if item is node: def setter(new_node): field[i] = new_node return setter lock = RLock() def find_codes(root_code, matching): def matches(c): return all( f(c) == f(matching) for f in [ attrgetter('co_firstlineno'), attrgetter('co_name'), code_names, ] ) code_options = [] if matches(root_code): code_options.append(root_code) def finder(code): for const in code.co_consts: if not inspect.iscode(const): continue if matches(const): code_options.append(const) finder(const) finder(root_code) return code_options def code_names(code): return frozenset().union( code.co_names, code.co_varnames, code.co_freevars, code.co_cellvars, ) @cache def statement_containing_node(node): while not isinstance(node, ast.stmt): node = node.parent return node python-executing-2.2.0/tests/samples/import_hook.py000066400000000000000000000072331474076367500225670ustar00rootroot00000000000000import logging import sys from importlib.util import spec_from_loader import ast # This is based on the MacroPy import hook # https://github.com/lihaoyi/macropy/blob/46ee500b877d5a32b17391bb8122c09b15a1826a/macropy/core/import_hooks.py class BirdsEyeLoader: def __init__(self, spec, source, deep): self._spec = spec self.source = source self.deep = deep def create_module(self, spec): pass def exec_module(self, module): from birdseye.bird import eye eye.exec_string( source=self.source, filename=self._spec.origin, globs=module.__dict__, locs=module.__dict__, deep=self.deep, ) def get_filename(self, fullname): return self._spec.loader.get_filename(fullname) def is_package(self, fullname): return self._spec.loader.is_package(fullname) class BirdsEyeFinder(object): """Loads a module and looks for tracing inside, only providing a loader if it finds some. """ def _find_plain_spec(self, fullname, path, target): """Try to find the original module using all the remaining meta_path finders.""" spec = None for finder in sys.meta_path: # when testing with pytest, it installs a finder that for # some yet unknown reasons makes birdseye # fail. For now it will just avoid using it and pass to # the next one if finder is self or 'pytest' in finder.__module__: continue if hasattr(finder, 'find_spec'): spec = finder.find_spec(fullname, path, target=target) elif hasattr(finder, 'load_module'): spec = spec_from_loader(fullname, finder) if spec is not None and spec.origin != 'builtin': return spec def find_spec(self, fullname, path, target=None): spec = self._find_plain_spec(fullname, path, target) if spec is None or not (hasattr(spec.loader, 'get_source') and callable(spec.loader.get_source)): # noqa: E128 if fullname != 'org': # stdlib pickle.py at line 94 contains a ``from # org.python.core for Jython which is always failing, # of course logging.debug('Failed finding spec for %s', fullname) return try: source = spec.loader.get_source(fullname) except ImportError: logging.debug('Loader for %s was unable to find the sources', fullname) return except Exception: logging.exception('Loader for %s raised an error', fullname) return if not source or 'birdseye' not in source: return deep, trace_stmt = should_trace(source) if not trace_stmt: return loader = BirdsEyeLoader(spec, source, deep) return spec_from_loader(fullname, loader) def should_trace(source): trace_stmt = None deep = False for stmt in ast.parse(source).body: if isinstance(stmt, ast.Import): for alias in stmt.names: if alias.name.startswith('birdseye.trace_module'): trace_stmt = stmt if alias.name.endswith('deep'): deep = True if isinstance(stmt, ast.ImportFrom) and stmt.module == 'birdseye': for alias in stmt.names: if alias.name.startswith('trace_module'): trace_stmt = stmt if alias.name.endswith('deep'): deep = True return deep, trace_stmt python-executing-2.2.0/tests/samples/ipython.py000066400000000000000000000072131474076367500217250ustar00rootroot00000000000000import inspect import socket import sys from io import BytesIO, StringIO from threading import current_thread, Thread from uuid import uuid4 from IPython.core.display import HTML, display from IPython.core.magic import Magics, cell_magic, magics_class from jinja2 import Environment, PackageLoader, select_autoescape from traitlets import Unicode, Int, Bool from werkzeug.local import LocalProxy from werkzeug.serving import ThreadingMixIn from birdseye.bird import PY2, Database from birdseye import server, eye fake_stream = BytesIO if PY2 else StringIO thread_proxies = {} def stream_proxy(original): def p(): frame = inspect.currentframe() while frame: if frame.f_code == ThreadingMixIn.process_request_thread.__code__: return fake_stream() frame = frame.f_back return thread_proxies.get(current_thread().ident, original) return LocalProxy(p) sys.stderr = stream_proxy(sys.stderr) sys.stdout = stream_proxy(sys.stdout) def run_server(port, bind_host, show_server_output): if not show_server_output: thread_proxies[current_thread().ident] = fake_stream() try: server.app.run( debug=True, port=port, host=bind_host, use_reloader=False, ) except socket.error: pass templates_env = Environment( loader=PackageLoader('birdseye', 'templates'), autoescape=select_autoescape(['html', 'xml']) ) @magics_class class BirdsEyeMagics(Magics): server_url = Unicode( u'', config=True, help='If set, a server will not be automatically started by %%eye. ' 'The iframe containing birdseye output will use this value as the base ' 'of its URL.' ) port = Int( 7777, config=True, help='Port number for the server started by %%eye.' ) bind_host = Unicode( '127.0.0.1', config=True, help='Host that the server started by %%eye listens on. ' 'Set to 0.0.0.0 to make it accessible anywhere.' ) show_server_output = Bool( False, config=True, help='Set to True to show stdout and stderr from the server started by %%eye.' ) db_url = Unicode( u'', config=True, help='The database URL that the server started by %%eye reads from. ' 'Equivalent to the environment variable BIRDSEYE_DB.' ) @cell_magic def eye(self, _line, cell): if not self.server_url: server.db = Database(self.db_url) server.Function = server.db.Function server.Call = server.db.Call server.Session = server.db.Session Thread( target=run_server, args=( self.port, self.bind_host, self.show_server_output, ), ).start() eye.db = Database(self.db_url) def callback(call_id): """ Always executes after the cell, whether or not an exception is raised in the user code. """ if call_id is None: # probably means a bug return html = HTML(templates_env.get_template('ipython_iframe.html').render( call_id=call_id, url=self.server_url.rstrip('/'), port=self.port, container_id=uuid4().hex, )) # noinspection PyTypeChecker display(html) value = eye.exec_ipython_cell(cell, callback) # Display the value as would happen if the %eye magic wasn't there return value python-executing-2.2.0/tests/samples/server.py000066400000000000000000000205561474076367500215460ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import json from collections import OrderedDict from functools import partial from os.path import basename from future import standard_library from littleutils import DecentJSONEncoder, withattrs, group_by_attr standard_library.install_aliases() import argparse import os import sys from flask import Flask, request, jsonify, url_for from flask.templating import render_template from flask_humanize import Humanize from werkzeug.routing import PathConverter import sqlalchemy from birdseye.db import Database from birdseye.utils import short_path, IPYTHON_FILE_PATH, fix_abs_path, is_ipython_cell app = Flask('birdseye') app.jinja_env.auto_reload = True Humanize(app) class FileConverter(PathConverter): regex = '.*?' app.url_map.converters['file'] = FileConverter db = Database() Session = db.Session Function = db.Function Call = db.Call @app.route('/') @db.provide_session def index(session): all_paths = db.all_file_paths() recent_calls = (session.query(*(Call.basic_columns + Function.basic_columns)) .join(Function) .order_by(Call.start_time.desc())[:100]) files = OrderedDict() for row in recent_calls: if is_ipython_cell(row.file): continue files.setdefault( row.file, OrderedDict() ).setdefault( row.name, row ) for path in all_paths: files.setdefault( path, OrderedDict() ) short = partial(short_path, all_paths=all_paths) return render_template('index.html', short=short, files=files) @app.route('/file/') @db.provide_session def file_view(session, path): path = fix_abs_path(path) # Get all calls and functions in this file filtered_calls = (session.query(*(Call.basic_columns + Function.basic_columns)) .join(Function) .filter_by(file=path) .subquery('filtered_calls')) # Get the latest call *time* for each function in the file latest_calls = session.query( filtered_calls.c.name, sqlalchemy.func.max(filtered_calls.c.start_time).label('maxtime') ).group_by( filtered_calls.c.name, ).subquery('latest_calls') # Get the latest call for each function query = session.query(filtered_calls).join( latest_calls, sqlalchemy.and_( filtered_calls.c.name == latest_calls.c.name, filtered_calls.c.start_time == latest_calls.c.maxtime, ) ).order_by(filtered_calls.c.start_time.desc()) funcs = group_by_attr(query, 'type') # Add any functions which were never called all_funcs = sorted(session.query(Function.name, Function.type) .filter_by(file=path) .distinct()) func_names = {row.name for row in query} for func in all_funcs: if func.name not in func_names: funcs[func.type].append(func) return render_template('file.html', funcs=funcs, is_ipython=path == IPYTHON_FILE_PATH, full_path=path, short_path=basename(path)) @app.route('/file//__function__/') @db.provide_session def func_view(session, path, func_name): path = fix_abs_path(path) query = get_calls(session, path, func_name, 200) if query: func = query[0] calls = [withattrs(Call(), **row._asdict()) for row in query] else: func = session.query(Function).filter_by(file=path, name=func_name)[0] calls = None return render_template('function.html', func=func, short_path=basename(path), calls=calls) @app.route('/api/file//__function__//latest_call/') @db.provide_session def latest_call(session, path, func_name): path = fix_abs_path(path) call = get_calls(session, path, func_name, 1)[0] return jsonify(dict( id=call.id, url=url_for(call_view.__name__, call_id=call.id), )) def get_calls(session, path, func_name, limit): return (session.query(*(Call.basic_columns + Function.basic_columns)) .join(Function) .filter_by(file=path, name=func_name) .order_by(Call.start_time.desc())[:limit]) @db.provide_session def base_call_view(session, call_id, template): call = session.query(Call).filter_by(id=call_id).one() func = call.function return render_template(template, short_path=basename(func.file), call=call, func=func) @app.route('/call/') def call_view(call_id): return base_call_view(call_id, 'call.html') @app.route('/ipython_call/') def ipython_call_view(call_id): return base_call_view(call_id, 'ipython_call.html') @app.route('/ipython_iframe/') def ipython_iframe_view(call_id): """ This view isn't generally used, it's just an easy way to play with the template without a notebook. """ return render_template('ipython_iframe.html', container_id='1234', port=7777, call_id=call_id) @app.route('/kill', methods=['POST']) def kill(): func = request.environ.get('werkzeug.server.shutdown') if func is None: raise RuntimeError('Not running with the Werkzeug Server') func() return 'Server shutting down...' @app.route('/api/call/') @db.provide_session def api_call_view(session, call_id): call = session.query(Call).filter_by(id=call_id).one() func = call.function return DecentJSONEncoder().encode(dict( call=dict(data=call.parsed_data, **Call.basic_dict(call)), function=dict(data=func.parsed_data, **Function.basic_dict(func)))) @app.route('/api/calls_by_body_hash/') @db.provide_session def calls_by_body_hash(session, body_hash): query = (session.query(*Call.basic_columns + (Function.data,)) .join(Function) .filter_by(body_hash=body_hash) .order_by(Call.start_time.desc())[:200]) calls = [Call.basic_dict(withattrs(Call(), **row._asdict())) for row in query] function_data_set = {row.data for row in query} ranges = set() loop_ranges = set() for function_data in function_data_set: function_data = json.loads(function_data) def add(key, ranges_set): for node in function_data[key]: ranges_set.add((node['start'], node['end'])) add('node_ranges', ranges) # All functions are expected to have the same set # of loop nodes current_loop_ranges = set() add('loop_ranges', current_loop_ranges) assert loop_ranges in (set(), current_loop_ranges) loop_ranges = current_loop_ranges ranges = [dict(start=start, end=end) for start, end in ranges] loop_ranges = [dict(start=start, end=end) for start, end in loop_ranges] return DecentJSONEncoder().encode(dict( calls=calls, ranges=ranges, loop_ranges=loop_ranges)) @app.route('/api/body_hashes_present/', methods=['POST']) @db.provide_session def body_hashes_present(session): hashes = request.get_json() query = (session.query(Function.body_hash, sqlalchemy.func.count(Call.id)) .outerjoin(Call) .filter(Function.body_hash.in_(hashes)) .group_by(Function.body_hash)) return DecentJSONEncoder().encode([ dict(hash=h, count=count) for h, count in query ]) def main(argv=sys.argv[1:]): # Support legacy CLI where there was just one positional argument: the port if len(argv) == 1 and argv[0].isdigit(): argv.insert(0, '--port') parser = argparse.ArgumentParser(description="Bird's Eye: A graphical Python debugger") parser.add_argument('-p', '--port', help='HTTP port, default is 7777', default=7777, type=int) parser.add_argument('--host', help="HTTP host, default is 'localhost'", default='localhost') args = parser.parse_args(argv) app.run( port=args.port, host=args.host, use_reloader=os.environ.get('BIRDSEYE_RELOADER') == '1', ) if __name__ == '__main__': main() python-executing-2.2.0/tests/samples/tests.py000066400000000000000000000314641474076367500214020ustar00rootroot00000000000000# -*- coding: utf-8 -*- from __future__ import print_function, division import ast import inspect import os import sys import tempfile import time import unittest from executing import Source, only, PY3, NotOneValueFound, get_instructions class TestStuff(unittest.TestCase): # noinspection PyTrailingSemicolon def test_semicolons(self): # @formatter:off tester(1); tester(2); tester(3) tester(9 ); tester( 8); tester( 99 ); tester(33); tester([4, 5, 6, [ 7]]) # @formatter:on def test_decorator(self): @empty_decorator @decorator_with_args(tester('123'), x=int()) @tester(list(tuple([1, 2])), returns=empty_decorator) @tester( list( tuple( [3, 4])), returns=empty_decorator) @empty_decorator @decorator_with_args( str(), x=int()) @tester(list(tuple([5, 6])), returns=empty_decorator) @tester(list(tuple([7, 8])), returns=empty_decorator) @empty_decorator @decorator_with_args(tester('sdf'), x=tester('123234')) def foo(): pass def test_comprehensions(self): # Comprehensions can be separated if they contain different names str([{tester(x) for x in [1]}, {tester(y) for y in [1]}]) # or are on different lines str([{tester(x) for x in [1]}, {tester(x) for x in [1]}]) # or are of different types str([{tester(x) for x in [1]}, list(tester(x) for x in [1])]) # but not if everything is the same # noinspection PyTypeChecker # with self.assertRaises((AttributeError, NotOneValueFound)): # str([{tester(x) for x in [1]}, {tester(x) for x in [2]}]) def test_lambda(self): self.assertEqual( (lambda x: (tester(x), tester(x)))(tester(3)), (3, 3), ) (lambda: (lambda: tester(1))())() self.assertEqual( (lambda: [tester(x) for x in tester([1, 2])])(), [1, 2], ) def test_closures_and_nested_comprehensions(self): x = 1 # @formatter:off str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) def foo(): y = 2 str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) def bar(): z = 3 str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) bar() foo() # @formatter:on def test_indirect_call(self): dict(x=tester)['x'](tester)(3, check_func=False) def test_compound_statements(self): with self.assertRaises(TypeError): try: for _ in tester([1, 2, 3]): while tester(0): pass else: tester(4) else: tester(5) raise ValueError except tester(ValueError): tester(9) raise TypeError finally: tester(10) # PyCharm getting confused somehow? # noinspection PyUnreachableCode str() with self.assertRaises(tester(Exception)): if tester(0): pass elif tester(0): pass elif tester(1 / 0): pass def test_generator(self): def gen(): for x in [1, 2]: yield tester(x) gen2 = (tester(x) for x in tester([1, 2])) assert list(gen()) == list(gen2) == [1, 2] def test_future_import(self): tester(4) def test_many_calls(self): node = None start = time.time() for i in range(10000): new_node = Source.executing(inspect.currentframe()).node if node is None: node = new_node else: self.assertIs(node, new_node) self.assertLess(time.time() - start, 1) def test_decode_source(self): def check(source, encoding, exception=None, matches=True): encoded = source.encode(encoding) if exception: with self.assertRaises(exception): Source.decode_source(encoded) else: decoded = Source.decode_source(encoded) if matches: self.assertEqual(decoded, source) else: self.assertNotEqual(decoded, source) check(u'# coding=utf8\né', 'utf8') check(u'# coding=gbk\né', 'gbk') check(u'# coding=utf8\né', 'gbk', exception=UnicodeDecodeError) check(u'# coding=gbk\né', 'utf8', matches=False) # In Python 3 the default encoding is assumed to be UTF8 if PY3: check(u'é', 'utf8') check(u'é', 'gbk', exception=SyntaxError) def test_multiline_strings(self): tester('a') tester(''' ab''') tester(''' abc def ''' ) str([ tester( ''' 123 456 ''' ), tester( ''' 345 456786 ''' ), ]) tester( [ ''' 123 456 ''' ''' 345 456786 ''' , ''' 123 456 ''', ''' 345 456786 ''' ] ) def test_multiple_statements_on_one_line(self): if tester(1): tester(2) for _ in tester([1, 2]): tester(3) def assert_qualname(self, func, qn, check_actual_qualname=True): qualname = Source.for_filename(__file__).code_qualname(func.__code__) self.assertEqual(qn, qualname) if PY3 and check_actual_qualname: self.assertEqual(qn, func.__qualname__) self.assertTrue(qn.endswith(func.__name__)) def test_qualname(self): self.assert_qualname(C.f, 'C.f') self.assert_qualname(C.D.g, 'C.D.g') self.assert_qualname(f, 'f') self.assert_qualname(f(), 'f..g') self.assert_qualname(C.D.h(), 'C.D.h..i..j') self.assert_qualname(lamb, '') foo = lambda_maker() self.assert_qualname(foo, 'lambda_maker..foo') self.assert_qualname(foo.x, 'lambda_maker..') self.assert_qualname(foo(), 'lambda_maker..foo..') self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False) def test_extended_arg(self): source = 'tester(6)\n%s\ntester(9)' % list(range(66000)) _, filename = tempfile.mkstemp() code = compile(source, filename, 'exec') with open(filename, 'w') as outfile: outfile.write(source) exec(code) def test_only(self): for n in range(5): gen = (i for i in range(n)) if n == 1: self.assertEqual(only(gen), 0) else: with self.assertRaises(NotOneValueFound): only(gen) def test_invalid_python(self): path = os.path.join(os.path.dirname(__file__), 'not_code.txt', ) source = Source.for_filename(path) self.assertIsNone(source.tree) def test_executing_methods(self): frame = inspect.currentframe() executing = Source.executing(frame) self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods') if 'pypy' not in sys.version.lower(): text = 'Source.executing(frame)' self.assertEqual(executing.text(), text) start, end = executing.text_range() self.assertEqual(executing.source.text[start:end], text) def test_attr(self): c = C() c.x = c.y = tester str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe)) class TestFile(unittest.TestCase): def test_file(self): source = Source.for_frame(inspect.currentframe()) code = compile(source.text, source.filename, 'exec') instructions = get_instructions(code) lineno = None for inst in instructions: if inst.starts_line is not None: lineno = inst.starts_line if not inst.opname.startswith( ('BINARY_', 'UNARY_', 'LOAD_ATTR', 'LOAD_METHOD', 'LOOKUP_METHOD', 'COMPARE_OP')): continue frame = C() frame.f_lasti = inst.offset frame.f_code = code frame.f_globals = globals() frame.f_lineno = lineno print(inst.opname) assert Source.executing(frame).node is not None class C(object): @staticmethod def f(): pass class D(object): @staticmethod def g(): pass @staticmethod def h(): def i(): def j(): pass return j return i() TestFile().test_file() def f(): def g(): pass return g def lambda_maker(): def assign(x): def decorator(func): func.x = x return func return decorator @assign(lambda: 1) def foo(): return lambda: lambda: 3 return foo lamb = lambda: 0 class Tester(object): def get_node(self, typ): frame = inspect.currentframe().f_back.f_back Source.lazycache(frame) node = Source.executing(frame).node assert isinstance(node, typ), (node, typ) return node def check(self, node, value): frame = inspect.currentframe().f_back.f_back result = eval( compile(ast.Expression(node), frame.f_code.co_filename, 'eval'), frame.f_globals, frame.f_locals, ) assert result == value, (result, value) def __call__(self, arg, check_func=True, returns=None): call = self.get_node(ast.Call) self.check(call.args[0], arg) if check_func: self.check(call.func, self) if returns is None: return arg return returns def __getattr__(self, item): node = self.get_node(ast.Attribute) self.check(node.value, self) assert node.attr == item return self def __getitem__(self, item): node = self.get_node(ast.Subscript) self.check(node.value, self) self.check(node.slice.value, item) return self def __add__(self, other): node = self.get_node(ast.BinOp) self.check(node.left, self) self.check(node.right, other) return self __pow__ = __mul__ = __sub__ = __add__ def __invert__(self): node = self.get_node(ast.UnaryOp) self.check(node.operand, self) return self __neg__ = __pos__ = __invert__ def __lt__(self, other): node = self.get_node(ast.Compare) self.check(node.left, self) self.check(node.comparators[0], other) return self __ne__ = __ge__ = __lt__ tester = Tester() assert tester([1, 2, 3]) == [1, 2, 3] assert tester.asd is tester assert tester[19] is tester assert tester ** 4 is tester assert tester * 3 is tester assert tester - 2 is tester assert tester + 1 is tester assert -tester is tester assert +tester is tester assert ~tester is tester assert (tester < 7) is tester assert (tester >= 78) is tester assert (tester != 79) is tester # assert (5 != tester != 6) is tester assert tester.foo(45, False) == 45 def empty_decorator(func): return func def decorator_with_args(*_, **__): return empty_decorator if __name__ == '__main__': unittest.main() python-executing-2.2.0/tests/samples/tracer.py000066400000000000000000000626311474076367500215200ustar00rootroot00000000000000""" This module provides the generic functionality of tracing code by modifying its AST. Eventually this will become a separate package. This is similar to the standard library module bdb, while birdseye itself would correspond to pdb. Most of the work is in TreeTracerBase. """ from __future__ import print_function, division, absolute_import from future import standard_library standard_library.install_aliases() import ast import inspect import sys from collections import namedtuple, defaultdict from copy import deepcopy from functools import partial, update_wrapper, wraps from itertools import takewhile from typing import List, Dict, Any, Optional, NamedTuple, Tuple, Iterator, Callable, cast, Union from types import FrameType, TracebackType, CodeType, FunctionType from birdseye.utils import PY3, Type, is_lambda, lru_cache, read_source_file, is_ipython_cell, \ is_future_import class TracedFile(object): """ An instance of this class corresponds to a single .py file. It contains some useful data in the following attributes: - filename: name of the source file - source: textual contents of the file - root: root of the original Abstract Syntax Tree (AST) of the source, where the nodes of this tree have an additional handy attribute: - parent: parent of the node, so this node is a child node of its parent - tracer: instance of TreeTracerBase - code: executable code object compiled from the modified AST """ is_ipython_cell = False def __init__(self, tracer, source, filename, flags): # type: (TreeTracerBase, str, str, int) -> None # Here the source code is parsed, modified, and compiled self.root = compile(source, filename, 'exec', ast.PyCF_ONLY_AST | flags, dont_inherit=True) # type: ast.Module self.nodes = [] # type: List[ast.AST] self.set_basic_node_attributes() new_root = tracer.parse_extra(self.root, source, filename) if new_root is not None: self.root = new_root self.set_basic_node_attributes() self.set_enter_call_nodes() new_root = deepcopy(self.root) new_root = _NodeVisitor().visit(new_root) self.code = compile(new_root, filename, "exec", dont_inherit=True, flags=flags) # type: CodeType self.tracer = tracer self.source = source self.filename = filename def set_basic_node_attributes(self): self.nodes = [] # type: List[ast.AST] for node in ast.walk(self.root): # type: ast.AST for child in ast.iter_child_nodes(node): child.parent = node node._tree_index = len(self.nodes) self.nodes.append(node) # Mark __future__ imports and anything before (i.e. module docstrings) # to be ignored by the AST transformer for i, stmt in enumerate(self.root.body): if is_future_import(stmt): for s in self.root.body[:i + 1]: for node in ast.walk(s): node._visit_ignore = True def set_enter_call_nodes(self): for node in self.nodes: if isinstance(node, (ast.Module, ast.FunctionDef)): for stmt in node.body: if not is_future_import(stmt): stmt._enter_call_node = True break class FrameInfo(object): """ Contains extra data about an execution frame. Can be obtained from the stack attribute of a TreeTracerBase instance """ def __init__(self): # Stack of statements currently being executed self.statement_stack = [] # type: List[ast.stmt] # Stack of expression nodes within the above statement that # the interpreter is planning on evaluating, or has just evaluated # in the case of the last element of the list. For example, given # the expression f(g(x)), the stack would be [f, g, x] before and just # after evaluating x, since function arguments are evaluated before the # actual function call. self.expression_stack = [] # type: List[ast.expr] # Mapping from the expression node to its most recent value # in the corresponding frame self.expression_values = {} # type: Dict[ast.expr, Any] # Node where the frame has explicitly returned # There may be parent nodes such as enclosing loops that still need to finish executing self.return_node = None # type: Optional[ast.Return] # Most recent exception raised in the frame self.exc_value = None # type: Optional[BaseException] # Some of the attributes of the classes below are unused for now and are # intended for future use, possibly by other debuggers # Argument of TreeTracerBase.enter_call EnterCallInfo = NamedTuple('EnterCallInfo', [ # Node from where the call was made ('call_node', Optional[Union[ast.expr, ast.stmt]]), # Node where the call begins ('enter_node', ast.AST), # Frame from which the call was made ('caller_frame', FrameType), # Frame of the call ('current_frame', FrameType)]) # Argument of TreeTracerBase.exit_call ExitCallInfo = NamedTuple('ExitCallInfo', [ # Node from where the call was made ('call_node', Optional[Union[ast.expr, ast.stmt]]), # Node where the call explicitly returned ('return_node', Optional[ast.Return]), # Frame from which the call was made ('caller_frame', FrameType), # Frame of the call ('current_frame', FrameType), # Node where the call explicitly returned ('return_value', Any), # Exception raised in the call causing it to end, # will propagate to the caller ('exc_value', Optional[Exception]), # Traceback corresponding to exc_value ('exc_tb', Optional[TracebackType])]) # see TreeTracerBase.after_expr ChangeValue = namedtuple('ChangeValue', 'value') class TreeTracerBase(object): """ Create a subclass of this class with one or more of the 'hooks' (methods which are empty in this class) overridden to take a custom action in the given situation. Then decorate functions with an instance of this class to trace them. """ def __init__(self): # Mapping from frames of execution being traced to FrameInfo objects # for extra metadata. self.stack = {} # type: Dict[FrameType, FrameInfo] self.main_to_secondary_frames = defaultdict(list) self.secondary_to_main_frames = {} @lru_cache() def compile(self, source, filename, flags=0): # type: (str, str, int) -> TracedFile return TracedFile(self, source, filename, flags) def _trace_methods_dict(self, traced_file): # type: (TracedFile) -> Dict[str, Callable] return {f.__name__: partial(f, traced_file) for f in [ self._treetrace_hidden_with_stmt, self._treetrace_hidden_before_expr, self._treetrace_hidden_after_expr, ]} def trace_function(self, func): # type: (FunctionType) -> FunctionType """ Returns a version of the passed function with the AST modified to trigger the tracing hooks. """ if not isinstance(func, FunctionType): raise ValueError('You can only trace user-defined functions. ' 'The birdseye decorator must be applied first, ' 'at the bottom of the list.') try: if inspect.iscoroutinefunction(func) or inspect.isasyncgenfunction(func): raise ValueError('You cannot trace async functions') except AttributeError: pass if is_lambda(func): raise ValueError('You cannot trace lambdas') filename = inspect.getsourcefile(func) # type: str if is_ipython_cell(filename): # noinspection PyPackageRequirements from IPython import get_ipython import linecache flags = get_ipython().compile.flags source = ''.join(linecache.cache[filename][2]) else: source = read_source_file(filename) flags = 0 # We compile the entire file instead of just the function source # because it can contain context which affects the function code, # e.g. enclosing functions and classes or __future__ imports traced_file = self.compile(source, filename, flags) if func.__dict__: raise ValueError('The birdseye decorator must be applied first, ' 'at the bottom of the list.') # Then we have to recursively search through the newly compiled # code to find the code we actually want corresponding to this function code_options = [] # type: List[CodeType] def find_code(root_code): # type: (CodeType) -> None for const in root_code.co_consts: # type: CodeType if not inspect.iscode(const): continue matches = (const.co_firstlineno == func.__code__.co_firstlineno and const.co_name == func.__code__.co_name) if matches: code_options.append(const) find_code(const) find_code(traced_file.code) if len(code_options) > 1: # Currently lambdas aren't allowed anyway, but should be in the future assert is_lambda(func) raise ValueError("Failed to trace lambda. Convert the function to a def.") new_func_code = code_options[0] # type: CodeType # Give the new function access to the hooks # We have to use the original __globals__ and not a copy # because it's the actual module namespace that may get updated by other code func.__globals__.update(self._trace_methods_dict(traced_file)) # http://stackoverflow.com/a/13503277/2482744 # noinspection PyArgumentList new_func = FunctionType(new_func_code, func.__globals__, func.__name__, func.__defaults__, func.__closure__) update_wrapper(new_func, func) # type: FunctionType if PY3: new_func.__kwdefaults__ = getattr(func, '__kwdefaults__', None) new_func.traced_file = traced_file return new_func def __call__(self, func=None, optional=False): # type: (FunctionType, bool) -> Callable """ Decorator which returns a (possibly optionally) traced function. This decorator can be called with or without arguments. Typically it is called without arguments, in which case it returns a traced function. If optional=True, it returns a function similar to the original but with an additional optional parameter trace_call, default False. If trace_call is false, the underlying untraced function is used. If true, the traced version is used. """ if inspect.isclass(func): raise TypeError('Decorating classes is no longer supported') if func: # The decorator has been called without arguments/parentheses, # e.g. # @eye # def ... return self.trace_function(func) # The decorator has been called with arguments/parentheses, # e.g. # @eye(...) # def ... # We must return a decorator if not optional: return self.trace_function def decorator(actual_func): traced = self.trace_function(actual_func) @wraps(actual_func) def wrapper(*args, **kwargs): trace_call = kwargs.pop('trace_call', False) if trace_call: f = traced else: f = actual_func return f(*args, **kwargs) return wrapper return decorator def _main_frame(self, node): # type: (ast.AST) -> Optional[FrameType] frame = sys._getframe(2) result = self.secondary_to_main_frames.get(frame) if result: return result original_frame = frame while frame.f_code.co_name in ('', '', ''): frame = frame.f_back for node in ancestors(node): if isinstance(node, (ast.FunctionDef, ast.Lambda)): break if isinstance(node, ast.ClassDef): frame = frame.f_back if frame.f_code.co_name in ('', ''): return None self.secondary_to_main_frames[original_frame] = frame self.main_to_secondary_frames[frame].append(original_frame) return frame def _treetrace_hidden_with_stmt(self, traced_file, _tree_index): # type: (TracedFile, int) -> _StmtContext """ Called directly from the modified code. Every statement in the original code becomes: with _treetrace_hidden_with_stmt(...): """ node = traced_file.nodes[_tree_index] node = cast(ast.stmt, node) frame = self._main_frame(node) return _StmtContext(self, node, frame) def _treetrace_hidden_before_expr(self, traced_file, _tree_index): # type: (TracedFile, int) -> ast.expr """ Called directly from the modified code before an expression is evaluated. """ node = traced_file.nodes[_tree_index] node = cast(ast.expr, node) frame = self._main_frame(node) if frame is None: return node frame_info = self.stack[frame] frame_info.expression_stack.append(node) self.before_expr(node, frame) return node def _treetrace_hidden_after_expr(self, _, node, value): # type: (TracedFile, ast.expr, Any) -> Any """ Called directly from the modified code after an expression is evaluated. """ frame = self._main_frame(node) if frame is None: return value result = self._after_expr(node, frame, value, None, None) if result is not None: assert isinstance(result, ChangeValue), "after_expr must return None or an instance of ChangeValue" value = result.value return value def _after_expr(self, node, frame, value, exc_value, exc_tb): frame_info = self.stack[frame] frame_info.expression_stack.pop() frame_info.expression_values[node] = value return self.after_expr(node, frame, value, exc_value, exc_tb) def _enter_call(self, enter_node, current_frame): # type: (ast.AST, FrameType) -> None caller_frame, call_node = self._get_caller_stuff(current_frame) self.stack[current_frame] = FrameInfo() self.enter_call(EnterCallInfo(call_node, enter_node, caller_frame, current_frame)) def _get_caller_stuff(self, frame): # type: (FrameType) -> Tuple[FrameType, Optional[Union[ast.expr, ast.stmt]]] caller_frame = frame.f_back call_node = None main_frame = self.secondary_to_main_frames.get(caller_frame) if main_frame: caller_frame = main_frame frame_info = self.stack[caller_frame] expression_stack = frame_info.expression_stack if expression_stack: call_node = expression_stack[-1] else: call_node = frame_info.statement_stack[-1] # type: ignore return caller_frame, call_node # The methods below are hooks meant to be overridden in subclasses to take custom actions def before_expr(self, node, frame): # type: (ast.expr, FrameType) -> None """ Called right before the expression corresponding to `node` is evaluated within `frame`. """ def after_expr(self, node, frame, value, exc_value, exc_tb): # type: (ast.expr, FrameType, Any, Optional[BaseException], Optional[TracebackType]) -> Optional[ChangeValue] """ Called right after the expression corresponding to `node` is evaluated within `frame`. `value` is the value of the expression, if it succeeded. If the evaluation raised an exception, exc_value will be the exception object and exc_tb the traceback. Return `ChangeValue(x)` to change the value of the expression as seen by the rest of the program from `value` to `x`. """ def before_stmt(self, node, frame): # type: (ast.stmt, FrameType) -> None """ Called right before the statement corresponding to `node` is executed within `frame`. """ def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node): # type: (ast.stmt, FrameType, Optional[BaseException], Optional[TracebackType], Optional[ast.AST]) -> Optional[bool] """ Called right after the statement corresponding to `node` is executed within `frame`. If the statement raised an exception, exc_value will be the exception object, exc_tb the traceback, and exc_node the node where the exception was raised (either this statement or an expression within). Returning True will suppress any exception raised (as with __exit__ in general). """ def enter_call(self, enter_info): # type: (EnterCallInfo) -> None """ Called before a function call begins executing. For typical `def` functions, this is called before the `before_stmt` for to the first statement in the function. """ def exit_call(self, exit_info): # type: (ExitCallInfo) -> None """ Called after a function call finishes executing. For typical `def` functions, this is called after the `after_stmt` for to the last statement to execute. """ def parse_extra(self, root, source, filename): # type: (ast.Module, str, str) -> Optional[ast.Module] """ Called before the AST (root) is modified to let subclasses make additional changes first. """ class _NodeVisitor(ast.NodeTransformer): """ This does the AST modifications that call the hooks. """ def generic_visit(self, node): # type: (ast.AST) -> ast.AST if not getattr(node, '_visit_ignore', False): if (isinstance(node, ast.expr) and not (hasattr(node, "ctx") and not isinstance(node.ctx, ast.Load)) and not isinstance(node, getattr(ast, 'Starred', ()))): return self.visit_expr(node) if isinstance(node, ast.stmt): return self.visit_stmt(node) return super(_NodeVisitor, self).generic_visit(node) def visit_expr(self, node): # type: (ast.expr) -> ast.Call """ each expression e gets wrapped like this: _treetrace_hidden_after_expr(_treetrace_hidden_before_expr(_tree_index), e) where the _treetrace_* functions are the corresponding methods with the TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict) """ before_marker = self._create_simple_marker_call(node, TreeTracerBase._treetrace_hidden_before_expr) ast.copy_location(before_marker, node) after_marker = ast.Call( func=ast.Name(id=TreeTracerBase._treetrace_hidden_after_expr.__name__, ctx=ast.Load()), args=[ before_marker, super(_NodeVisitor, self).generic_visit(node), ], keywords=[], ) ast.copy_location(after_marker, node) ast.fix_missing_locations(after_marker) return after_marker def visit_stmt(self, node): # type: (ast.stmt) -> ast.With """ Every statement in the original code becomes: with _treetrace_hidden_with_stmt(_tree_index): where the _treetrace_hidden_with_stmt function is the the corresponding method with the TreeTracerBase and traced_file arguments already filled in (see _trace_methods_dict) """ context_expr = self._create_simple_marker_call( super(_NodeVisitor, self).generic_visit(node), TreeTracerBase._treetrace_hidden_with_stmt) if PY3: wrapped = ast.With( items=[ast.withitem(context_expr=context_expr)], body=[node], ) else: wrapped = ast.With( context_expr=context_expr, body=[node], ) ast.copy_location(wrapped, node) ast.fix_missing_locations(wrapped) return wrapped @staticmethod def _create_simple_marker_call(node, func): # type: (ast.AST, Callable) -> ast.Call """ Returns a Call node representing `func(node._tree_index)` where node._tree_index is a numerical literal which allows the node object to be retrieved later through the nodes attribute of a TracedFile. """ return ast.Call( func=ast.Name(id=func.__name__, ctx=ast.Load()), args=[ast.Num(node._tree_index)], keywords=[], ) class _StmtContext(object): __slots__ = ('tracer', 'node', 'frame') def __init__(self, tracer, node, frame): # type: (TreeTracerBase, ast.stmt, FrameType) -> None self.tracer = tracer self.node = node self.frame = frame def __enter__(self): tracer = self.tracer node = self.node frame = self.frame if getattr(node, '_enter_call_node', False): tracer._enter_call(node, frame) frame_info = tracer.stack[frame] frame_info.expression_stack = [] frame_info.statement_stack.append(node) tracer.before_stmt(node, frame) def __exit__(self, exc_type, exc_val, exc_tb): # type: (Type[Exception], Exception, TracebackType) -> bool node = self.node tracer = self.tracer frame = self.frame frame_info = tracer.stack[frame] frame_info.statement_stack.pop() exc_node = None # type: Optional[Union[ast.expr, ast.stmt]] if exc_val and exc_val is not frame_info.exc_value: exc_node = node frame_info.exc_value = exc_val # Call the after_expr hook if the exception was raised by an expression expression_stack = frame_info.expression_stack if expression_stack: exc_node = expression_stack[-1] tracer._after_expr(exc_node, frame, None, exc_val, exc_tb) result = tracer.after_stmt(node, frame, exc_val, exc_tb, exc_node) if isinstance(node, ast.Return): frame_info.return_node = node parent = node.parent # type: ast.AST return_node = frame_info.return_node exiting = (isinstance(parent, (ast.FunctionDef, ast.Module)) and (node is parent.body[-1] or exc_val or return_node)) if exiting: caller_frame, call_node = tracer._get_caller_stuff(frame) return_value = None if return_node and return_node.value and not exc_val: return_value = frame_info.expression_values[return_node.value] tracer.exit_call(ExitCallInfo(call_node, return_node, caller_frame, frame, return_value, exc_val, exc_tb )) del tracer.stack[frame] for secondary_frame in self.tracer.main_to_secondary_frames.pop(frame): del self.tracer.secondary_to_main_frames[secondary_frame] return result def ancestors(node): # type: (ast.AST) -> Iterator[ast.AST] while True: try: node = node.parent except AttributeError: break yield node Loop = Union[ast.For, ast.While, ast.comprehension] def loops(node): # type: (ast.AST) -> Tuple[Loop, ...] """ Return all the 'enclosing loops' of a node, up to the innermost class or function definition. This also includes the 'for in' clauses in list/dict/set/generator comprehensions. So for example, in this code: for x in ...: def foo(): while True: print([z for y in ...]) The loops enclosing the node 'z' are 'while True' and 'for y in ...', in that order. """ result = [] while True: try: parent = node.parent except AttributeError: break if isinstance(parent, ast.FunctionDef): break is_containing_loop = (((isinstance(parent, ast.For) and parent.iter is not node or isinstance(parent, ast.While)) and node not in parent.orelse) or (isinstance(parent, ast.comprehension) and node in parent.ifs)) if is_containing_loop: result.append(parent) elif isinstance(parent, (ast.ListComp, ast.GeneratorExp, ast.DictComp, ast.SetComp)): generators = parent.generators if node in generators: generators = list(takewhile(lambda n: n != node, generators)) result.extend(reversed(generators)) node = parent result.reverse() return tuple(result) python-executing-2.2.0/tests/samples/tracer2.py000066400000000000000000000242071474076367500215770ustar00rootroot00000000000000import functools import inspect import os import re import sys import threading from collections import OrderedDict import six # noinspection PyUnresolvedReferences from cheap_repr import cheap_repr, find_repr_function from snoop.utils import my_cheap_repr, NO_ASTTOKENS, ArgDefaultDict, iscoroutinefunction, \ truncate_list, ensure_tuple, is_comprehension_frame, no_args_decorator from .formatting import Event, Source from .variables import CommonVariable, Exploding, BaseVariable find_repr_function(six.text_type).maxparts = 100 find_repr_function(six.binary_type).maxparts = 100 find_repr_function(object).maxparts = 100 find_repr_function(int).maxparts = 999999 cheap_repr.suppression_threshold = 999999 class FrameInfo(object): def __init__(self, frame): self.frame = frame self.local_reprs = {} self.last_line_no = frame.f_lineno self.comprehension_variables = OrderedDict() self.source = Source.for_frame(frame) self.is_generator = frame.f_code.co_flags & inspect.CO_GENERATOR self.had_exception = False if is_comprehension_frame(frame): self.comprehension_type = ( re.match(r'<(\w+)comp>', frame.f_code.co_name).group(1).title() + u' comprehension' ) else: self.comprehension_type = '' def update_variables(self, watch, watch_extras, event): self.last_line_no = self.frame.f_lineno old_local_reprs = self.local_reprs self.local_reprs = OrderedDict( (source, my_cheap_repr(value)) for source, value in self.get_local_reprs(watch, watch_extras) ) if self.comprehension_type: for name, value_repr in self.local_reprs.items(): values = self.comprehension_variables.setdefault(name, []) if not values or values[-1] != value_repr: values.append(value_repr) values[:] = truncate_list(values, 11) if event in ('return', 'exception'): return [ (name, ', '.join(values)) for name, values in self.comprehension_variables.items() ] else: return [] variables = [] for name, value_repr in self.local_reprs.items(): if name not in old_local_reprs or old_local_reprs[name] != value_repr: variables.append((name, value_repr)) return variables def get_local_reprs(self, watch, watch_extras): frame = self.frame code = frame.f_code vars_order = code.co_varnames + code.co_cellvars + code.co_freevars + tuple(frame.f_locals.keys()) result_items = sorted( frame.f_locals.items(), key=lambda key_value: vars_order.index(key_value[0]) ) for variable in watch: result_items += sorted(variable.items(frame)) for source, value in result_items: yield source, value for extra in watch_extras: try: pair = extra(source, value) except Exception: pass else: if pair is not None: assert len(pair) == 2, "Watch extra must return pair or None" yield pair thread_global = threading.local() internal_directories = (os.path.dirname((lambda: 0).__code__.co_filename),) try: # noinspection PyUnresolvedReferences import birdseye except ImportError: pass else: internal_directories += (os.path.dirname(birdseye.__file__),) class TracerMeta(type): def __new__(mcs, *args, **kwargs): result = super(TracerMeta, mcs).__new__(mcs, *args, **kwargs) result.default = result() return result def __call__(cls, *args, **kwargs): if no_args_decorator(args, kwargs): return cls.default(args[0]) else: return super(TracerMeta, cls).__call__(*args, **kwargs) def __enter__(self): return self.default.__enter__(context=1) def __exit__(self, *args): return self.default.__exit__(*args, context=1) @six.add_metaclass(TracerMeta) class Tracer(object): def __init__( self, watch=(), watch_explode=(), depth=1, ): self.watch = [ v if isinstance(v, BaseVariable) else CommonVariable(v) for v in ensure_tuple(watch) ] + [ v if isinstance(v, BaseVariable) else Exploding(v) for v in ensure_tuple(watch_explode) ] self.frame_infos = ArgDefaultDict(FrameInfo) self.depth = depth assert self.depth >= 1 self.target_codes = set() self.target_frames = set() def __call__(self, function): if iscoroutinefunction(function): raise NotImplementedError("coroutines are not supported, sorry!") self.target_codes.add(function.__code__) @functools.wraps(function) def simple_wrapper(*args, **kwargs): with self: return function(*args, **kwargs) @functools.wraps(function) def generator_wrapper(*args, **kwargs): gen = function(*args, **kwargs) method, incoming = gen.send, None while True: with self: try: outgoing = method(incoming) except StopIteration: return try: method, incoming = gen.send, (yield outgoing) except Exception as e: method, incoming = gen.throw, e if inspect.isgeneratorfunction(function): return generator_wrapper else: return simple_wrapper def __enter__(self, context=0): if not self.config.enabled: return calling_frame = sys._getframe(context + 1) if not self._is_internal_frame(calling_frame): calling_frame.f_trace = self.trace self.target_frames.add(calling_frame) self.config.last_frame = calling_frame self.trace(calling_frame, 'enter', None) stack = thread_global.__dict__.setdefault('original_trace_functions', []) stack.append(sys.gettrace()) sys.settrace(self.trace) def __exit__(self, exc_type, exc_value, exc_traceback, context=0): if not self.config.enabled: return stack = thread_global.original_trace_functions sys.settrace(stack.pop()) calling_frame = sys._getframe(context + 1) self.trace(calling_frame, 'exit', None) self.target_frames.discard(calling_frame) self.frame_infos.pop(calling_frame, None) def _is_internal_frame(self, frame): return frame.f_code.co_filename.startswith(internal_directories) def _is_traced_frame(self, frame): return frame.f_code in self.target_codes or frame in self.target_frames def trace(self, frame, event, arg): if not self._is_traced_frame(frame): if ( self.depth == 1 or self._is_internal_frame(frame) ) and not is_comprehension_frame(frame): return None else: candidate = frame i = 0 while True: if is_comprehension_frame(candidate): candidate = candidate.f_back continue i += 1 if self._is_traced_frame(candidate): break candidate = candidate.f_back if i >= self.depth or candidate is None or self._is_internal_frame(candidate): return None thread_local = self.config.thread_local thread_local.__dict__.setdefault('depth', -1) frame_info = self.frame_infos[frame] if event in ('call', 'enter'): thread_local.depth += 1 elif self.config.last_frame and self.config.last_frame is not frame: line_no = frame_info.last_line_no trace_event = Event(frame_info, event, arg, thread_local.depth, line_no=line_no) line = self.config.formatter.format_line_only(trace_event) self.config.write(line) if event == 'exception': frame_info.had_exception = True self.config.last_frame = frame trace_event = Event(frame_info, event, arg, thread_local.depth) if not (frame.f_code.co_name == '' and event not in ('return', 'exception')): trace_event.variables = frame_info.update_variables( self.watch, self.config.watch_extras, event, ) if event in ('return', 'exit'): del self.frame_infos[frame] thread_local.depth -= 1 formatted = self.config.formatter.format(trace_event) self.config.write(formatted) return self.trace class Spy(object): def __init__(self, config): self.config = config def __call__(self, *args, **kwargs): if NO_ASTTOKENS: raise Exception("birdseye doesn't support this version of Python") try: import birdseye except ImportError: raise Exception("You must install birdseye separately to use spy: pip install birdseye") # Decorator without parentheses if no_args_decorator(args, kwargs): return self._trace(args[0]) # Decorator with parentheses and perhaps arguments def decorator(func): return self._trace(func, *args, **kwargs) return decorator def _trace(self, func, *args, **kwargs): # noinspection PyUnresolvedReferences from birdseye import eye traced = eye(func) traced = self.config.snoop(*args, **kwargs)(traced) @functools.wraps(func) def wrapper(*func_args, **func_kwargs): if self.config.enabled: final_func = traced else: final_func = func return final_func(*func_args, **func_kwargs) return wrapper python-executing-2.2.0/tests/samples/utils.py000066400000000000000000000145241474076367500213760ustar00rootroot00000000000000from __future__ import print_function, division, absolute_import import ast import json from future import standard_library standard_library.install_aliases() import token from future.utils import raise_from import ntpath import os import types from sys import version_info from typing import TypeVar, Union, List, Any, Iterator, Tuple, Iterable try: from typing import Type except ImportError: Type = type try: from typing import Deque except ImportError: from collections import deque as Deque try: from functools import lru_cache except ImportError: from backports.functools_lru_cache import lru_cache from littleutils import strip_required_prefix PY2 = version_info.major == 2 PY3 = not PY2 T = TypeVar('T') RT = TypeVar('RT') IPYTHON_FILE_PATH = 'IPython notebook or shell' FILE_SENTINEL_NAME = '$$__FILE__$$' if PY2: Text = unicode else: Text = str def path_leaf(path): # type: (str) -> str # http://stackoverflow.com/a/8384788/2482744 head, tail = ntpath.split(path) return tail or ntpath.basename(head) def common_ancestor(paths): # type: (List[str]) -> str """ Returns a path to a directory that contains all the given absolute paths """ prefix = os.path.commonprefix(paths) # Ensure that the prefix doesn't end in part of the name of a file/directory prefix = ntpath.split(prefix)[0] # Ensure that it ends with a slash first_char_after = paths[0][len(prefix)] if first_char_after in r'\/': prefix += first_char_after return prefix def short_path(path, all_paths): # type: (str, List[str]) -> str if path == IPYTHON_FILE_PATH: return path all_paths = [f for f in all_paths if f != IPYTHON_FILE_PATH] prefix = common_ancestor(all_paths) if prefix in r'\/': prefix = '' return strip_required_prefix(path, prefix) or path_leaf(path) def fix_abs_path(path): if path == IPYTHON_FILE_PATH: return path if os.path.sep == '/' and not path.startswith('/'): path = '/' + path return path if PY2: def correct_type(obj): """ Returns the correct type of obj, regardless of __class__ assignment or old-style classes: >>> class A: ... pass ... ... ... class B(object): ... pass ... ... ... class C(object): ... __class__ = A ... >>> correct_type(A()) is A True >>> correct_type(B()) is B True >>> correct_type(C()) is C True """ t = type(obj) # noinspection PyUnresolvedReferences if t is types.InstanceType: return obj.__class__ return t else: correct_type = type def of_type(type_or_tuple, iterable): # type: (Union[type, Tuple[Union[type, tuple], ...]], Iterable[Any]) -> Iterator[Any] return (x for x in iterable if isinstance(x, type_or_tuple)) def safe_next(it): # type: (Iterator[T]) -> T """ next() can raise a StopIteration which can cause strange bugs inside generators. """ try: return next(it) except StopIteration as e: raise_from(RuntimeError, e) raise # isn't reached def one_or_none(expression): """Performs a one_or_none on a sqlalchemy expression.""" if hasattr(expression, 'one_or_none'): return expression.one_or_none() result = expression.all() if len(result) == 0: return None elif len(result) == 1: return result[0] else: raise Exception("There is more than one item returned for the supplied filter") def flatten_list(lst): result = [] for x in lst: if isinstance(x, list): result.extend(flatten_list(x)) else: result.append(x) return result def is_lambda(f): try: code = f.__code__ except AttributeError: return False return code.co_name == (lambda: 0).__code__.co_name class ProtocolEncoder(json.JSONEncoder): def default(self, o): try: method = o.as_json except AttributeError: return super(ProtocolEncoder, self).default(o) else: return method() try: # Python 3 from tokenize import open as open_with_encoding_check except ImportError: # Python 2 from lib2to3.pgen2.tokenize import detect_encoding import io def open_with_encoding_check(filename): # type: ignore """Open a file in read only mode using the encoding detected by detect_encoding(). """ fp = io.open(filename, 'rb') try: encoding, lines = detect_encoding(fp.readline) fp.seek(0) text = io.TextIOWrapper(fp, encoding, line_buffering=True) text.mode = 'r' return text except: fp.close() raise def read_source_file(filename): from lib2to3.pgen2.tokenize import cookie_re if filename.endswith('.pyc'): filename = filename[:-1] with open_with_encoding_check(filename) as f: return ''.join([ '\n' if i < 2 and cookie_re.match(line) else line for i, line in enumerate(f) ]) def source_without_decorators(tokens, function_node): def_token = safe_next(t for t in tokens.get_tokens(function_node) if t.string == 'def' and t.type == token.NAME) startpos = def_token.startpos source = tokens.text[startpos:function_node.last_token.endpos].rstrip() assert source.startswith('def') return startpos, source def prn(*args): for arg in args: print(arg) if len(args) == 1: return args[0] return args def is_ipython_cell(filename): return filename.startswith(' max_length: left = (max_length - len(middle)) // 2 right = max_length - len(middle) - left seq = seq[:left] + middle + seq[-right:] return seq def truncate_string(string, max_length): return truncate(string, max_length, '...') def truncate_list(lst, max_length): return truncate(lst, max_length, ['...']) def ensure_tuple(x, split=False): if split and isinstance(x, six.string_types): x = x.replace(',', ' ').split() if not isinstance(x, (list, set, tuple)): x = (x,) return tuple(x) def short_filename(code): result = os.path.basename(code.co_filename) if result.endswith('.pyc'): result = result[:-1] return result def is_comprehension_frame(frame): return frame.f_code.co_name in ('', '', '') def needs_parentheses(source): def code(s): return compile(s.format(source), '', 'eval').co_code try: without_parens = code('{}.x') except SyntaxError: # Likely a multiline expression that needs parentheses to be valid code('({})') return True else: return without_parens != code('({}).x') def with_needed_parentheses(source): if needs_parentheses(source): return '({})'.format(source) else: return source REPR_TARGET_LENGTH = 100 def my_cheap_repr(x): return cheap_repr(x, target_length=REPR_TARGET_LENGTH) class ArgDefaultDict(dict): def __init__(self, factory): super(ArgDefaultDict, self).__init__() self.factory = factory def __missing__(self, key): result = self[key] = self.factory(key) return result def optional_numeric_label(i, lst): if len(lst) == 1: return '' else: return ' ' + str(i + 1) def is_pathlike(x): if hasattr(os, 'PathLike'): return isinstance(x, os.PathLike) return ( hasattr(x, '__fspath__') or # Make a concession for older `pathlib` versions: (hasattr(x, 'open') and 'path' in x.__class__.__name__.lower()) ) try: iscoroutinefunction = inspect.iscoroutinefunction except AttributeError: def iscoroutinefunction(_): return False try: try_statement = ast.Try except AttributeError: try_statement = ast.TryExcept try: builtins = __import__("__builtin__") except ImportError: builtins = __import__("builtins") try: FormattedValue = ast.FormattedValue except: class FormattedValue(object): pass def no_args_decorator(args, kwargs): return len(args) == 1 and inspect.isfunction(args[0]) and not kwargs try: from functools import lru_cache except ImportError: from backports.functools_lru_cache import lru_cache class DirectRepr(str): def __repr__(self): return self try: from django.db.models import QuerySet except ImportError: class QuerySet(object): pass def _sample_indices(length, max_length): if length <= max_length + 2: return range(length) else: return chain(range(max_length // 2), range(length - max_length // 2, length)) @try_register_repr('pandas', 'Series') def _repr_series_one_line(x, helper): n = len(x) if n == 0: return repr(x) newlevel = helper.level - 1 pieces = [] maxparts = _repr_series_one_line.maxparts for i in _sample_indices(n, maxparts): k = x.index[i:i + 1].format(sparsify=False)[0] v = x.iloc[i] pieces.append('%s = %s' % (k, cheap_repr(v, newlevel))) if n > maxparts + 2: pieces.insert(maxparts // 2, '...') return '; '.join(pieces) python-executing-2.2.0/tests/small_samples/000077500000000000000000000000001474076367500210465ustar00rootroot000000000000000126981e43aec288449c540bef895abc32c6046ac22095919e1a1564ece7160b.py000066400000000000000000000001361474076367500317150ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass _ProtocolMeta: ((cls) for attr in _get_protocol_attrs) super().__instancecheck__0194cd769109c110d50905631c5793818736ff3835dd0a5ef97ed2f34cd65892.py000066400000000000000000000012501474076367500315320ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -112,7 +112,7 @@ # if all(self.static_cnd(n) is False for n in node.values): # node.__static_value = False # # - if any(self.static_cnd(n) is True for n in node.values): # + if any(self.static_cnd(n) is not True for n in node.values): # node.__static_value = True # # except AttributeError as e: # def after_stmt(self, node, frame, exc_value, exc_traceback, exc_node): if frame or _tracing_recursively: return None exc_value05b14e50cca9fbffd0ad2b1fa4e2e1243483dc6ea7fe81035c10b41a0d3bd711.py000066400000000000000000000010221474076367500325130ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -241,7 +241,7 @@ # # if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # else_is_dead = self.check_stmts( # - node.orelse, deadcode or (test_value is True) # + node.orelse, deadcode or (test_value is False) # ) # # self.walk_deadcode(node.test, deadcode) # if False: pass self0675309754ba4277c9cb3c52d7131377fe69c7744a271e2b7471917dabb5aaa1.py000066400000000000000000000001461474076367500317220ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass name_2: with name_0: # type: ignoresome text class name_2[name_5]: pass08b7d79dd83ba10104039e2873d3ea4452bedbb3e46e729114a27536cd9dfdc3.py000066400000000000000000000011461474076367500322160ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -305,7 +305,7 @@ # cnd = self.static_value(node.test, deadcode) # # self.check_stmts(node.body, deadcode or cnd is False) # - else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # + else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is False) # # if cnd is True and not contains_break(node): # # while True: ... no break # while True: pass else: SSHException09c2b2709b3507baf8a9e749c6e3bed21728d2159858adcfa66c49bb3e2f35f2.py000066400000000000000000000000371474076367500323200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef func[T](*, b='b'): pass0e52e1c718dbbe376fa8af89ea22dedd7431a02558e6065951ef712c3ed9e01a.py000066400000000000000000000007261474076367500323660ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -67,7 +67,7 @@ # node.__static_value = node.value # # elif isinstance(node, ast.Name) and node.id == "__debug__": # - node.__static_value = True # + node.__static_value = None # # elif isinstance(node, ast.UnaryOp): # try: # not __debug__0f7396913445f02c6720c718315895cdb6a259875f6b6fd29259a96c7e9c1ff5.py000066400000000000000000000000331474076367500316330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplessuper(mcs, *args, **kwargs)0fe16ec438396e003734858ad326d907e514273262547abaee0cd15e6eb7083e.py000066400000000000000000000012221474076367500317200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -332,7 +332,7 @@ # else_dead = self.check_stmts(node.orelse, try_dead) # final_dead = self.check_stmts(node.finalbody, deadcode) # # - deadcode = (handlers_dead and else_dead) or final_dead # + deadcode = (handlers_dead and else_dead) and final_dead # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And): # dead_op = deadcode # def __getattr__(): try: return self[name] except KeyError: return '' name1201463cc1031818ae1ea2b5a9dfcac2b7f9035aaa0c1670e61d8009e5701311.py000066400000000000000000000011411474076367500317710ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -448,7 +448,7 @@ # return # # if ( # - inst_match(("STORE_FAST", "STORE_DEREF", "STORE_NAME", "STORE_GLOBAL")) # + inst_match(("STORE_FAST", "STORE_DEREF", "STORE_NAME", "XXSTORE_GLOBALXX")) # and ( # node_match((ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)) # or node_match( # keyring = None def get_keyring_auth(): global keyring126f1cda2062caf2c74dcdcd77f5cb3a0e2d20b749329f84f48aa4d90701f2d0.py000066400000000000000000000000151474076367500324100ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplessession[:100]1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py000066400000000000000000002127161474076367500321440ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesx = ('R0lGODlhigJnAef/AAABAAEEAAkCAAMGAg0GBAYJBQoMCBMODQ4QDRITEBkS' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7' +'CxsSEhkWDhYYFQ0aJhkaGBweGyccGh8hHiIkIiMmGTEiHhQoPSYoJSkqKDcp' +'Ii0uLDAxLzI0Mh44U0gxMDI5JkM0JjU3NDY6Kjc5Njo7OUE8Ozw+Oz89QTxA' +'F1akOFFiRIgPHTZksKBAgMCLGTdGNIAAQgKfDAcgZbj0odOnUA8GBAA7')16b59c539eacafcbb66df969aa7a3a6f612fd4fa9acb07a2a30f837350c555a4.py000066400000000000000000000007431474076367500326000ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -505,7 +505,7 @@ # elif op_name in ( # "LOAD_NAME", # "LOAD_GLOBAL", # - "LOAD_FAST", # + "XXLOAD_FASTXX", # "LOAD_DEREF", # "LOAD_CLASSDEREF", # ): # def trace_this_module(self, context=0, deep=False): context -= 116f6f132d75df7cbbd0744f1cf6302dd4a1605a3b6ae0d6e9d45189f19db860b.py000066400000000000000000000011431474076367500323540ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -225,7 +225,7 @@ # node = self.result = cast(EnhancedAST, comparisons[0]) # else: # raise KnownIssue( # - "multiple chain comparison inside %s can not be fixed" % (node) # + "multiple chain comparison inside %s can not be fixed" / (node) # ) # # else: # if 0 <= r <= 255 and 0 <= g <= 255: pass1a1292769ffae5636aa864bec0bf01dc60380a867a7f5b8ab6f18b523848bb39.py000066400000000000000000000000221474076367500322200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples-tester is +tester1a7451e2c71947902b4ea93eb2cbf3ca9ecedc07be7d6c6a9832731fca80924a.py000066400000000000000000000007341474076367500324440ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -192,7 +192,7 @@ # if isinstance(node, ast.Return): # self.walk_deadcode(node.value, deadcode) # # - deadcode = True # + deadcode = None # # elif isinstance(node, ast.Assert): # cnd = self.static_value(node.test, deadcode) # raise NotImplementedError datafiles1afa3b7586b5527d711d8881bc2de395ebb8036a6c91a0cd952f02f280c83a4f.py000066400000000000000000000000211474076367500322100ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesnot self == other1fff64406be948c8ed049b0fc299b0e3702064f8592d6a020136cc0485e348cf.py000066400000000000000000000000421474076367500320050ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesasync def coroutine[B](): pass206e0609ff0589a0a32422ee902f09156af91746e27157c32c9595d12072f92a.py000066400000000000000000000022371474076367500314270ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesf'\n\n subroutine {fprefix}_input_{fsuffix}(c, o, n)\n character*{clength}, intent(in) :: c\n integer n\n !f2py integer, depend(c), intent(hide) :: n = slen(c)\n integer*1, dimension(n) :: o\n !f2py intent(out) o\n o = transfer(c, o)\n end subroutine {fprefix}_input_{fsuffix}\n\n subroutine {fprefix}_output_{fsuffix}(c, o, n)\n character*{clength}, intent(out) :: c\n integer n\n integer*1, dimension(n), intent(in) :: o\n !f2py integer, depend(o), intent(hide) :: n = len(o)\n c = transfer(o, c)\n end subroutine {fprefix}_output_{fsuffix}\n\n subroutine {fprefix}_array_input_{fsuffix}(c, o, m, n)\n integer m, i, n\n character*{clength}, intent(in), dimension(m) :: c\n !f2py integer, depend(c), intent(hide) :: m = len(c)\n !f2py integer, depend(c), intent(hide) :: n = f2py_itemsize(c)\n integer*1, dimension(m, n), intent(out) :: o\n do i=1,m\n o(i, :) = transfer(c(i), o(i, :))\n end do\n end subroutine {fprefix}_array_input_{fsuffix}\n\n subroutine '227620e1f473c9ac5ccf8328ed28b169c31617f5a4d6302337ce4f83109f745e.py000066400000000000000000000012001474076367500317240ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -330,7 +330,7 @@ # [self.check_stmts(h.body, deadcode) for h in node.handlers] # ) # else_dead = self.check_stmts(node.orelse, try_dead) # - final_dead = self.check_stmts(node.finalbody, deadcode) # + final_dead = None # # deadcode = (handlers_dead and else_dead) or final_dead # # def exec_ipython_cell(): try: shell.ex(traced_file.code) return self._ipython_cell_value finally: callback22bc344a43584c051d8962116e8fd149d72e7e68bcb54caf201ee6e78986b167.py000066400000000000000000000000411474076367500320170ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples (session .filter_by(key=item)) 248c72657ee1942a557f5521fe25423a53aa4b44e7890abf76ebaf1960952f2f.py000066400000000000000000000007531474076367500320230ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -279,7 +279,7 @@ # # else: # # return None # # deadcode() # - deadcode = True # + deadcode = False # # elif isinstance(node, ast.IfExp): # # def replace(self, string): for start, end, match in self: pass else: return False self2680ea2b168d077ec7ad4d22c7897f402c4984d93b314a8566d227ce894a6c14.py000066400000000000000000000000501474076367500317370ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef more_generic[**P](): type TA = P289bcf3ad1de1e72dab056250fe9516668937d7d9c55be773acd60a8f05c4318.py000066400000000000000000000001101474076367500322310ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass VerifierFailure: def __init__(self): super().__init__28dde5e66130457326139e9f4ae62987606de2b6362b073ae3671ad38cf37046.py000066400000000000000000000000211474076367500315720ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesnot not something2ab181c0e2d4978b1dc22cb8d9a4ed3e2bc6df02267f9766dfe1e8ee7924ff7c.py000066400000000000000000000020671474076367500326310ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -36,27 +36,7 @@ # def __init__(self): # self.future_annotations = False # # - operator_map = { # - # binary # - ast.Add: operator.add, # - ast.Sub: operator.sub, # - ast.Mult: operator.mul, # - ast.Div: operator.truediv, # - ast.FloorDiv: operator.floordiv, # - ast.Mod: operator.mod, # - ast.Pow: operator.pow, # - ast.LShift: operator.lshift, # - ast.RShift: operator.rshift, # - ast.BitOr: operator.or_, # - ast.BitXor: operator.xor, # - ast.BitAnd: operator.and_, # - ast.MatMult: operator.matmul, # - # unary # - ast.UAdd: operator.pos, # - ast.USub: operator.neg, # - ast.Not: operator.not_, # - ast.Invert: operator.invert, # - } # + operator_map = None # # def annotate_static_values(self, node): # for n in ast.iter_child_nodes(node): # if not 'a': print2ad55a93b62d942e84a4ec6cf3385da73bfe13a70739c8b6e21d6917cdf54142.py000066400000000000000000000001151474076367500322260ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass Any(metaclass=_AnyMeta): def __new__(cls): super().__new__2bfb9b3e488bd50d6e05a300b7cec608d2b0d54260b7ca4ce834bd81a96e1e54.py000066400000000000000000000001101474076367500324100ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef get_local_reprs(): vars_order = something lambda: vars_order2f31d64a74ed18026d7000094cefc6e5cace573b0df257f23299ed7bb21a3264.py000066400000000000000000000016411474076367500322060ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -370,7 +370,7 @@ # # if ( # ( # - inst_match("LOAD_METHOD", argval="join") # + inst_match("XXLOAD_METHODXX", argval="join") # or inst_match(("CALL", "BUILD_STRING")) # ) # and node_match(ast.BinOp, left=ast.Constant, op=ast.Mod) # 'Configuration\n - files_or_dirs: %s\n - verbosity: %s\n - tests: %s\n - port: %s\n - files_to_tests: %s\n - jobs: %s\n - split_jobs: %s\n\n - include_files: %s\n - include_tests: %s\n\n - exclude_files: %s\n - exclude_tests: %s\n\n - coverage_output_dir: %s\n - coverage_include_dir: %s\n - coverage_output_file: %s\n\n - django: %s\n' % (self, self, self, self, self, self, self, self, self, self, self, self, self, self, self)2fa69a57eb3b16f9ce0d5be427ad471c93a54c6d7e68b5be024b6a046ecc6bb2.py000066400000000000000000000010171474076367500325720ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -197,7 +197,7 @@ # elif isinstance(node, ast.Assert): # cnd = self.static_value(node.test, deadcode) # # - if cnd is False: # + if cnd is not False: # node.deadcode = deadcode # self.walk_deadcode(node.msg, deadcode) # deadcode = True # with self as session: assert isinstance db_func318c09f5abc7ace5b69c55380616ebf1cc984e6c365ff8d9f021725eabbe02ae.py000066400000000000000000000000561474076367500325310ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass Outer: class Inner[C]: pass339587c1bea1dae03e45ad87a1c245a4e7a3d719968e39e572cb987ee055ad50.py000066400000000000000000000010661474076367500322420ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -337,7 +337,7 @@ # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And): # dead_op = deadcode # for v in node.values: # - if self.static_value(v, dead_op) is False: # + if self.static_value(v, dead_op) is True: # dead_op = True # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): # print(0 and foo)37db52dbd6fe707c1f18121b6b0d10ed1b2c7962d3989d3087ab7c1aa207f773.py000066400000000000000000000010431474076367500322040ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -71,9 +71,7 @@ # # elif isinstance(node, ast.UnaryOp): # try: # - node.__static_value = self.operator_map[type(node.op)]( # - node.operand.__static_value # - ) # + node.__static_value = None # except Exception: # pass # # if not end_lineno: start_lineno393abb63bcdcf6c3f6b008fb7a7635ac6f615f1ef83579b2ad0e735d738e9ddd.py000066400000000000000000000000251474076367500326160ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplestype _Func = Callable3946430f5c3048d7d85d5424c4fcb541db50c9c41d5653c977e974351b2f6bc9.py000066400000000000000000000002071474076367500317440ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass _ProtocolMeta: def __instancecheck__(cls): ((cls) for attr in _get_protocol_attrs) super().__instancecheck__3a50eb1aed494e7b3b7e6fc814943b6b24acafdbc5b40644b79ec50bdb29b023.py000066400000000000000000000000551474076367500325550ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef test_alias_value_01(): type TA1 = int3d740a1da7646802a0c11ca94604e6da910ef47148032a1ec0a50047b9fcc024.py000066400000000000000000000000411474076367500317200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef more_generic[*Ts](): pass3dbbed07d7fec1ba458ca74840ec2f6196114bb49f09193a7704911172b8c04a.py000066400000000000000000000012021474076367500321220ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -109,7 +109,7 @@ # node.__static_value = False # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): # - if all(self.static_cnd(n) is False for n in node.values): # + if all(self.static_cnd(n) is not False for n in node.values): # node.__static_value = False # # if any(self.static_cnd(n) is True for n in node.values): # if level or (level): sample_type = 'big' else: pass3e40f2921fbaf6ccbabb2fa5c3cd3a42b54914d66f7a67f8b2ade36f89ed761b.py000066400000000000000000000000701474076367500327350ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesasync def wait(): async with something: pass42a37b8a823eb2e510b967332661afd679c82c60b7177b992a47c16d81117c8a.py000066400000000000000000000011161474076367500316460ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -468,7 +468,7 @@ # return # # if node_match(ast.Name, ctx=ast.Load) and inst_match( # - ("LOAD_NAME", "LOAD_FAST", "LOAD_GLOBAL"), argval=mangled_name(node) # + ("XXLOAD_NAMEXX", "LOAD_FAST", "LOAD_GLOBAL"), argval=mangled_name(node) # ): # return # # class Opt: def __init__(self, expr: Union, default: Any=__optionalNotMatched): pass437c7cbd0809c59a17c3928b83eb0a4f2c23aeef11417cdadea9bdefe77c318a.py000066400000000000000000000010221474076367500326470ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -473,7 +473,7 @@ # return # # if node_match(ast.Name, ctx=ast.Del) and inst_match( # - ("DELETE_NAME", "DELETE_GLOBAL"), argval=mangled_name(node) # + ("XXDELETE_NAMEXX", "DELETE_GLOBAL"), argval=mangled_name(node) # ): # return # # class SerializedDAG: del __get_constructor_defaults45a20d9fefe2db8c5fbc91ad26e8e9dce0667e126dab5e34fd6825c085776be5.py000066400000000000000000000012371474076367500326330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -230,7 +230,7 @@ # # else: # # Comprehension and generators get not fixed for now. # - raise KnownIssue("chain comparison inside %s can not be fixed" % (node)) # + raise KnownIssue("chain comparison inside %s can not be fixed" / (node)) # # if isinstance(node, ast.Assert): # # pytest assigns the position of the assertion to all expressions of the rewritten assertion. # [r for r in results if start <= r <= end]46597f8f896f11c5d7f432236344cc7e5645c2a39836eb6abdd2437c0422f0f4.py000066400000000000000000000121021474076367500317420ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# sample for this mutation # +++ b/executing/_position_node_finder.py # @@ -193,7 +193,7 @@ class PositionNodeFinder(object): # # index += 2 # # - while self.opname(index) in ("CACHE", "EXTENDED_ARG"): # + while self.opname(index) in ("CACHE", "XXEXTENDED_ARGXX"): # index += 2 # # if ( import ast from abc import ABC, abstractmethod from collections import defaultdict from concurrent.futures import Executor, ThreadPoolExecutor, ProcessPoolExecutor from contextlib import contextmanager from datetime import datetime from enum import Enum from functools import lru_cache, wraps import itertools import logging from multiprocessing import Manager, freeze_support import os from pathlib import Path import pickle import regex as re import signal import sys import tempfile import tokenize import traceback from typing import Collection, Generator, Generic, Iterable, Pattern, Sequence, Sized, Type, cast, TYPE_CHECKING from typing_extensions import Final from mypy_extensions import mypyc_attr from appdirs import user_cache_dir from dataclasses import field, replace import toml from typed_ast import ast3, ast27 from pathspec import PathSpec from blib2to3.pytree import Leaf, type_repr from blib2to3 import pytree from blib2to3.pgen2 import driver from blib2to3.pgen2.grammar import Grammar from blib2to3.pgen2.parse import ParseError from _black_version import version as __version__ import colorama DEFAULT_LINE_LENGTH = 88 DEFAULT_EXCLUDES = '/(\\.direnv|\\.eggs|\\.git|\\.hg|\\.mypy_cache|\\.nox|\\.tox|\\.venv|\\.svn|_build|buck-out|build|dist)/' DEFAULT_INCLUDES = '\\.pyi?$' CACHE_DIR = Path STRING_PREFIX_CHARS: Final = 'furbFURB' Depth = int NodeType = int ParserState = int LeafID = int StringID = int Priority = int Index = int LN = Union Transformer = Callable Timestamp = float FileSize = int CacheInfo = Tuple Cache = Dict out = click.secho err = partial pygram.initialize pygram.python_symbols class NothingChanged(UserWarning): pass class CannotTransform(Exception): pass class CannotSplit: pass class InvalidInput(ValueError): pass E = TypeVar def ok() -> T: pass def __init__() -> None: pass Result = Union TMatchResult = TResult CACHED = 1 PY36_VERSIONS = {TargetVersion.PY36, TargetVersion.PY37, TargetVersion.PY38} VERSION_TO_FEATURES: Dict[TargetVersion, Set[Feature]] = {TargetVersion.PY27: {*()}, TargetVersion.PY33: {*()}, TargetVersion.PY34: {*()}, TargetVersion.PY35: {*()}, TargetVersion: {Feature.ASYNC_IDENTIFIERS}, TargetVersion: {*()}, TargetVersion: {Feature.UNICODE_LITERALS, Feature.F_STRINGS, Feature.NUMERIC_UNDERSCORES, Feature.TRAILING_COMMA_IN_CALL, Feature.TRAILING_COMMA_IN_DEF, Feature.ASYNC_KEYWORDS, Feature.ASSIGNMENT_EXPRESSIONS, Feature.POS_ONLY_ARGUMENTS}} FileMode = Mode def supports_feature() -> bool: pass def find_pyproject_toml() -> Optional[str]: pass def parse_pyproject_toml() -> Dict[str, Any]: pass def read_pyproject_toml(ctx: click.Context) -> Optional[str]: pass def target_version_option_callback(p: Union[click.Option, click.Parameter]) -> List[TargetVersion]: pass @click.command(context_settings=dict) @click.option @click.Choice @click.version_option @click.argument @click.pass_context def main() -> None: pass def get_sources() -> Set[Path]: pass def path_empty() -> None: pass def reformat_one() -> None: pass def reformat_many() -> None: pass async def schedule_formatting(loop: asyncio.AbstractEventLoop) -> None: pass def format_file_in_place(src: Path=WriteBack.NO) -> bool: pass def color_diff() -> str: pass def wrap_stream_for_windows() -> Union[io.TextIOWrapper, 'colorama.AnsiToWin32.AnsiToWin32']: pass def format_stdin_to_stdout() -> bool: pass def format_file_contents() -> FileContent: pass def format_str() -> FileContent: pass def decode_bytes(src: bytes) -> Tuple[FileContent, Encoding, NewLine]: pass def get_grammars() -> List[Grammar]: pass def lib2to3_parse() -> Node: pass def lib2to3_unparse() -> str: pass def visit() -> Iterator[T]: pass tree_depth: int = 0 WHITESPACE: Final = {token.DEDENT, token.INDENT, token.NEWLINE} STATEMENT: Final = {syms.if_stmt, syms.while_stmt, syms.for_stmt, syms.try_stmt, syms.except_clause, syms.with_stmt, syms.funcdef, syms.classdef} token.tok_name[STANDALONE_COMMENT] = 'STANDALONE_COMMENT' LOGIC_OPERATORS: Final = {*()} COMPARATORS: Final = {token.LESS, token.GREATER, token.EQEQUAL, token.NOTEQUAL, token.LESSEQUAL, token.GREATEREQUAL} MATH_OPERATORS: Final = {token.VBAR, token.CIRCUMFLEX, token.AMPER, token.LEFTSHIFT, token.RIGHTSHIFT, token.PLUS, token.MINUS, token.STAR, token.SLASH, token.DOUBLESLASH, token.PERCENT, token.AT, token.TILDE, token.DOUBLESTAR} VARARGS_SPECIALS: Final = STARS VARARGS_PARENTS: Final = {syms.arglist, syms.trailer, syms.typedargslist, syms.varargslist} UNPACKING_PARENTS: Final = {syms.atom, syms.dictsetmaker, syms.listmaker, syms.testlist_gexp, syms.testlist_star_expr} {syms.test, syms.lambdef, syms.or_test, syms.and_test, syms.not_test} @dataclass class BracketTracker: pass 477815a6eac78431cfb30ac314764dbf43beed5b54af64c4a666537afaf3d718.py000066400000000000000000000007401474076367500323650ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -67,7 +67,7 @@ # node.__static_value = node.value # # elif isinstance(node, ast.Name) and node.id == "__debug__": # - node.__static_value = True # + node.__static_value = False # # elif isinstance(node, ast.UnaryOp): # try: # if __debug__: self4851dc1b626a95e97dbe0c53f96099d165b755dd1bd552c6ca771f7bca6d30f5.py000066400000000000000000000012451474076367500323220ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -201,7 +201,7 @@ # index += 4 # # def known_issues(self, node: EnhancedAST, instruction: dis.Instruction) -> None: # - if instruction.opname in ("COMPARE_OP", "IS_OP", "CONTAINS_OP") and isinstance( # + if instruction.opname in ("COMPARE_OP", "XXIS_OPXX", "CONTAINS_OP") and isinstance( # node, types_cmp_issue # ): # if isinstance(node, types_cmp_issue_fix): # if 1 < 1 > 1 == 1 >= 1 <= 1 != 1 in 1 not in 1 is 1 is not 1: pass49e298556393765fe40e351447825acca36bbc6b254c144c6a8fc9f82602c6a0.py000066400000000000000000000006031474076367500317350ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -92,7 +92,7 @@ # "%": ast.Mod, # "+": ast.Add, # "-": ast.Sub, # - "<<": ast.LShift, # + "XX<>": ast.RShift, # "&": ast.BitAnd, # "^": ast.BitXor, # us1 << 84ac35edc8adbe59cee1c11080c0e7d458fa5f2144a3f3bc1919e8722d6949780.py000066400000000000000000000011031474076367500323020ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -99,7 +99,7 @@ # node.__static_value = node.body.__static_value # # elif cnd is False: # - node.__static_value = node.orelse.__static_value # + node.__static_value = None # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And): # if all(self.static_cnd(n) is True for n in node.values): # if 1 if 0 else a: print4d3f8fa60aa762d76852454257bd527e40f38549b584e45269cfc5977248fb62.py000066400000000000000000000000651474076367500316330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplestype ConstrainedGenericAlias[LongName: (str,)] = list4fb0f58b18c1b1484aec340e1a7ab7cdc87185a067ee37a73f05eb1a1d08bb11.py000066400000000000000000000012561474076367500324100ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -242,7 +242,7 @@ # # TODO: investigate # raise KnownIssue("pattern matching ranges seems to be wrong") # # - if instruction.opname == "STORE_NAME" and instruction.argval == "__classcell__": # + if instruction.opname == "STORE_NAME" or instruction.argval == "__classcell__": # # handle stores to __classcell__ as KnownIssue, # # because they get complicated if they are used in `if` or `for` loops # # example: # CodeInfo = namedtuple508ccd0dcac13ecee6f0cea939b73ba5319c780ddbb6c496be96fe5614871d4a.py000066400000000000000000000010561474076367500326710ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -468,7 +468,7 @@ # return # # if node_match(ast.Name, ctx=ast.Load) and inst_match( # - ("LOAD_NAME", "LOAD_FAST", "LOAD_GLOBAL"), argval=mangled_name(node) # + ("LOAD_NAME", "LOAD_FAST", "XXLOAD_GLOBALXX"), argval=mangled_name(node) # ): # return # # class __test: def onClickPage(self, event): __test25182c37c0eb2a1b7402d1c3fc623d4e57106429cc932cce07630fc07781e4167.py000066400000000000000000000010011474076367500316660ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -246,7 +246,7 @@ # # self.walk_deadcode(node.test, deadcode) # # - deadcode = if_is_dead and else_is_dead # + deadcode = if_is_dead or else_is_dead # # elif isinstance(node, ast.Match): # self.walk_deadcode(node.subject, deadcode) # def before_stmt(self, node, frame): if frame: return isinstance524a7a805db753f5ea998182ddaea49a177b75a7ae88ab77eaa879755857a15a.py000066400000000000000000000000411474076367500322540ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass Parent: type TA1 = dict59b33fb13ecb2036cd31a92dac7eded938aab8b9e91f84c80eab0e8bec0441f0.py000066400000000000000000000007101474076367500327220ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -204,7 +204,7 @@ # # elif cnd is True: # node.deadcode = deadcode # - self.walk_deadcode(node.msg, True) # + self.walk_deadcode(node.msg, False) # # else: # node.deadcode = deadcode # assert '/recipe-release%2F0.6.1', client5b248fd091bffcd4c82adafd17760cc0d471f60c584c91a3998b7f213029cee5.py000066400000000000000000000006011474076367500323640ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -89,7 +89,7 @@ # "@": ast.MatMult, # "//": ast.FloorDiv, # "/": ast.Div, # - "%": ast.Mod, # + "XX%XX": ast.Mod, # "+": ast.Add, # "-": ast.Sub, # "<<": ast.LShift, # '<%s>' % i5ccbe1d4d1e9e02d612eda06a38b753f56c8e20a4780d2912230274c76d2568b.py000066400000000000000000000010221474076367500320400ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -239,7 +239,7 @@ # # test_value = self.static_value(node.test, deadcode) # # - if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # + if_is_dead = None # else_is_dead = self.check_stmts( # node.orelse, deadcode or (test_value is True) # ) # if isinstance: is_interesting_expression5da4523399bd1a8477d2d02970672787c08a73c1c5f0268b0d08de4c35a7f5a0.py000066400000000000000000000007401474076367500317230ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -200,7 +200,7 @@ # if cnd is False: # node.deadcode = deadcode # self.walk_deadcode(node.msg, deadcode) # - deadcode = True # + deadcode = None # # elif cnd is True: # node.deadcode = deadcode # assert False, 'Can this happen?' nodes6105c9bae9aa36ffe1ac55a3c957c54952732ee47573522d1c19779c6c6e6d48.py000066400000000000000000000007261474076367500321200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -95,7 +95,7 @@ # # elif isinstance(node, ast.IfExp): # cnd = self.static_cnd(node.test) # - if cnd is True: # + if cnd is False: # node.__static_value = node.body.__static_value # # elif cnd is False: # if 0 if 1 else 2: print635d56ede8cbcb2824d42291eb9fe9288d5f09c768636aaa19984ffdfc91e9fe.py000066400000000000000000000010421474076367500325230ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -271,7 +271,7 @@ # self.walk_deadcode(node.iter, deadcode) # self.check_stmts(node.body, deadcode) # # - else_is_dead = self.check_stmts(node.orelse, deadcode) # + else_is_dead = None # # if else_is_dead and not contains_break(node.body): # # for a in l: # with self: for _ in tester: pass else: tester6602443ba655e0e139cfb923d581f8da91071d631a42f81253c1e47fdc952da3.py000066400000000000000000000012361474076367500317740ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -440,7 +440,7 @@ # return # # if ( # - inst_match(("STORE_NAME", "STORE_FAST", "STORE_DEREF", "STORE_GLOBAL")) # + inst_match(("STORE_NAME", "STORE_FAST", "STORE_DEREF", "XXSTORE_GLOBALXX")) # and node_match((ast.Import, ast.ImportFrom)) # and any(mangled_name(cast(EnhancedAST, alias)) == instruction.argval for alias in cast(ast.Import, node).names) # ): # import keyring def get_keyring_auth(): global keyring69bd4dd67f6d3737f72f314978488dfedd5e8071b45a2648757451ac47bf1b33.py000066400000000000000000000010141474076367500320450ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -6,7 +6,7 @@ # "search all child nodes except other loops for a break statement" # # if isinstance(node_or_list, ast.AST): # - childs = ast.iter_child_nodes(node_or_list) # + childs = None # elif isinstance(node_or_list, list): # childs = node_or_list # else: # with self: for _ in tester: pass else: raise ValueError6a14a6ef8c8540838e00af19ff0b68dde868ec14a774a501cad3f055a40dd23e.py000066400000000000000000000011611474076367500323520ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -239,7 +239,7 @@ # # test_value = self.static_value(node.test, deadcode) # # - if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # + if_is_dead = self.check_stmts(node.body, deadcode and (test_value is False)) # else_is_dead = self.check_stmts( # node.orelse, deadcode or (test_value is True) # ) # def _get_connection(self): return beanstalkc if self: beanstalkc6a33e6efd8198ed5610a6072c40faa1d1f0baa64ac2b14fb011ab24e5b32f941.py000066400000000000000000000006031474076367500323630ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -93,7 +93,7 @@ # "+": ast.Add, # "-": ast.Sub, # "<<": ast.LShift, # - ">>": ast.RShift, # + "XX>>XX": ast.RShift, # "&": ast.BitAnd, # "^": ast.BitXor, # "|": ast.BitOr, # n >> 56d0092f79094500dd7bfbe51cedab7e44db1745b729fb347f9a60dff7b96d09a.py000066400000000000000000000007541474076367500324670ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -503,7 +503,7 @@ # ctx = ast.Load # extra_filter = lambda e: mangled_name(e) == instruction.argval # elif op_name in ( # - "LOAD_NAME", # + "XXLOAD_NAMEXX", # "LOAD_GLOBAL", # "LOAD_FAST", # "LOAD_DEREF", # basic_types += ()6d981a27f4f4672f186cb498c6c012ac2c6168dfd631e7fff5602e9e5586f00e.py000066400000000000000000000052401474076367500321770ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -273,6 +273,36 @@ # # else_is_dead = self.check_stmts(node.orelse, deadcode) # # + if else_is_dead or not contains_break(node.body): # + # for a in l: # + # something() # + # else: # + # return None # + # deadcode() # + deadcode = True # + # + elif isinstance(node, ast.IfExp): # + # + test_value = self.static_value(node.test, deadcode) # + # + self.walk_deadcode( # + node.body, deadcode or (test_value is False) # + ) # + # + self.walk_deadcode( # + node.orelse, deadcode or (test_value is True) # + ) # + # + elif isinstance(node, (ast.While)): # + cnd = self.static_value(node.test, deadcode) # + # + self.check_stmts(node.body, deadcode or cnd is False) # + else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # + # + if cnd is True and not contains_break(node): # + # while True: ... no break # + deadcode = True # + # if else_is_dead and not contains_break(node.body): # # for a in l: # # something() # @@ -281,36 +311,6 @@ # # deadcode() # deadcode = True # # - elif isinstance(node, ast.IfExp): # - # - test_value = self.static_value(node.test, deadcode) # - # - self.walk_deadcode( # - node.body, deadcode or (test_value is False) # - ) # - # - self.walk_deadcode( # - node.orelse, deadcode or (test_value is True) # - ) # - # - elif isinstance(node, (ast.While)): # - cnd = self.static_value(node.test, deadcode) # - # - self.check_stmts(node.body, deadcode or cnd is False) # - else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # - # - if cnd is True and not contains_break(node): # - # while True: ... no break # - deadcode = True # - # - if else_is_dead and not contains_break(node.body): # - # for a in l: # - # something() # - # else: # - # return None # - # deadcode() # - deadcode = True # - # elif isinstance(node, (ast.Try, ast.TryStar)): # try_dead = self.check_stmts(node.body, deadcode) # # for loop_node in node: pass value6e57262c88b56d0d657064aec550809ad12bb5f22524f12b25dfa8840a9856e2.py000066400000000000000000000011151474076367500317220ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -264,7 +264,7 @@ # if inst.opname not in ( # "STORE_NAME", # "STORE_FAST", # - "STORE_DEREF", # + "XXSTORE_DEREFXX", # "STORE_GLOBAL", # "DELETE_NAME", # "DELETE_FAST", # def filterChanged(self, text): try: e = compile(text, '', 'eval') except Exception as e: pass def f(t): e736316309812e0ca8306cb7eec4c20d75f8e3c45cab3cd46cf4370524ada6823.py000066400000000000000000000013101474076367500321170ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -399,7 +399,7 @@ # if inst_match(("BEFORE_WITH","WITH_EXCEPT_START")) and node_match(ast.With): # return # # - if inst_match(("STORE_NAME", "STORE_GLOBAL"), argval="__doc__") and node_match( # + if inst_match(("XXSTORE_NAMEXX", "STORE_GLOBAL"), argval="__doc__") and node_match( # ast.Constant # ): # # store docstrings # class BirdsEye: """ Decorate functions with an instance of this class to debug them, or just use the existing instance `eye`. """73d0fdb16164fc57d2dfc4fad6182f18b9c004a668645de8c14219daa546e2d1.py000066400000000000000000000000771474076367500323030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass Tester: def __setattr__(): super __add__7532e0e7ee9c85347bb4bfcc8751604bf934d3e96e48f3bc8b5778d7856d5a7e.py000066400000000000000000000001021474076367500322740ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass _IdentityCallable: def __call__[T]() -> T: pass764af8204d7aa6e6c3d1856387308718719eb5e79ca7aa7f68561d74f9748a8d.py000066400000000000000000000006041474076367500320030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -86,7 +86,7 @@ # op_type_map = { # "**": ast.Pow, # "*": ast.Mult, # - "@": ast.MatMult, # + "XX@XX": ast.MatMult, # "//": ast.FloorDiv, # "/": ast.Div, # "%": ast.Mod, # noise @ noise770facda5ac10a6e33d18979e6a420423df9fead73483fda002ff8a241c2e795.py000066400000000000000000000011621474076367500323560ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -304,7 +304,7 @@ # elif isinstance(node, (ast.While)): # cnd = self.static_value(node.test, deadcode) # # - self.check_stmts(node.body, deadcode or cnd is False) # + self.check_stmts(node.body, deadcode and cnd is False) # else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # # if cnd is True and not contains_break(node): # def advancePastEmptyBuckets(): return while self: self780d1e5c82a0d4c02798ef5d5f2f8895334a242128f7a7a300f44cf2036b8dc4.py000066400000000000000000000012241474076367500320030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -191,8 +191,7 @@ # index += 2 # # if ( # - self.opname(index).startswith("STORE_") # - and self.find_node(index) == node_func # + self.opname(index).startswith("STORE_") or self.find_node(index) == node_func # ): # self.result = node_func # self.decorator = node # @lru_cache() def compile(self, source, filename, flags=0): pass7b46d9fff0efc0a4578c804c7b48af4c6fd9010a93b50865a80075e0320098ef.py000066400000000000000000000010611474076367500321500ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -239,7 +239,7 @@ # # test_value = self.static_value(node.test, deadcode) # # - if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # + if_is_dead = self.check_stmts(node.body, deadcode or (test_value is True)) # else_is_dead = self.check_stmts( # node.orelse, deadcode or (test_value is True) # ) # if False: self7ec5eed65083de4adc88655f15d02ce24303aa1f2860762d800d7e9093c6eb59.py000066400000000000000000000000121474076367500321430ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples(*t_args,)7f9ef841e54b680b479c91f764049ae8ca04539f9b9484af307c978d9155df4b.py000066400000000000000000000000671474076367500320730ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesassert len == 2, 'Watch extra must return pair or None'7fff707ddf87544616f198155d98e215700b261e39fda3844940ec2aab5a0610.py000066400000000000000000000012351474076367500317350ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -332,7 +332,7 @@ # else_dead = self.check_stmts(node.orelse, try_dead) # final_dead = self.check_stmts(node.finalbody, deadcode) # # - deadcode = (handlers_dead and else_dead) or final_dead # + deadcode = (handlers_dead or else_dead) or final_dead # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And): # dead_op = deadcode # def for_filename(): try: return source_cache[filename] except KeyError: pass linecache81aed400e9ebc64f9f1f6d0fdaf6ccaefd81736d54d180db3c5a1b2aeb72fb6f.py000066400000000000000000000011511474076367500331510ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -329,7 +329,7 @@ # handlers_dead = all( # [self.check_stmts(h.body, deadcode) for h in node.handlers] # ) # - else_dead = self.check_stmts(node.orelse, try_dead) # + else_dead = None # final_dead = self.check_stmts(node.finalbody, deadcode) # # deadcode = (handlers_dead and else_dead) or final_dead # try: length = len(val) except: pass else: result.set_meta('len', length)82697c5032f0c92b55da4d36c5b7ce2bba016eda66bb1d449e52afe319b447ea.py000066400000000000000000000011301474076367500324210ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -305,7 +305,7 @@ # cnd = self.static_value(node.test, deadcode) # # self.check_stmts(node.body, deadcode or cnd is False) # - else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # + else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is not True) # # if cnd is True and not contains_break(node): # # while True: ... no break # while context: pass os83c8b55804e611761085ef55ca3c6aaac382500b797dfa4b797abdbedb23126b.py000066400000000000000000000005201474076367500322650ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -96,7 +96,7 @@ # ">>": ast.RShift, # "&": ast.BitAnd, # "^": ast.BitXor, # - "|": ast.BitOr, # + "XX|XX": ast.BitOr, # } # # # ast | flags8519155d8a424c7cbc4bc15042d50c3193688c600ac9552f9503672e7c01b4d9.py000066400000000000000000000000371474076367500315550ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass A(0, 1, 2, **d): pass867a476c53701b28e25aa4b445e586b8a6764f9f8582b98955c4352b0d8ba415.py000066400000000000000000000000221474076367500316110ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplestype TA1[B] = dict88f983dcf04b0d0b09cb105943226d186f9f6a8ada3da7c48a1a3a1c0d947995.py000066400000000000000000000011061474076367500322240ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -11,7 +11,7 @@ # def parents(node: EnhancedAST) -> Iterator[EnhancedAST]: # - while True: # + while False: # if hasattr(node, "parent"): # node = node.parent # yield node def __call__(self, function): def generator_wrapper(*args, **kwargs): try: method, incoming = (gen.send, (yield outgoing)) except Exception as e: pass8a2d183daa29dea1fdad279688a2b99dcfef00932e06d4693385dfc1634c6f6c.py000066400000000000000000000000461474076367500324630ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef func[T](a='a', *, b='b'): pass8d7d8e2330522993cf517ba2f4191e01c336fb27bbbfa40815629432b96d74fa.py000066400000000000000000000000361474076367500317770ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass SupportsAbs[T]: pass91f5b684f56b415a61d211027904e023f2371952602a8d71c17416d8fa3ceed7.py000066400000000000000000000013571474076367500315600ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -242,7 +242,7 @@ # # TODO: investigate # raise KnownIssue("pattern matching ranges seems to be wrong") # # - if instruction.opname == "STORE_NAME" and instruction.argval == "__classcell__": # + if instruction.opname != "STORE_NAME" and instruction.argval == "__classcell__": # # handle stores to __classcell__ as KnownIssue, # # because they get complicated if they are used in `if` or `for` loops # # example: # class BirdsEye: def __init__(self, db_uri=None, num_samples=None): super927e4c80a3ef17328f8807a49fe82da7f223652fccfeab7484194b94007c2b74.py000066400000000000000000000007001474076367500321040ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -116,7 +116,7 @@ # node.__static_value = True # # except AttributeError as e: # - if e.name != "_Deadcode__static_value": # + if e.name != "XX_Deadcode__static_valueXX": # raise # # def static_cnd(self, node): # path if '' else path93f00cfd350495557ead44e2dd46ac4ce7d913f6e5d86ba1b0d5044cec188438.py000066400000000000000000000012031474076367500323030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -507,7 +507,7 @@ # "LOAD_GLOBAL", # "LOAD_FAST", # "LOAD_DEREF", # - "LOAD_CLASSDEREF", # + "XXLOAD_CLASSDEREFXX", # ): # typ = ast.Name # ctx = ast.Load # def __init__(self, out=None, prefix='', columns='time', overwrite=False, color=None, enabled=True, watch_extras=(), replace_watch_extras=None, formatter_class=DefaultFormatter): class ConfiguredTracer: self994c59ca460328030a4a36060ee6143c6699a06c28192a779af62124c93476d9.py000066400000000000000000000010231474076367500313520ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -66,7 +66,7 @@ # if isinstance(node, ast.Constant): # node.__static_value = node.value # # - elif isinstance(node, ast.Name) and node.id == "__debug__": # + elif isinstance(node, ast.Name) and node.id != "__debug__": # node.__static_value = True # # elif isinstance(node, ast.UnaryOp): # num_samples or dict9a30338a97c5bd67283cb31910c04624714cbf6c19f1382af18efccd443abff9.py000066400000000000000000000012161474076367500322200ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -201,7 +201,7 @@ # index += 4 # # def known_issues(self, node: EnhancedAST, instruction: dis.Instruction) -> None: # - if instruction.opname in ("COMPARE_OP", "IS_OP", "CONTAINS_OP") and isinstance( # + if instruction.opname in ("XXCOMPARE_OPXX", "IS_OP", "CONTAINS_OP") and isinstance( # node, types_cmp_issue # ): # if isinstance(node, types_cmp_issue_fix): # if start_lineno <= node <= end_lineno: pass9b3db37076d3c7c76bdfd9badcc70d8047584433e1eea89f45014453d58bbc43.py000066400000000000000000000012431474076367500323140ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -177,7 +177,7 @@ # if stmt.module == "__future__" and any( # "annotations" == alias.name for alias in stmt.names # ): # - self.future_annotations = True # + self.future_annotations = None # # self.check_stmts(node.body, deadcode) # elif isinstance(node, (ast.With, ast.AsyncWith)): # from __future__ import annotations, with_statement async def _start(self: Cloud) -> Cloud[IsAsynchronous]: pass9f0ed8b1be98c481ba17f3f3fa0442cc67ae5730f8e854e23e3f3147f9bc5e8b.py000066400000000000000000000011001474076367500324540ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -240,9 +240,7 @@ # test_value = self.static_value(node.test, deadcode) # # if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # - else_is_dead = self.check_stmts( # - node.orelse, deadcode or (test_value is True) # - ) # + else_is_dead = None # # self.walk_deadcode(node.test, deadcode) # # if i: pass else: loop9f7d4ed823cb426db2e435dd7856f07c9965a88102bd63e5640a7e63250e2718.py000066400000000000000000000010221474076367500317430ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -87,9 +87,7 @@ # # elif isinstance(node, ast.Subscript): # try: # - node.__static_value = node.value.__static_value[ # - node.slice.__static_value # - ] # + node.__static_value = None # except Exception: # pass # # if hangs[depth]: hangpython-executing-2.2.0/tests/small_samples/LOAD_NAME_ast_AugAssign.py000066400000000000000000000001351474076367500255460ustar00rootroot00000000000000# LOAD_NAME is mapped to ast.Name(ctx=ast.Store) class _Hook_amd64: __float_types += () a2389f211aec4c553b1cec683b416480636d7c13d10e8db50b5da567192ce42f.py000066400000000000000000000000301474076367500321130ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass Foo[__T]: passa33f71955b90ec91ef184fccf593e537aa583db12b67d9130917a4349701eaa2.py000066400000000000000000000012661474076367500320730ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -414,7 +414,7 @@ # return # # if ( # - inst_match(("STORE_NAME", "STORE_FAST", "STORE_DEREF", "STORE_GLOBAL")) # + inst_match(("STORE_NAME", "XXSTORE_FASTXX", "STORE_DEREF", "STORE_GLOBAL")) # and node_match((ast.Import, ast.ImportFrom)) # and any(mangled_name(cast(EnhancedAST, alias)) == instruction.argval for alias in cast(ast.Import, node).names) # ): # def exec_ipython_cell(self, source, callback): from IPython import get_ipythona35a3b669faf7fa486c7ca0a95a61efab9591a0d1677406c48c53e1a04ebe850.py000066400000000000000000000000421474076367500323520ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef override[F: _Func](): passa3ab7db4c4e846bc2e660b97d021ff2167b71e1609ed29a92c9edd70332adc34.py000066400000000000000000000010671474076367500323550ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -391,7 +391,7 @@ # ): # return # # - if inst_match("BUILD_STRING") and ( # + if inst_match("XXBUILD_STRINGXX") and ( # node_match(ast.JoinedStr) or node_match(ast.BinOp, op=ast.Mod) # ): # return # ('expression %r caused the wrong ValueError\n' + 'actual error was:\n%s\n' + 'expected error was:\n%s\n') % (expr, e, error)a6428177defd48080b32b7b570aa729067b9c8044821dbbb787cce7fb3999e73.py000066400000000000000000000010401474076367500321050ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -307,7 +307,7 @@ # self.check_stmts(node.body, deadcode or cnd is False) # else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # # - if cnd is True and not contains_break(node): # + if cnd is False and not contains_break(node): # # while True: ... no break # deadcode = True # # while 0: pass x = 0a8c5d8fec98be9e324c50d6c89b207e35f3ad80ca7bf8c670b65b80cb092c7d2.py000066400000000000000000000000411474076367500325330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef more_generic[**P](): passa913b7799aa6a860097fb4daf0eb8954b97dad48e4880fa3ed76da5e9f736764.py000066400000000000000000000010721474076367500323560ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -262,7 +262,7 @@ # @staticmethod # def is_except_cleanup(inst: dis.Instruction, node: EnhancedAST) -> bool: # if inst.opname not in ( # - "STORE_NAME", # + "XXSTORE_NAMEXX", # "STORE_FAST", # "STORE_DEREF", # "STORE_GLOBAL", # try: from aiohttp import web import aiohttp_cors except ImportError as ie: passa9cf2f563ac80ad0066c4ef3ac10fa2f146252db49b3a0a9cb69e0c03e07827b.py000066400000000000000000000011141474076367500324010ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -43,7 +43,7 @@ # elif isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)): # name = node.name # elif isinstance(node, ast.ExceptHandler): # - name = node.name or "exc" # + name = node.name or "XXexcXX" # else: # raise TypeError("XXno node to mangleXX") # # def call_errorfunc(): global _errok, _token, _restart del _errok, _token, _restartad8aa993e6ee4eb5ee764d55f2e3fd636a99b2ecb8c5aff2b35fbb78a074ea30.py000066400000000000000000000000311474076367500330350ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples(i async for i in arange)ae9b3821230822abe9910bb1ebfe74ff2cedc19f646975fb2931f4b67fd4f189.py000066400000000000000000000000121474076367500323760ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplestuple[*a] b0f8cf7dd6323f9df8f3d5f38044c76f0688ea01b1c085b5867eb844780d9c23.py000066400000000000000000000011461474076367500322010ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -105,7 +105,7 @@ # if all(self.static_cnd(n) is True for n in node.values): # node.__static_value = True # # - if any(self.static_cnd(n) is False for n in node.values): # + if any(self.static_cnd(n) is not False for n in node.values): # node.__static_value = False # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): # if isinstance and node: selfb38dc0d61808291d3c0a1bb2ed6a6a488a3df729d2307d426f1a101c9e512f06.py000066400000000000000000000011041474076367500321030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -106,7 +106,7 @@ # node.__static_value = True # # if any(self.static_cnd(n) is False for n in node.values): # - node.__static_value = False # + node.__static_value = True # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): # if all(self.static_cnd(n) is False for n in node.values): # if outer and False: selfb80fbb517bb6b016947288beb9d24c05bbd3aa334585fd0f4a13bf25f7a3cca5.py000066400000000000000000000010471474076367500324760ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -494,7 +494,7 @@ # op_type = dict( # UNARY_POSITIVE=ast.UAdd, # UNARY_NEGATIVE=ast.USub, # - UNARY_NOT=ast.Not, # + UNARY_NOTXX=ast.Not, # UNARY_INVERT=ast.Invert, # )[op_name] # extra_filter = lambda e: isinstance(cast(ast.UnaryOp, e).op, op_type) # not selfb8be3216d583e1ce26486ee2aff5cbe74fed88ebba7118db80a375c9514d1bc1.py000066400000000000000000000000351474076367500326030ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef func[S, T: S](): passb8ccb32482909adb7b5677562337973df9562487a306bc7a9d5e43e626fa47ef.py000066400000000000000000000006361474076367500320520ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -195,7 +195,7 @@ # deadcode = True # # elif isinstance(node, ast.Assert): # - cnd = self.static_value(node.test, deadcode) # + cnd = None # # if cnd is False: # node.deadcode = deadcode # assert endb9fe280619199e07642f4e0d263716394022a3311441d703bf943c3a5115ab40.py000066400000000000000000000000321474076367500313100ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesasync def _ag(): yieldba8bf627448498ff15c46e5e5549e2f2fc2716d45309504753d1dce79842bb0e.py000066400000000000000000000010411474076367500320310ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -341,7 +341,7 @@ # dead_op = True # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.Or): # - dead_op = deadcode # + dead_op = None # for v in node.values: # if self.static_value(v, dead_op) is True: # dead_op = True # def advancePastEmptyBuckets(): return (is_equal or is_equal)baeab95d7182162c404ae9662cf716dba0a7d7c7662266307ae591a273993ea5.py000066400000000000000000000000501474076367500320560ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef func[S, T: Sequence[S]](): pass c069969a742f2faa3f432cb50c36f58a8158cdae7c19ce0536464b3f3e4b1dd9.py000066400000000000000000000001001474076367500323010ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef test_alias_value_01(): type TA1 = int type TA2 = TA1c1a8b67677b66314b60f56743bfa80e17c35cf4f5c4ab2c890c693969db41fdc.py000066400000000000000000000012161474076367500322430ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -102,7 +102,7 @@ # node.__static_value = node.orelse.__static_value # # elif isinstance(node, ast.BoolOp) and isinstance(node.op, ast.And): # - if all(self.static_cnd(n) is True for n in node.values): # + if all(self.static_cnd(n) is not True for n in node.values): # node.__static_value = True # # if any(self.static_cnd(n) is False for n in node.values): # if exc_value and node: pass else: NodeValuec8004683dc7b5fb7ce5fab343696f152cb5a4b39eecfb6bf4a24c0b0847becc1.py000066400000000000000000000010371474076367500326510ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -241,7 +241,7 @@ # # if_is_dead = self.check_stmts(node.body, deadcode or (test_value is False)) # else_is_dead = self.check_stmts( # - node.orelse, deadcode or (test_value is True) # + node.orelse, deadcode and (test_value is True) # ) # # self.walk_deadcode(node.test, deadcode) # if True: pass else: startPosc919aaad611db2ffd30920265f6e811c28825591b226662ebaadc001c3b6c8e6.py000066400000000000000000000007761474076367500322070ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -353,7 +353,7 @@ # # call to the generator function # return # # - if inst_match(("CALL", "CALL_FUNCTION_EX")) and node_match( # + if inst_match(("CALL", "XXCALL_FUNCTION_EXXX")) and node_match( # (ast.ClassDef, ast.Call) # ): # return # create_engine(**kwargs)c9b64c28f424df67919f825adf4f93dfa774463768fc26cd36964121d34e28dd.py000066400000000000000000000011221474076367500321320ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -246,7 +246,7 @@ # # self.walk_deadcode(node.test, deadcode) # # - deadcode = if_is_dead and else_is_dead # + deadcode = None # # elif isinstance(node, ast.Match): # self.walk_deadcode(node.subject, deadcode) # def main(argv: Sequence=None) -> int: with error_handler: if args: return uninstall else: raise NotImplementedError AssertionErrorcaf1bb66048f7170dc753f62f472dbee9caa8f4932d49ac60741a1b7998d4405.py000066400000000000000000000006101474076367500322330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -87,7 +87,7 @@ # "**": ast.Pow, # "*": ast.Mult, # "@": ast.MatMult, # - "//": ast.FloorDiv, # + "XX//XX": ast.FloorDiv, # "/": ast.Div, # "%": ast.Mod, # "+": ast.Add, # max_rows // 2cb33a25d03eeb972e05ef6585afab710a204477850e8b0f9bad0482f9b4364b2.py000066400000000000000000000021331474076367500322050ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -425,7 +425,7 @@ # if inst_match(("BEFORE_WITH","WITH_EXCEPT_START")) and node_match(ast.With): # return # # - if inst_match(("STORE_NAME", "STORE_GLOBAL"), argval="__doc__") and node_match( # + if inst_match(("STORE_NAME", "XXSTORE_GLOBALXX"), argval="__doc__") and node_match( # ast.Constant # ): # # store docstrings # """ The ``codes`` object defines a mapping from common names for HTTP statuses to their numerical codes, accessible either as attributes or as dictionary items. Example:: >>> import requests >>> requests.codes['temporary_redirect'] 307 >>> requests.codes.teapot 418 >>> requests.codes['\\o/'] 200 Some codes have multiple names, and both upper- and lower-case versions of the names are allowed. For example, ``codes.ok``, ``codes.OK``, and ``codes.okay`` all correspond to the HTTP status code 200. """ global __doc__cc6ef858e370019db11a9d07b4e6439b84ae021422241e69addc8a12b5b1a071.py000066400000000000000000000010121474076367500321020ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -535,7 +535,7 @@ # ctx = ast.Load # extra_filter = lambda e: mangled_name(e) == instruction.argval # elif op_name in ( # - "LOAD_NAME", # + "XXLOAD_NAMEXX", # "LOAD_GLOBAL", # "LOAD_FAST", # "LOAD_DEREF", # @__has_required_azure class AzureTest: passd06afcef230a0babce66218961fb7dc171e71ae19f194ebf34e85e3c9501eda7.py000066400000000000000000000012231474076367500325700ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -496,8 +496,7 @@ # if ( # node_match(ast.Name, ctx=ast.Load) # or ( # - node_match(ast.Name, ctx=ast.Store) # - and isinstance(node.parent, ast.AugAssign) # + node_match(ast.Name, ctx=ast.Store) or isinstance(node.parent, ast.AugAssign) # ) # ) and inst_match( # ("LOAD_NAME", "LOAD_FAST", "LOAD_GLOBAL", "LOAD_DEREF"), argval=mangled_name(node) # result += src[start_pos]d6d7ea7eb0c3608d8e642a9f78cce7ac05f00f9615d424cc902606412fff6809.py000066400000000000000000000010151474076367500322350ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -113,7 +113,7 @@ # node.__static_value = False # # if any(self.static_cnd(n) is True for n in node.values): # - node.__static_value = True # + node.__static_value = None # # except AttributeError as e: # if e.name != "_Deadcode__static_value": # if True or type: obj['Filter'] = []d88dbf79f1c03ac9d231408b03584e8396ab41a959edecfde86b82df8ee7c918.py000066400000000000000000000001721474076367500325070ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef test_getsource_on_class_without_firstlineno(): __firstlineno__ = 0 class C: nonlocal __firstlineno__ d964710ed091aede2a79d0aafd4177ab682cca90f4909f9d6a2088110b30cbf3.py000066400000000000000000000010761474076367500323530ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -304,7 +304,7 @@ # elif isinstance(node, (ast.While)): # cnd = self.static_value(node.test, deadcode) # # - self.check_stmts(node.body, deadcode or cnd is False) # + self.check_stmts(node.body, deadcode or cnd is True) # else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # # if cnd is True and not contains_break(node): # while True: noded98e27d8963331b58e4e6b84c7580dafde4d9e2980ad4277ce55e6b186113c1d.py000066400000000000000000000012041474076367500321760ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -175,7 +175,7 @@ # for stmt in node.body: # if isinstance(stmt, ast.ImportFrom): # if stmt.module == "__future__" and any( # - "annotations" == alias.name for alias in stmt.names # + "annotations" != alias.name for alias in stmt.names # ): # self.future_annotations = True # # from __future__ import annotations async def get_message(self) -> Message: passdbe6280977fa2e696702da4231bab0e84973b6b16a22215bf7d4f10d8b160c1b.py000066400000000000000000000007041474076367500321160ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -202,7 +202,7 @@ # self.walk_deadcode(node.msg, deadcode) # deadcode = True # # - elif cnd is True: # + elif cnd is not True: # node.deadcode = deadcode # self.walk_deadcode(node.msg, True) # # assert isinstance, (node,)dc592fb930b28fe2b7181bec5d6f4b871bdd55c01bc22b0623e610eec70df7ab.py000066400000000000000000000000271474076367500325550ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesfrom _datetime import *dcf515466528197be9497b7a599fedb9ad7837e4c66d9356a426ce86c8742123.py000066400000000000000000000001411474076367500320050ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass TypeAliasPickleTest: type ClassLevel = str def test_pickling_local(): passpython-executing-2.2.0/tests/small_samples/deadcode_listcomp.py000066400000000000000000000002351474076367500250620ustar00rootroot00000000000000 [v+1 for v in [] if False] {v+1 for v in [] if False} (v+1 for v in [] if False) {v+1:v+2 for v in [] if False} [v+1 for v in [] if v+5 if False if v+6] python-executing-2.2.0/tests/small_samples/deadcode_string.py000066400000000000000000000001261474076367500245350ustar00rootroot00000000000000 b'\x00' * 10000 if not b'\0' *10000: print(5) if not b'\0' *4000: print(5) e0d5430c6d9ee891b8adb6dc69d571ada7b1da181b905e47bc09bd291b90b3db.py000066400000000000000000000000731474076367500325720ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass SupportsAbs[T]: def __abs__() -> T: passe463c913f286b9b53abcb9cca02fa76b9d85c4e100607ed26947a49b42bb0499.py000066400000000000000000000000701474076367500322230ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef __call__(func): async def inner(): funce5c099c5f3fe5e4a9cda029696aed3a678be6909cc5e2a78491fd9f54e88200f.py000066400000000000000000000010441474076367500324330ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -336,7 +336,7 @@ # return isinstance(node, node_type) and all( # isinstance(getattr(node, k), v) # if isinstance(v, type) # - else getattr(node, k) == v # + else getattr(node, k) != v # for k, v in kwargs.items() # ) # # def _trim_arity(func, max_limit=3): del tbe796977fbd5072af21adf19dd5ea5b6dd5e8affb91d39e280718aea2a7736fb9.py000066400000000000000000000007341474076367500326430ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -363,7 +363,7 @@ # ): # return # # - if inst_match("LOAD_NAME", argval="__annotations__") and node_match( # + if inst_match("XXLOAD_NAMEXX", argval="__annotations__") and node_match( # ast.AnnAssign # ): # return # data: NestedDicte7b78c6892baf1b134f78b3ba897ee6592b11358c9e0962880526cd44c4e258d.py000066400000000000000000000007141474076367500320450ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -558,7 +558,7 @@ # node_ctx = getattr(node, "ctx", None) # # ctx_match = ( # - ctx is not type(None) # + ctx is type(None) # or not hasattr(node, "ctx") # or isinstance(node_ctx, ctx) # ) # self.step_count += 1e8a94f0a994ea84627b7cbc9132cf519ccaa6d756f8cb3458cf019e672a510a4.py000066400000000000000000000013011474076367500323120ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -219,7 +219,7 @@ # if isinstance(n, ast.Compare) and len(n.ops) > 1 # ] # # - assert_(comparisons, "expected at least one comparison") # + assert_(comparisons, "XXexpected at least one comparisonXX") # # if len(comparisons) == 1: # node = self.result = cast(EnhancedAST, comparisons[0]) # def _get_windows_argv(): try: argv = [argv_unicode[i] for i in range(0, argc.value)] finally: del argv_unicodee920a2f2a7dd13d874987bed61fd5e18b8a63c9e838c24f6ad0aa08d3391bf04.py000066400000000000000000000005471474076367500323770ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -95,7 +95,7 @@ # "<<": ast.LShift, # ">>": ast.RShift, # "&": ast.BitAnd, # - "^": ast.BitXor, # + "XX^XX": ast.BitXor, # "|": ast.BitOr, # } # # other ^ selfea94f24a1d9b57c7a7d62c428082790caae2fa16429db2e58b2f4addb67a1964.py000066400000000000000000000014111474076367500323600ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -414,7 +414,7 @@ # return # # if ( # - inst_match(("STORE_NAME", "STORE_FAST", "STORE_DEREF", "STORE_GLOBAL")) # + inst_match(("STORE_NAME", "STORE_FAST", "XXSTORE_DEREFXX", "STORE_GLOBAL")) # and node_match((ast.Import, ast.ImportFrom)) # and any(mangled_name(cast(EnhancedAST, alias)) == instruction.argval for alias in cast(ast.Import, node).names) # ): # def read_source_file(filename): from lib2to3.pgen2.tokenize import cookie_re with open_with_encoding_check as f: [cookie_re for i, line in enumerate]python-executing-2.2.0/tests/small_samples/except_cleanup.py000066400000000000000000000001461474076367500244200ustar00rootroot00000000000000 try: pass except KeyError as err: del err try: pass except KeyError as err: err = 5 f09192915e250c0e1630b5d9add1328874fcb799cc508db1d7b6a880b2d0acea.py000066400000000000000000000000401474076367500322640ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesassert self is None or frame, ()f4486595a4c229797a00be326b58743a5a386e343d70c54d451de212f97a7a8b.py000066400000000000000000000000431474076367500316530ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesdef reveal_type[T]() -> T: passf4962cd6e6b77f4f1d6f676de32f29200067bf3ac05c63e1d60ef2823b4d1b10.py000066400000000000000000000002041474076367500322110ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samplesclass _ProtocolMeta: def __instancecheck__(): ((cls) for attr in _get_protocol_attrs) super().__instancecheck__f533555a1d2d56090b3757364cecf29604df0881e66395fa9533122623793bd9.py000066400000000000000000000006101474076367500314420ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -94,7 +94,7 @@ # "-": ast.Sub, # "<<": ast.LShift, # ">>": ast.RShift, # - "&": ast.BitAnd, # + "XX&XX": ast.BitAnd, # "^": ast.BitXor, # "|": ast.BitOr, # } # future_flags & matching_codef676fbfc99ca7fd38ceb2f4a2ec5edc49fdbc9f47685f14c6fde6239f2bc1590.py000066400000000000000000000010751474076367500330750ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -79,9 +79,7 @@ # # elif isinstance(node, ast.BinOp): # try: # - node.__static_value = self.operator_map[type(node.op)]( # - node.left.__static_value, node.right.__static_value # - ) # + node.__static_value = None # except Exception: # pass # # if options & Diagnostic: ValueErrorfc6eb521024986baa84af2634f638e40af090be4aa70ab3c22f3d022e8068228.py000066400000000000000000000011641474076367500321140ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -468,7 +468,7 @@ # return # # if node_match(ast.Name, ctx=ast.Load) and inst_match( # - ("LOAD_NAME", "LOAD_FAST", "LOAD_GLOBAL"), argval=mangled_name(node) # + ("LOAD_NAME", "XXLOAD_FASTXX", "LOAD_GLOBAL"), argval=mangled_name(node) # ): # return # # class TestMangling: def test(self): try: raise Exception(10) except Exception as __e: __efe0fdfd09575f3cc013c0bc30a257104d3219a00fd6f777303ca17401f09ad9d.py000066400000000000000000000011071474076367500321610ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- tests/deadcode.py # +++ tests/deadcode.py # @@ -304,7 +304,7 @@ # elif isinstance(node, (ast.While)): # cnd = self.static_value(node.test, deadcode) # # - self.check_stmts(node.body, deadcode or cnd is False) # + self.check_stmts(node.body, deadcode or cnd is not False) # else_is_dead = self.check_stmts(node.orelse, deadcode or cnd is True) # # if cnd is True and not contains_break(node): # while context: frameff54d68f6c5751c3d7316722b049b34801c6e28b67bb8338490b4fee32c3e4c5.py000066400000000000000000000010331474076367500320140ustar00rootroot00000000000000python-executing-2.2.0/tests/small_samples# This sample was generated for the following code mutation detected by mutmut: # # --- executing/_position_node_finder.py # +++ executing/_position_node_finder.py # @@ -464,7 +464,7 @@ # # and/or short circuit # return # # - if inst_match("DELETE_SUBSCR") and node_match(ast.Subscript, ctx=ast.Del): # + if inst_match("XXDELETE_SUBSCRXX") and node_match(ast.Subscript, ctx=ast.Del): # return # # if node_match(ast.Name, ctx=ast.Load) and inst_match( # del tracer[frame]python-executing-2.2.0/tests/small_samples/load_deref.py000066400000000000000000000011361474076367500235050ustar00rootroot00000000000000# VerifierFailure: # ast.Name is not created from LOAD_DEREF # instruction: Instruction(opname='LOAD_DEREF', opcode=137, arg=2, argval='_TVMScriptParser__convert_index', argrepr='_TVMScriptParser__convert_index', offset=12, starts_line=None, is_jump_target=False, positions=Positions(lineno=22, end_lineno=22, col_offset=9, end_col_offset=24)) # node: Name(id='__convert_index', ctx=Load(), lineno=22, col_offset=9, end_lineno=22, end_col_offset=24) class TVMScriptParser: def transform_SubscriptAssign(): def __convert_index(): pass [__convert_index for x in indexes] python-executing-2.2.0/tests/test_ipython.py000066400000000000000000000015271474076367500213220ustar00rootroot00000000000000import subprocess as sp import sys import pytest def run(input): p = sp.run( [sys.executable, "-m", "IPython", "--colors=nocolor", "--simple-prompt"], input=input.encode("utf8"), stdout=sp.PIPE, ) output = p.stdout.decode("utf8") print(output) return output test_function_code = """ from executing import Source import inspect import ast def test(): frame = inspect.currentframe() ex = Source.executing(frame.f_back) print(ex.node) if not isinstance(ex.node,ast.Call): print("test failure") if not ex.node.func.id=="test": print("test failure") """ def test_one_lookup(): p = run(test_function_code + "test()") assert "test failure" not in p def test_two_statement_lookups(): p = run(test_function_code + "test();test()") assert "test failure" in p python-executing-2.2.0/tests/test_main.py000066400000000000000000001462231474076367500205570ustar00rootroot00000000000000# -*- coding: utf-8 -*- from __future__ import print_function, division import ast import contextlib import dis import inspect import json import os import re import sys import tempfile import time import types import unittest from collections import defaultdict, namedtuple from random import shuffle import pytest sys.path.append(os.path.dirname(os.path.dirname(__file__))) from .utils import tester, subscript_item, in_finally, start_position, end_position PYPY = 'pypy' in sys.version.lower() from executing import Source, only, NotOneValueFound from executing.executing import NodeFinder, get_instructions, function_node_types from executing._exceptions import VerifierFailure, KnownIssue from tests.deadcode import is_deadcode if eval("0"): global_never_defined = 1 if sys.version_info[:2] == (3, 9): # https://github.com/alexmojaki/executing/pull/71#issuecomment-1723634310 import asttokens.util asttokens.util.fstring_positions_work = lambda: True def calling_expression(): frame = inspect.currentframe().f_back.f_back return Source.executing(frame).node def ast_dump(*args, **kwargs): if sys.version_info < (3, 9): del kwargs["indent"] return ast.dump(*args, **kwargs) class TestStuff(unittest.TestCase): # noinspection PyTrailingSemicolon def test_semicolons(self): # @formatter:off tester(1); tester(2); tester(3) tester(9 ); tester( 8); tester( 99 ); tester(33); tester([4, 5, 6, [ 7]]) # @formatter:on def test_decorator(self): @empty_decorator # 0 @decorator_with_args(tester('123'), x=int()) # 1 @tester(list(tuple([1, 2]))) # 2! @tester( # 3! list( tuple( [3, 4])), ) @empty_decorator # 4 @decorator_with_args( # 5 str(), x=int()) @tester(list(tuple([5, 6]))) # 6! @tester(list(tuple([7, 8]))) # 7! @empty_decorator @decorator_with_args(tester('sdf'), x=tester('123234')) def foo(): pass tester.check_decorators([7, 6, 3, 2]) empty_decorator.tester = tester @empty_decorator @tester @empty_decorator @tester.qwe @empty_decorator @tester("1") @empty_decorator.tester("2") @empty_decorator def foo2(_=tester("3"), __=tester("4")): pass tester.check_decorators([6, 5, 3, 1]) @tester @empty_decorator @tester.qwe @empty_decorator @tester("11") @empty_decorator.tester("22") @empty_decorator class foo3(tester("5") and list): pass tester.check_decorators([5, 4, 2, 0]) # this checks a spectial case for 3.11 # TODO: format strings are not valid syntax before 3.6. how can it be tested? # TODO: this test fails also for 3.6 3.7 3.8 and 3.9 for unknown reason # # @tester.qwe() # def foo4(log_dir=f"test{tester.attr}"): # pass # tester.check_decorators([0]) class Foo(object): @tester @tester @empty_decorator @tester.qwe @empty_decorator def foo(self): super(Foo, self) class Bar: @tester @empty_decorator @tester.qwe @empty_decorator def bar(self): pass Foo().foo() tester.check_decorators([3, 1, 0, 2, 0]) def not_found_prior_311(self): if sys.version_info >= (3, 11): from contextlib import nullcontext return nullcontext() else: return self.assertRaises(NotOneValueFound) def test_setattr(self): tester.x = 1 tester.y, tester.z = tester.foo, tester.bar = tester.spam = 1, 2 tester.test_set_private_attrs() for tester.a, (tester.b, tester.c) in [(1, (2, 3))]: pass str([None for tester.a, (tester.b, tester.c) in [(1, (2, 3))]]) with self.not_found_prior_311(): tester.a = tester.a = 1 with self.not_found_prior_311(): tester.a, tester.a = 1, 2 def test_setitem(self): tester['x'] = 1 tester[:2] = 3 tester['a'], tester.b = 8, 9 with self.not_found_prior_311(): tester['a'] = tester['b'] = 1 with self.not_found_prior_311(): tester['a'], tester['b'] = 1, 2 def test_comprehensions(self): # Comprehensions can be separated if they contain different names str([{tester(x) for x in [1]}, {tester(y) for y in [1]}]) # or are on different lines str([{tester(x) for x in [1]}, {tester(x) for x in [1]}]) # or are of different types str([{tester(x) for x in [1]}, list(tester(x) for x in [1])]) # but not if everything is the same # noinspection PyTypeChecker if sys.version_info >= (3, 11): str([{tester(x) for x in [1]}, {tester(x) for x in [2]}]) else: with self.assertRaises(NotOneValueFound): str([{tester(x) for x in [1]}, {tester(x) for x in [2]}]) def test_lambda(self): self.assertEqual( (lambda x: (tester(x), tester(x)))(tester(3)), (3, 3), ) (lambda: (lambda: tester(1))())() self.assertEqual( (lambda: [tester(x) for x in tester([1, 2])])(), [1, 2], ) def test_closures_and_nested_comprehensions(self): x = 1 # @formatter:off str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) def foo(): y = 2 str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) def bar(): z = 3 str({tester(a+x): {tester(b+x): {tester(c+x) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+y): {tester(b+y): {tester(c+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y): {tester(b+x+y): {tester(c+x+y) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) str({tester(a+x+y+z): {tester(b+x+y+z): {tester(c+x+y+z) for c in tester([1, 2])} for b in tester([3, 4])} for a in tester([5, 6])}) bar() foo() # @formatter:on def test_indirect_call(self): dict(x=tester)['x'](tester)(3, check_func=False) def test_compound_statements(self): with self.assertRaises(TypeError): try: for _ in tester([1, 2, 3]): while tester(0): pass else: tester(4) else: tester(5) raise ValueError except tester(ValueError): tester(9) raise TypeError finally: tester(10) # PyCharm getting confused somehow? # noinspection PyUnreachableCode str() with self.assertRaises(tester(Exception)): if tester(0): pass elif tester(0): pass elif tester(1 / 0): pass def test_generator(self): def gen(): for x in [1, 2]: yield tester(x) gen2 = (tester(x) for x in tester([1, 2])) assert list(gen()) == list(gen2) == [1, 2] def test_future_import(self): print(1 / 2) tester(4) @pytest.mark.skipif( not os.getenv("EXECUTING_SLOW_TESTS"), reason="These tests are very slow, enable them explicitly", ) def test_many_calls(self): node = None start = time.time() for i in range(5000): new_node = Source.executing(inspect.currentframe()).node if node is None: node = new_node else: self.assertIs(node, new_node) self.assertLess(time.time() - start, 1) @pytest.mark.skipif( not os.getenv("EXECUTING_SLOW_TESTS"), reason="These tests are very slow, enable them explicitly", ) def test_many_source_for_filename_calls(self): source = None start = time.time() for i in range(5000): new_source = Source.for_filename(__file__) if source is None: source = new_source self.assertGreater(len(source.lines), 700) self.assertGreater(len(source.text), 7000) else: self.assertIs(source, new_source) self.assertLess(time.time() - start, 1) def test_decode_source(self): def check(source, encoding, exception=None, matches=True): encoded = source.encode(encoding) if exception: with self.assertRaises(exception): Source.decode_source(encoded) else: decoded = Source.decode_source(encoded) if matches: self.assertEqual(decoded, source) else: self.assertNotEqual(decoded, source) check(u'# coding=utf8\né', 'utf8') check(u'# coding=gbk\né', 'gbk') check(u'# coding=utf8\né', 'gbk', exception=UnicodeDecodeError) check(u'# coding=gbk\né', 'utf8', matches=False) check(u'é', 'utf8') check(u'é', 'gbk', exception=SyntaxError) def test_multiline_strings(self): tester('a') tester(''' ab''') tester(''' abc def ''' ) str([ tester( ''' 123 456 ''' ), tester( ''' 345 456786 ''' ), ]) tester( [ ''' 123 456 ''' ''' 345 456786 ''' , ''' 123 456 ''', ''' 345 456786 ''' ] ) def test_multiple_statements_on_one_line(self): if tester(1): tester(2) for _ in tester([1, 2]): tester(3) def assert_qualname(self, func, qn, check_actual_qualname=True): qualname = Source.for_filename(__file__).code_qualname(func.__code__) self.assertEqual(qn, qualname) if check_actual_qualname: self.assertEqual(qn, func.__qualname__) self.assertTrue(qn.endswith(func.__name__)) def test_qualname(self): self.assert_qualname(C.f, 'C.f') self.assert_qualname(C.D.g, 'C.D.g') self.assert_qualname(f, 'f') self.assert_qualname(f(), 'f..g') self.assert_qualname(C.D.h(), 'C.D.h..i..j') self.assert_qualname(lamb, '') foo = lambda_maker() self.assert_qualname(foo, 'lambda_maker..foo') self.assert_qualname(foo.x, 'lambda_maker..') self.assert_qualname(foo(), 'lambda_maker..foo..') self.assert_qualname(foo()(), 'lambda_maker..foo..', check_actual_qualname=False) def test_extended_arg(self): source = 'tester(6)\n%s\ntester(9)' % list(range(66000)) _, filename = tempfile.mkstemp() code = compile(source, filename, 'exec') with open(filename, 'w') as outfile: outfile.write(source) exec(code) def test_only(self): for n in range(5): gen = (i for i in range(n)) if n == 1: self.assertEqual(only(gen), 0) else: with self.assertRaises(NotOneValueFound): only(gen) def test_invalid_python(self): path = os.path.join(os.path.dirname(__file__), 'not_code.txt', ) source = Source.for_filename(path) self.assertIsNone(source.tree) def test_executing_methods(self): frame = inspect.currentframe() executing = Source.executing(frame) self.assertEqual(executing.code_qualname(), 'TestStuff.test_executing_methods') text = 'Source.executing(frame)' self.assertEqual(executing.text(), text) start, end = executing.text_range() self.assertEqual(executing.source.text[start:end], text) def test_attr(self): c = C() c.x = c.y = tester str((c.x.x, c.x.y, c.y.x, c.y.y, c.x.asd, c.y.qwe)) def test_store_attr_multiline(self): if sys.version_info >= (3,11): tester.x \ .y = 1 tester.x. \ y = 2 tester \ .x.y = 3 tester. \ x.y = 4 tester \ . \ x \ . \ y \ = \ 4 tester \ . \ x \ . \ y \ = \ 4 (tester . x . y ) = 4 def test_del_attr_multiline(self): if sys.version_info >= (3,11): del tester.x \ .y del tester.x. \ y del tester \ .x.y del tester. \ x.y def test_method_call_multiline(self): if sys.version_info >= (3,11): tester.method( tester, ).other_method( 5 ) tester.a().b()\ .c().d()\ .e(tester.x1().x2() .y1() .y2()).foo.bar.spam() assert 5== tester.a\ (tester).\ b(5) def test_call_things(self): # call things which are no methods or functions if sys.version_info >= (3,11): tester[5](5) tester.some[5](5) (tester+tester)(2) tester(tester)(5) tester.some(tester)(5) def test_traceback(self): try: 134895 / 0 except: tb = sys.exc_info()[2] ex = Source.executing(tb) self.assertTrue(isinstance(ex.node, ast.BinOp)) self.assertEqual(ex.text(), "134895 / 0") def test_retry_cache(self): _, filename = tempfile.mkstemp() def check(x): source = 'tester(6)\n%s\ntester(9)' % list(range(x)) code = compile(source, filename, 'exec') with open(filename, 'w') as outfile: outfile.write(source) exec(code, globals(), locals()) check(3) check(5) @contextlib.contextmanager def assert_name_error(self): try: yield except NameError as e: tb = sys.exc_info()[2] ex = Source.executing(tb.tb_next) self.assertEqual(type(ex.node), ast.Name) self.assertIn(ex.node.id, str(e)) self.assertEqual(ex.text(), ex.node.id) else: self.fail("NameError not raised") def test_names(self): with self.assert_name_error(): self, completely_nonexistent # noqa with self.assert_name_error(): self, global_never_defined # noqa with self.assert_name_error(): self, local_not_defined_yet # noqa local_not_defined_yet = 1 # noqa def foo(): with self.assert_name_error(): self, closure_not_defined_yet # noqa foo() closure_not_defined_yet = 1 # noqa def test_with(self): if sys.version_info >= (3, 11): with tester: pass with tester as a, tester() as b, tester.tester() as c: a(b(c())) def test_listcomp(self): if (3, 11) <= sys.version_info < (3, 12): # ListComp is inlined in 3.12 result = [calling_expression() for e in [1]] self.assertIsInstance(result[0], ast.ListComp) def test_iter(self): class iter_test: def __init__(self, typ): self.typ = typ self.it = iter([1, 2]) def __iter__(self): assert isinstance(calling_expression(), self.typ) return self def __next__(self): assert isinstance(calling_expression(), self.typ) return next(self.it) assert list(iter_test(ast.Call)) == [1, 2] assert next(iter(iter_test(ast.Call))) == 1 if sys.version_info >= (3, 11): assert [i for i in iter_test(ast.ListComp)] == [1, 2] assert {i for i in iter_test(ast.SetComp)} == {1, 2} assert {i: i for i in iter_test(ast.DictComp)} == {1: 1, 2: 2} assert list(i for i in iter_test(ast.GeneratorExp)) == [1, 2] assert [i for j in [0] for i in iter_test(ast.ListComp)] == [1, 2] assert {i for j in [0] for i in iter_test(ast.SetComp)} == {1, 2} assert {i: i for j in [0] for i in iter_test(ast.DictComp)} == {1: 1, 2: 2} assert list(i for j in [0] for i in iter_test(ast.GeneratorExp)) == [1, 2] for i in iter_test(ast.For): assert i in (1, 2) def test_decorator_cache_instruction(self): frame = inspect.currentframe() def deco(f): assert f.__name__ == "foo" ex = Source.executing(frame) assert isinstance(ex.node, ast.FunctionDef) assert isinstance(ex.decorator, ast.Name) @deco def foo(): pass def is_unary_not(node): return isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.Not) class TimeOut(Exception): pass def dump_source(source, start, end, context=4, file=None): if file is None: file= sys.stdout print("source code:", file=file) start = max(start.lineno - 5, 0) num = start + 1 for line in source.splitlines()[start : end.lineno + 5]: print("%s: %s" % (str(num).rjust(4), line), file=file) num += 1 def is_annotation(node): if isinstance(node, ast.AnnAssign): return True x = node while hasattr(x, "parent"): # check for annotated function arguments # def foo(i: int) -> int # ^^^ if isinstance(x.parent, ast.arg) and x.parent.annotation == x: return True # check for function return value annotation # def foo() -> int # ^^^ if isinstance(x.parent, ast.FunctionDef) and x.parent.returns == x: return True # annotation itself # a: int = 5 # ^^^ if isinstance(x.parent, ast.AnnAssign) and x.parent.annotation == x: return True # target of an annotation without value # a: int # ^ if ( isinstance(x.parent, ast.AnnAssign) and x.parent.target == x and x.parent.value == None ): return True x = x.parent return False def sample_files(samples): root_dir = os.path.dirname(__file__) samples_dir = os.path.join(root_dir, samples) for filename in os.listdir(samples_dir): full_filename = os.path.join(samples_dir, filename) if filename.endswith(".py"): stem=filename[:-3] else: continue result_filename = ( stem + ("-pypy-" if PYPY else "-py-") + ".".join(map(str, sys.version_info[:2])) + ".json" ) result_filename = os.path.join(root_dir, "sample_results", result_filename) yield pytest.param(full_filename, result_filename, id=filename) @pytest.mark.parametrize( "full_filename,result_filename", list(sample_files("small_samples")) ) @pytest.mark.skipif(sys.version_info<(3,),reason="no 2.7 support") def test_small_samples(full_filename, result_filename): skip_sentinel = [ "load_deref", "4851dc1b626a95e97dbe0c53f96099d165b755dd1bd552c6ca771f7bca6d30f5", "508ccd0dcac13ecee6f0cea939b73ba5319c780ddbb6c496be96fe5614871d4a", "fc6eb521024986baa84af2634f638e40af090be4aa70ab3c22f3d022e8068228", "42a37b8a823eb2e510b967332661afd679c82c60b7177b992a47c16d81117c8a", "206e0609ff0589a0a32422ee902f09156af91746e27157c32c9595d12072f92a", ] skip_annotations = [ "d98e27d8963331b58e4e6b84c7580dafde4d9e2980ad4277ce55e6b186113c1d", "9b3db37076d3c7c76bdfd9badcc70d8047584433e1eea89f45014453d58bbc43", ] if any(s in full_filename for s in skip_sentinel) and sys.version_info < (3, 11): pytest.xfail("SentinelNodeFinder does not find some of the nodes (maybe a bug)") if any(s in full_filename for s in skip_annotations) and sys.version_info < (3, 7): pytest.xfail("no `from __future__ import annotations`") if ( (sys.version_info[:2] == (3, 7)) and "ad8aa993e6ee4eb5ee764d55f2e3fd636a99b2ecb8c5aff2b35fbb78a074ea30" in full_filename ): pytest.xfail("(i async for i in arange) can not be analyzed in 3.7") if ( (sys.version_info[:2] == (3, 5) or PYPY) and "1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc" in full_filename ): pytest.skip("recursion takes to long in 3.5") TestFiles().check_filename(full_filename, check_names=True) @pytest.mark.skipif( not os.getenv("EXECUTING_SLOW_TESTS"), reason="These tests are very slow, enable them explicitly", ) class TestFiles: @pytest.mark.parametrize("full_filename,result_filename", list(sample_files("samples"))) def test_sample_files(self, full_filename, result_filename): self.start_time = time.time() result = self.check_filename(full_filename, check_names=True) if os.getenv('FIX_EXECUTING_TESTS'): with open(result_filename, 'w') as outfile: json.dump(result, outfile, indent=4, sort_keys=True) return else: with open(result_filename, "r") as infile: assert result == json.load(infile) def test_module_files(self): self.start_time = time.time() modules = list(sys.modules.values()) shuffle(modules) for module in modules: try: filename = inspect.getsourcefile(module) except TypeError: continue except AttributeError as error: if str(error)== "'_SixMetaPathImporter' object has no attribute '_path'": # work around for https://github.com/benjaminp/six/issues/376 continue raise if not filename: continue filename = os.path.abspath(filename) if ( # The sentinel actually appearing in code messes things up 'executing' in filename # because of: {t[0] for t in lines2} - {t[0] for t in lines1} or 'pytester.py' in filename # A file that's particularly slow or 'errorcodes.py' in filename # Contains unreachable code which pypy removes or PYPY and ( 'sysconfig.py' in filename or 'pyparsing.py' in filename or 'enum' in filename ) or sys.version_info < (3,11) and ( 'python.py' in filename ) ): continue with open(filename) as source: source_text = source.read() if PYPY and "__debug__" in source_text: continue try: self.check_filename(filename, check_names=False) except TimeOut: print("Time's up") def check_filename(self, filename, check_names): # increase the recursion limit in testing mode, because there are files out there with large ast-nodes # example: tests/small_samples/1656dc52edd2385921104de7bb255ca369713f4b8c034ebeba5cf946058109bc.py sys.setrecursionlimit(3000) try: source = Source.for_filename(filename) except RecursionError: if sys.version_info>=(3,13): # sys.setrecursionlimit has no effect for cpython 3.13 pytest.skip("cpython has a hard recursion limit") else: raise if source.tree is None: # we could not parse this file (maybe wrong python version) print("skip %s"%filename) return print("check %s"%filename) nodes = defaultdict(list) decorators = defaultdict(list) expected_decorators = {} for node in ast.walk(source.tree): if isinstance(node, ( (ast.Name,) * check_names, ast.UnaryOp, ast.BinOp, ast.Subscript, ast.Call, ast.Compare, ast.Attribute )): nodes[node] = [] elif isinstance(node, (ast.ClassDef, function_node_types)): expected_decorators[(node.lineno, node.name)] = node.decorator_list[::-1] decorators[(node.lineno, node.name)] = [] try: code = compile(source.tree, source.filename, "exec", dont_inherit=True) except SyntaxError: # for example: # SyntaxError: 'return' outside function print("skip %s" % filename) return except RecursionError: print("skip %s" % filename) return if sys.version_info < (3, 11): for subcode, qualname in find_qualnames(code): if not qualname.endswith(">"): code_qualname = source.code_qualname(subcode) assert code_qualname == qualname result = list(self.check_code(code, nodes, decorators, check_names=check_names)) if not re.search(r'^\s*if 0(:| and )', source.text, re.MULTILINE): for node, values in nodes.items(): # skip some cases cases if sys.version_info < (3, 11): if is_unary_not(node): continue if sys.version_info >= (3, 6): if is_annotation(node): continue ctx = getattr(node, 'ctx', None) if isinstance(ctx, ast.Store): # Assignment to attributes and subscripts is less magical # but can also fail fairly easily, so we can't guarantee # that every node can be identified with some instruction. continue if isinstance(ctx, (ast.Del, getattr(ast, 'Param', ()))): assert not values, [ast.dump(node), values] continue if isinstance(node, ast.Compare): if sys.version_info >= (3, 10): continue if len(node.ops) > 1: assert not values continue if is_unary_not(node.parent) and isinstance( node.ops[0], (ast.In, ast.Is) ): continue if is_literal(node): continue if isinstance(node,ast.Name) and node.id=="__debug__": continue else: # x (is/is not) None none_comparison = ( isinstance(node, ast.Compare) and len(node.ops) == 1 and isinstance(node.ops[0], (ast.IsNot, ast.Is)) and len(node.comparators) == 1 and isinstance(node.comparators[0], ast.Constant) and node.comparators[0].value == None ) if is_unary_not(node) or none_comparison: # some ast-nodes are transformed into control flow, if it is used at places like `if not a: ...` # There are no bytecode instructions which can be mapped to this ast-node, # because the compiler generates POP_JUMP_FORWARD_IF_TRUE which mapps to the `if` statement. # only code like `a=not b` generates a UNARY_NOT # handles cases like # if not x is None: ... # assert a if cnd else not b first_node = node while is_unary_not(first_node.parent) or ( isinstance(first_node.parent, ast.IfExp) and first_node in (first_node.parent.body, first_node.parent.orelse) ): first_node = first_node.parent if isinstance(first_node.parent,(ast.If,ast.Assert,ast.While,ast.IfExp)) and first_node is first_node.parent.test: continue if isinstance(first_node.parent,(ast.match_case)) and first_node is first_node.parent.guard: continue if isinstance(first_node.parent,(ast.BoolOp,ast.Return)): continue if isinstance(first_node.parent,(ast.comprehension)) and first_node in first_node.parent.ifs: continue if isinstance(first_node.parent,(ast.comprehension)) and first_node in first_node.parent.ifs: continue if ( isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.Not) and isinstance(node.operand, ast.Compare) and len(node.operand.ops) == 1 and isinstance(node.operand.ops[0], (ast.In,ast.Is)) ): # `not a in l` the not becomes part of the comparison continue if is_annotation(node): continue if is_literal(node) and not isinstance(node, ast.Constant): continue if isinstance(node,ast.Name) and node.id=="__debug__": continue if isinstance(node, ast.Compare) and len(node.comparators) > 1: continue if is_pattern(node): continue if ( isinstance(node, ast.BinOp) and isinstance(node.op, ast.Mod) and isinstance(node.left, ast.Constant) and isinstance(node.right, ast.Tuple) and isinstance(node.left.value, str) and re.fullmatch(r"%(-?\d+)?[sr]", node.left.value) ): # "%50s"%(a,) is missing an BUILD_STRING instruction which normally maps to BinOp continue if ( isinstance(node, ast.Name) and isinstance(node.ctx, ast.Store) and node.id == "__classcell__" ): continue if sys.version_info >= (3, 12): if ( isinstance(node, ast.Call) and isinstance(node.func, ast.Name) and node.func.id == "super" ): # super optimization continue if isinstance(node, ast.Name) and isinstance( node.parent, ast.TypeAlias ): # type alias names have no associated bytecode continue if sys.version_info >= (3, 13): if isinstance(node, ast.Name): # STORE_FAST_STORE_FAST is generated from two ast nodes, and can not be mapped back continue if ( isinstance(node, ast.UnaryOp) and isinstance(node.op, ast.Not) and ( isinstance(node.operand, ast.UnaryOp) and isinstance(node.operand.op, ast.Not) or isinstance(node.parent, ast.UnaryOp) and isinstance(node.parent.op, ast.Not) ) ): # `not not x` is optimized to a single TO_BOOL continue # the deadcode check has to be the last check because it is expensive if len(values)==0 and is_deadcode(node): continue if sys.version_info >= (3, 10): correct = len(values) >= 1 elif sys.version_info >= (3, 9) and in_finally(node): correct = len(values) > 1 else: correct = len(values) == 1 if not correct: def p(*args): print(*args, file=sys.stderr) p("node without associated Bytecode") p("in file:", filename) p("correct:", correct) p("len(values):", len(values)) p("values:", values) p("deadcode:", is_deadcode(node)) p() p("ast node:") p(ast_dump(node, indent=4)) parents = [] parent = node while hasattr(parent, "parent"): parent = parent.parent parents.append(parent) p("parents:", parents) if sys.version_info >= (3,8): p( "node range:", "lineno=%s" % node.lineno, "end_lineno=%s" % node.end_lineno, "col_offset=%s" % node.col_offset, "end_col_offset=%s" % node.end_col_offset, ) else: p("line:",node.lineno) dump_source( source.text, start_position(node), end_position(node), file=sys.stderr, ) p() if sys.version_info >= (3, 11): p("all bytecodes in this range:") bc = compile(source.text, filename, "exec") def inspect(bc): first = True for i in dis.get_instructions(bc): if ( i.positions.lineno is not None and i.positions.lineno <= node.end_lineno and node.lineno <= i.positions.end_lineno ): if first: p("block name:", bc.co_name) first = False p(i.positions, i.opname, i.argval) for const in bc.co_consts: if isinstance(const, types.CodeType): inspect(const) inspect(bc) raise AssertionError() return result def check_code(self, code, nodes, decorators, check_names): linestarts = dict(dis.findlinestarts(code)) instructions = list(get_instructions(code)) lineno = None for inst_index, inst in enumerate(instructions): if hasattr(self, "start_time"): if time.time() - self.start_time > 45 * 60: # Avoid travis time limit of 50 minutes raise TimeOut py11 = sys.version_info >= (3, 11) lineno = linestarts.get(inst.offset, lineno) if not ( inst.opname.startswith( ( "BINARY_", "UNARY_", "LOAD_ATTR", "LOAD_METHOD", "LOOKUP_METHOD", "SLICE+", "COMPARE_OP", "CALL_", "IS_OP", "CONTAINS_OP", "STORE_SUBSCR", "STORE_ATTR", "STORE_SLICE", ) + ( "LOAD_NAME", "LOAD_GLOBAL", "LOAD_FAST", "LOAD_DEREF", "LOAD_CLASSDEREF", ) * check_names ) or ( py11 and inst.opname in ( "LOAD_GLOBAL", "LOAD_FROM_DICT_OR_DEREF", "LOAD_SUPER_ATTR", "STORE_ATTR", "DELETE_ATTR", "DELETE_NAME", "DELETE_DEREF", "DELETE_FAST", "DELETE_GLOBAL", "STORE_SUBSCR", "STORE_SLICE", "DELETE_SUBSCR", "STORE_NAME", "STORE_FAST", "STORE_GLOBAL", "STORE_DEREF", "BUILD_STRING", "CALL", ) ) or ( sys.version_info >= (3, 13) and inst.opname in ("STORE_FAST_STORE_FAST", "STORE_FAST_LOAD_FAST") ) ): continue if py11: if ( inst.opname == "LOAD_NAME" and hasattr(inst, "positions") and inst.positions.col_offset == inst.positions.end_col_offset == 0 and inst.argval == "__name__" ): continue if ( inst.opname in ("STORE_NAME", "STORE_DEREF") and hasattr(inst, "positions") and inst.positions.col_offset == inst.positions.end_col_offset == 0 and inst.argval in ("__module__", "__qualname__", "__firstlineno__") ): continue if inst.positions.lineno == None: continue if sys.version_info >= (3,12): if inst.opname == "CALL_INTRINSIC_1" and inst.argrepr=='INTRINSIC_LIST_TO_TUPLE': # convert list to tuple continue frame = C() frame.f_lasti = inst.offset frame.f_code = code frame.f_globals = globals() frame.f_lineno = lineno source = Source.for_frame(frame) node = None try: ex = Source.executing(frame) node = ex.node except KnownIssue: continue except VerifierFailure as e: print("VerifierFailure:") print(e) print("\ninstruction: " + str(e.instruction)) print("\nnode: " + ast.dump(e.node, include_attributes=True)) print("parent node:",type(e.node.parent).__name__) with open(source.filename) as sourcefile: source_code = sourcefile.read() print( dump_source( source_code, start_position(e.node), end_position(e.node) ) ) print("bytecode:") for inst in dis.get_instructions(code): if ( e.instruction.offset - 10 < inst.offset < e.instruction.offset - 10 ): print( "%s: %s %s %s" % ( inst.offset, inst.positions, inst.opname, inst.argrepr, ) ) raise except Exception as e: # continue for every case where this can be an known issue if py11: exact_options = [] for node in ast.walk(source.tree): if not hasattr(node, "lineno"): continue if start_position(node) == start_position( inst ) and end_position(node) == end_position(inst): exact_options.append(node) if inst.opname == "BUILD_STRING": # format strings are still a problem # TODO: find reason continue if any(isinstance(o, ast.JoinedStr) for o in exact_options): # every node in a f-string has the same positions # we are not able to find the correct one continue if ( inst.opname == "STORE_FAST" and inst_index > 2 and instructions[inst_index - 2].opname == "POP_EXCEPT" ): # except cleanup might be mapped to a method # except Exception as e: # self.linter._stashed_messages[ # (self.linter.current_name, "useless-option-value") # ].append((option_string, str(e))) # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # | STORE_NAME is mapped to this range # | and can not be associated with a method, because it is nothing like LOAD_METHOD continue if ( inst.opname == "DELETE_FAST" and inst_index > 3 and instructions[inst_index - 3].opname == "POP_EXCEPT" ): # same like above continue if not py11 and inst.opname.startswith( ("COMPARE_OP", "IS_OP", "CALL", "LOAD_NAME", "STORE_SUBSCR") ): continue # Attributes which appear ambiguously in modules: # op1.sign, op2.sign = (0, 0) # nm_tpl.__annotations__ = nm_tpl.__new__.__annotations__ = types if not py11 and inst.opname == 'STORE_ATTR' and inst.argval in [ 'sign', '__annotations__', '__deprecated__' ]: continue if inst.opname == 'LOAD_FAST' and inst.argval == '.0': continue if inst.argval == "AssertionError": continue if any( isinstance(stmt, (ast.AugAssign, ast.Import)) for stmt in source.statements_at_line(lineno) ): continue if ( sys.version_info >= (3, 12) and inst.positions.col_offset == inst.positions.end_col_offset == 0 and inst.argval in ("__type_params__", ".type_params", "__classdict__") ): continue if (sys.version_info>=(3,13) and inst.opname=="STORE_NAME" and inst.argval in ("__firstlineno__","__static_attributes__")): continue # report more information for debugging print("mapping failed") print(e) if isinstance(e, NotOneValueFound): for value in e.values: print( "value:", ast_dump(value, indent=4, include_attributes=True) ) print("search bytecode", inst) print("in file", source.filename) if py11: print("at position", inst.positions) with open(source.filename) as sourcefile: source_code = sourcefile.read() dump_source( source_code, start_position(inst), end_position(inst) ) options = [] for node in ast.walk(ast.parse(source_code)): if not hasattr(node, "lineno"): continue # if {start_position(node), end_position(node)} & {start_position(inst), end_position(inst)}: if start_position(node) <= end_position( inst ) and start_position(inst) <= end_position(node): options.append(node) for node in sorted( options, key=lambda node: ( node.end_lineno - node.lineno, node.end_col_offset - node.col_offset, ), ): if (node.end_lineno - node.lineno) > ( inst.positions.end_lineno - inst.positions.lineno ) * 4: # skip nodes which are way to long continue print() print( "possible node", node.lineno, node.end_lineno, node.col_offset, node.end_col_offset, ast.dump(node), ) raise # `argval` isn't set for all relevant instructions in python 2 # The relation between `ast.Name` and `argval` is already # covered by the verifier and much more complex in python 3.11 if isinstance(node, ast.Name) and not py11: assert inst.argval == node.id, (inst, ast.dump(node)) if ex.decorator: decorators[(node.lineno, node.name)].append(ex.decorator) else: nodes[node].append((inst, frame.__dict__)) yield [inst.opname, node_string(source, ex.decorator or node)] # do not use code.co_consts because they can contain deadcode https://github.com/python/cpython/issues/96833 for inst in instructions: if isinstance(inst.argval, type(code)): for x in self.check_code(inst.argval, nodes, decorators, check_names=check_names): yield x def node_string(source, node): return source._asttext_base().get_text(node) def is_literal(node): if isinstance(node, ast.UnaryOp): return is_literal(node.operand) if isinstance(node, ast.BinOp): return is_literal(node.left) and is_literal(node.right) if isinstance(node, ast.Compare): return all(map(is_literal, [node.left] + node.comparators)) if isinstance(node, ast.Subscript) and is_literal(node.value): if isinstance(node.slice, ast.Slice): return all( x is None or is_literal(x) for x in [ node.slice.lower, node.slice.upper, node.slice.step, ] ) else: return is_literal(subscript_item(node)) if isinstance(node,ast.Tuple): # pub_fields=(b"x" * 32,) * 2, # generates on const element in the bytecode return all(is_literal(e) for e in node.elts) try: ast.literal_eval(node) return True except ValueError: return False def is_pattern(node): while not isinstance(node, ast.pattern): if hasattr(node, "parent"): node = node.parent else: return False return True class C(object): @staticmethod def f(): pass class D(object): @staticmethod def g(): pass @staticmethod def h(): def i(): def j(): pass return j return i() def f(): def g(): pass return g # TestFiles().test_files() def lambda_maker(): def assign(x): def decorator(func): func.x = x return func return decorator @assign(lambda: 1) def foo(): return lambda: lambda: 3 return foo lamb = lambda: 0 def test_global_tester_calls(): # tester calls should be tested at global scope from . import global_tester_calls def empty_decorator(func): return func def decorator_with_args(*_, **__): return empty_decorator def find_qualnames(code, prefix=""): for subcode in code.co_consts: if type(subcode) != type(code): continue qualname = prefix + subcode.co_name instructions = list(get_instructions(subcode))[:4] opnames = [inst.opname for inst in instructions] arg_reprs = [inst.argrepr for inst in instructions] is_class = ( opnames == "LOAD_NAME STORE_NAME LOAD_CONST STORE_NAME".split() and arg_reprs == ["__name__", "__module__", repr(qualname), "__qualname__"] ) yield subcode, qualname for x in find_qualnames( subcode, qualname + ("." if is_class else "..") ): yield x if __name__ == '__main__': unittest.main() python-executing-2.2.0/tests/test_pytest.py000066400000000000000000000311011474076367500211470ustar00rootroot00000000000000import ast import inspect import linecache import os import sys from time import sleep import asttokens from executing._pytest_utils import is_pytest_compatible import pytest from littleutils import SimpleNamespace import executing.executing from executing import Source, NotOneValueFound from executing._exceptions import KnownIssue from executing.executing import is_ipython_cell_code, attr_names_match, is_rewritten_by_pytest sys.path.append(os.path.dirname(os.path.dirname(__file__))) def test_pytest(): from tests.utils import tester lst = [1, 2, 3] lst2 = tester(lst) assert lst == lst2 lst3 = tester(lst + [4]) assert ( [1, 2, 3, 4] == lst3 ), 'message' x = tester.x assert x is tester def test_ipython_cell_code(): assert is_ipython_cell_code( SimpleNamespace( co_name="", co_filename="tmp/ipykernel_3/foo", ) ) assert not is_ipython_cell_code( SimpleNamespace( co_name="") def check_manual_linecache(filename): text = "foo\nbar\n" lines = text.splitlines(True) assert lines == ["foo\n", "bar\n"] entry = (len(text), 0, lines, filename) linecache.cache[filename] = entry # sanity check assert linecache.cache[filename] == entry assert linecache.getlines(filename) == lines # checkcache normally removes the entry because the filename doesn't exist linecache.checkcache(filename) assert filename not in linecache.cache assert linecache.getlines(filename) == [] # Source.for_filename uses checkcache but makes sure the entry isn't removed linecache.cache[filename] = entry source = Source.for_filename(filename) assert linecache.cache[filename] == entry assert source.text == text def test_exception_catching(): frame = inspect.currentframe() if is_pytest_compatible(): assert isinstance(Source.executing(frame).node,ast.Call) return executing.executing.TESTING = True # this is already the case in all other tests # Sanity check that this operation usually raises an exception. # This actually depends on executing not working in the presence of pytest. with pytest.raises((NotOneValueFound, KnownIssue)): assert Source.executing(frame).node is None # By contrast, TESTING is usually false when executing is used in real code. # In that case, the exception is caught and the result is None. executing.executing.TESTING = False try: assert Source.executing(frame).node is None finally: executing.executing.TESTING = True def test_bad_linecache(): # Test graceful failure when linecache contains source lines that don't match # the real code being executed. fake_text = "foo bar baz" # invalid syntax, so source.tree is None text = """ frame = inspect.currentframe() ex = Source.executing(frame) """ filename = "" code = compile(text, filename, "exec") linecache.cache[filename] = (len(fake_text), 0, fake_text.splitlines(True), filename) globs = dict(globals()) exec(code, globs) ex = globs["ex"] frame = globs["frame"] assert ex.node is None assert ex.statements is None assert ex.decorator is None assert ex.frame is frame assert ex.source.tree is None assert ex.source.text == fake_text if sys.version_info >= (3, 11): from executing._position_node_finder import mangled_name from textwrap import indent import dis def test_mangled_name(): def result(*code_levels): code = "" for i, level in enumerate(code_levels): code += indent(level, " " * i) + "\n" tree = ast.parse(code) for parent in ast.walk(tree): for child in ast.iter_child_nodes(parent): child.parent = parent tree_names = { mangled_name(n) for n in ast.walk(tree) if isinstance( n, ( ast.Name, ast.Attribute, ast.alias, ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef, ast.ExceptHandler, ), ) } def collect_names(code): for instruction in dis.get_instructions(code): if instruction.opname in ( "STORE_NAME", "LOAD_NAME", "LOAD_GLOBAL", "STORE_FAST", "LOAD_FAST", "LOAD_ATTR", "STORE_ATTR", ): # TODO: "IMPORT_FROM" gets also mangled but is currently not handled by executing # # class Test: # from __mangle11c.__suc11c import __submodule11c as __subc11 # IMPORT_FROM(_Test__submodule11c) # STORE_NAME(_Test__subc11) name = instruction.argval if name in ("__module__", "__qualname__", "__name__","__static_attributes__","__firstlineno__"): continue yield name for const in code.co_consts: if isinstance(const, type(code)): for name in collect_names(const): yield name code_names = set(collect_names(compile(tree, "", "exec"))) assert code_names == tree_names return tree_names code = "from __mangle11c.__suc11c import __submodule11c as __subc11" assert result(code) == {"__subc11"} assert result("class Test:", code) == {"Test", "_Test__subc11"} assert result("class Test:", "def func():", code) == { "Test", "func", "_Test__subc11", } code = """ import __mangled1.submodule1 import __mangled2.__submodule2 import __mangled3.submodule3 as __sub3 import __mangled4.__submodule4 as __sub4 import __mangled5.__submodule5 as sub5 from __mangled6 import submodule6 from __mangle7.sub7 import submodule7 from __mangle8.__sub8 import submodule8 from __mangle9 import submodule9 from __mangle10.sub10 import submodule10 from __mangle11.__sub11 import submodule11 from __mangled6b import __submodule6b from __mangle7b.sub7b import __submodule7b from __mangle8b.__sub8b import __submodule8b from __mangle9b import __submodule9b from __mangle10b.sub10b import __submodule10b from __mangle11b.__sub11b import __submodule11b from __mangled6c import __submodule6c as __subc6 from __mangle7c.suc7c import __submodule7c as __subc7 from __mangle8c.__suc8c import __submodule8c as __subc8 from __mangle9c import __submodule9c as __subc9 from __mangle10c.suc10c import __submodule10c as __subc10 from __mangle11c.__suc11c import __submodule11c as __subc11 """ assert result("class Test:", "def func():", code) == { "Test", "_Test__mangled1", "_Test__mangled2", "_Test__sub3", "_Test__sub4", "_Test__subc10", "_Test__subc11", "_Test__subc6", "_Test__subc7", "_Test__subc8", "_Test__subc9", "_Test__submodule10b", "_Test__submodule11b", "_Test__submodule6b", "_Test__submodule7b", "_Test__submodule8b", "_Test__submodule9b", "func", "sub5", "submodule10", "submodule11", "submodule6", "submodule7", "submodule8", "submodule9", } code = """ __mangled_var=3 __not_mangled__=5 normal_var=6 q.__attribute try: pass except TypeError as __exception: pass for __var in [1]: pass """ assert result("class Test:", "def func():", code) == { "Test", "TypeError", "_Test__attribute", "_Test__exception", "_Test__mangled_var", "_Test__var", "__not_mangled__", "func", "normal_var", "q", } # different context assert result("class Test:", "def func():", "e.__a=5") == { "Test", "func", "_Test__a", "e", } assert result("class __Test:", "def func():", "e.__a=5") == { "__Test", "func", "_Test__a", "e", } assert result("class __Test:", "e.__a=5") == { "__Test", "_Test__a", "e", } assert result("class __Test_:", "def func():", "e.__a=5") == { "__Test_", "func", "_Test___a", "e", } assert result("class ___Test_:", "def func():", "e.__a=5") == { "___Test_", "func", "_Test___a", "e", } assert result("class __Testa:","class __Testb:" ,"e.__a=5") == { "__Testa", "_Testa__Testb", "_Testb__a", "e", } assert result( "class Test:", "def foo(self):", "class Patched(self.__attr):", "pass", ) == {"Patched", "foo", "self", "Test", "_Test__attr"} assert result( "class _:", "def a(self):", "self.__thing", ) == {"_","a", "self", "__thing"} assert result( "class __:", "def a(self):", "self.__thing", ) == {"__","a", "self", "__thing"} assert result( "class Test:", "class _:", "def a(self):", "self.__thing", ) == {"Test","_","a", "self", "__thing"} def test_pytest_rewrite(): frame = inspect.currentframe() # check for assert statements rewrite caused by this assert assert is_rewritten_by_pytest(frame.f_code) def test_no_pytest_rewrite(): frame=inspect.currentframe() # no assert -> no rewrite if is_rewritten_by_pytest(frame.f_code): raise AssertionError("unexpected pytest assert rewrite") def test_no_pytest_rewrite_with_consts(): frame = inspect.currentframe() # LOAD_CONST "@py_assert..." should not trigger a false positive a = "@py_assert..." # no assert -> no rewrite if is_rewritten_by_pytest(frame.f_code): raise AssertionError("unexpected pytest assert rewrite") def test_asttext(): source = Source("file.py", ["a", "b"]) assert source._asttext is None assert source._asttokens is None atext = source.asttext() assert atext is source.asttext() is source._asttext is not None assert source._asttokens is None atokens = source.asttokens() assert atext.asttokens is atokens is source.asttokens() is source._asttokens is not None python-executing-2.2.0/tests/utils.py000066400000000000000000000140051474076367500177240ustar00rootroot00000000000000import sys import ast import inspect from collections import namedtuple import executing.executing from executing.executing import attr_names_match, Instruction try: from dis import Instruction as DisInstruction except ImportError: DisInstruction = None executing.executing.TESTING = 1 from executing import Source non_existing_argument=object() class Tester(object): def __init__(self): self.decorators = [] self.__name__ = "" # weird pypy3.6 thing def test_set_private_attrs(self): # Test that attributes with leading __ are handled properly, # as Python mangles their names. self.a, self.aa, self._a, self.__a, self.__aa = range(5) def check_decorators(self, expected): assert self.decorators == expected, (self.decorators, expected) self.decorators = [] def get_node(self, typ): ex = self.get_executing(inspect.currentframe().f_back.f_back) node = ex.node assert isinstance(node, typ), (node, typ) return node def get_executing(self, frame): Source.lazycache(frame) return Source.executing(frame) def check(self, node, value): frame = inspect.currentframe().f_back.f_back result = eval( compile(ast.Expression(node), frame.f_code.co_filename, 'eval'), frame.f_globals, frame.f_locals, ) assert result == value, (result, value) def __call__(self, arg=non_existing_argument, check_func=True): ex = self.get_executing(inspect.currentframe().f_back) if ex.decorator: assert {ex.node} == ex.statements self.decorators.append(ex.node.decorator_list.index(ex.decorator)) else: call = ex.node if arg is non_existing_argument: assert len(call.args)==0 else: self.check(call.args[0], arg) if check_func: self.check(call.func, self) if ( isinstance(call.parent, (ast.ClassDef, ast.FunctionDef)) and call in call.parent.decorator_list ): return self if arg is non_existing_argument: return tester else: return arg def __getattr__(self, item): parent_frame=inspect.currentframe().f_back # pytest is accessing tester to check if it is a test function if "_pytest" not in parent_frame.f_code.co_filename: node = self.get_node(ast.Attribute) self.check(node.value, self) assert node.attr == item return self def __getitem__(self, item): node = self.get_node(ast.Subscript) self.check(node.value, self) self.check(subscript_item(node), item) return self def __setattr__(self, name, value): if name in ('decorators', '__name__'): super(Tester, self).__setattr__(name, value) return node = self.get_node(ast.Attribute) self.check(node.value, self) if node.attr.startswith('__'): # Account for Python's name mangling of private attributes. assert name == "_{self.__class__.__name__}{node.attr}".format(self=self, node=node) else: assert name == node.attr assert attr_names_match(node.attr, name) return self def __delattr__(self, name): node = self.get_node(ast.Attribute) assert isinstance(node.ctx, ast.Del) assert node.attr == name def __setitem__(self, key, value): node = self.get_node(ast.Subscript) self.check(node.value, self) if not isinstance(key, slice): self.check(subscript_item(node), key) return self def __add__(self, other): node = self.get_node(ast.BinOp) self.check(node.left, self) self.check(node.right, other) return self __pow__ = __mul__ = __sub__ = __add__ def __invert__(self): node = self.get_node(ast.UnaryOp) self.check(node.operand, self) return self __neg__ = __pos__ = __invert__ def __lt__(self, other): node = self.get_node(ast.Compare) self.check(node.left, self) self.check(node.comparators[0], other) return self __ne__ = __ge__ = __lt__ def __bool__(self): if sys.version_info >= (3, 11): self.get_node(ast.BoolOp) return False else: try: self.get_node(None) except RuntimeError: return False assert 0 def __enter__(self): self.get_node(ast.With) return self def __exit__(self, exc_typ, exc_value, exc_traceback): self.get_node(ast.With) __nonzero__ = __bool__ tester = Tester() def subscript_item(node): if sys.version_info < (3, 9): return node.slice.value else: return node.slice def in_finally(node): while hasattr(node, 'parent'): if isinstance(node.parent, ast.Try) and node in node.parent.finalbody: return True node = node.parent return False SourcePosition = namedtuple("SourcePosition", ["lineno", "col_offset"]) def start_position(obj): """ returns the start source position as a (lineno,col_offset) tuple. obj can be ast.AST or Instruction. """ if isinstance(obj, Instruction) or (DisInstruction is not None and isinstance(obj, DisInstruction)): obj = obj.positions if isinstance(obj,ast.Module): obj=obj.body[0] return SourcePosition(obj.lineno, obj.col_offset) def end_position(obj): """ returns the end source position as a (lineno,col_offset) tuple. obj can be ast.AST or Instruction. """ if sys.version_info < (3, 8): return start_position(obj) if isinstance(obj, Instruction) or (DisInstruction is not None and isinstance(obj, DisInstruction)): obj = obj.positions if isinstance(obj,ast.Module): obj=obj.body[-1] return SourcePosition(obj.end_lineno, obj.end_col_offset) python-executing-2.2.0/tox.ini000066400000000000000000000015271474076367500163700ustar00rootroot00000000000000[tox] envlist = {mypy-,}{py38,py39,py310,py311},py312,py313-dev,pypy35,pypy36 [testenv] commands = pytest tests {posargs} extras = tests passenv = FIX_EXECUTING_TESTS ADD_EXECUTING_TESTS EXECUTING_SLOW_TESTS [testenv:generate_small_sample-py{38,39,310,311,312,313-dev}] extras = tests deps = pysource-minimize commands = python -m tests.generate_small_sample {posargs} passenv = MUTMUT_HEADER [testenv:mutmut] # mutmut had problems on other python versions # that is the reason it runs in its own environment basepython=python3.10 deps= mutmut commands= python tests/mutmut_workflow.py [testenv:mypy-py{35,36,37,38,39,310}] deps= mypy==0.910 commands= python -m mypy executing --exclude=executing/_position_node_finder.py [testenv:mypy-py{311}] deps= mypy==0.971 commands= python -m mypy executing