Module Expr Str ImportFrom alias alias alias alias Import alias Import alias Import alias Import alias Import alias Import alias Import alias ImportFrom alias alias alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias TryExcept body TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias handlers ExceptHandler type NameLoad body If CompareNotIn Str AttributeLoad NameLoad attr body Raise Assign NameStore NameLoad TryExcept body TryExcept body ImportFrom alias identifier handlers ExceptHandler type NameLoad body ImportFrom alias identifier TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body ImportFrom alias handlers ExceptHandler type NameLoad body If CompareNotIn Str AttributeLoad NameLoad attr body Raise ImportFrom alias FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list If NameLoad body Import alias orelse Import alias identifier ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Expr Str decorator_list FunctionDef arguments args NameParam defaults body TryExcept body Return AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass TryExcept body Return SubscriptLoad AttributeLoad NameLoad attr Index Num handlers ExceptHandler type TupleLoad NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad keyword NameLoad FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call NameLoad NameLoad NameLoad FunctionDef arguments args NameParam defaults body If CompareIsNot Call AttributeLoad NameLoad attr NameLoad body Raise Call NameLoad BinOpMod Str TupleLoad Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Return Call NameLoad NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args defaults vararg kwarg body Assign NameStore Call NameLoad If BoolOpAnd NameLoad CompareIn Str NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Lambda arguments args NameParam defaults Call NameLoad Call AttributeLoad NameLoad attr TryExcept body Assign NameStore Call NameLoad NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Return NameLoad orelse If Call NameLoad NameLoad NameLoad body TryExcept body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call NameLoad NameLoad If CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad ExceptHandler type NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr orelse Expr Call NameLoad NameLoad NameLoad NameLoad TryFinally body Return NameLoad finalbody Assign NameStore NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr TupleLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults vararg kwarg body If BoolOpAnd NameLoad NameLoad body Raise Call NameLoad Str If NameLoad body Assign AttributeStore NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr Call NameLoad GeneratorExp TupleLoad NameLoad NameLoad comprehension TupleStore NameStore NameStore Call NameLoad NameLoad Assign NameStore NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad Assign AttributeStore NameLoad attr AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call NameLoad If AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call NameLoad NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Raise Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body If Call AttributeLoad NameLoad attr body Raise Call Call NameLoad NameLoad Str Return Call AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Raise Call NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return Call NameLoad GeneratorExp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Return ListComp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad comprehension NameStore AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults vararg kwarg body Expr Str Assign NameStore Call NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body If Call AttributeLoad NameLoad attr body Return NameLoad Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If Call AttributeLoad NameLoad attr body Return Expr Call AttributeLoad NameLoad attr NameLoad decorator_list With Call AttributeLoad NameLoad attr NameLoad body Expr Call NameLoad keyword Call NameLoad NameLoad NameLoad NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BoolOpOr NameLoad Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr attr orelse Return Call AttributeLoad NameLoad attr decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Return Call NameLoad GeneratorExp Call NameLoad NameLoad NameLoad comprehension NameStore Call AttributeLoad NameLoad attr If Call NameLoad NameLoad NameLoad body Return Call NameLoad GeneratorExp Call NameLoad NameLoad NameLoad comprehension NameStore NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults TupleLoad body Expr Str If Call NameLoad NameLoad body Return Call NameLoad NameLoad keyword NameLoad orelse Return Call NameLoad NameLoad keyword NameLoad decorator_list Assign NameStore NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults TupleLoad body Assign AttributeStore NameLoad attr NameLoad If Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr ListLoad For NameStore NameLoad body If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assert Call NameLoad GeneratorExp Call NameLoad NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body For NameStore AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return UnaryOpNot AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore ListLoad Assign NameStore NameLoad For NameStore AttributeLoad NameLoad attr body TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse If UnaryOpNot Call NameLoad NameLoad AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr Str keyword NameLoad If CompareIsNot NameLoad NameLoad body Expr Call NameLoad NameLoad If CompareIsNot AttributeLoad NameLoad attr NameLoad body Return Call NameLoad Call NameLoad AttributeLoad NameLoad attr NameLoad orelse Return Call NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults TupleLoad body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore NameLoad Assign NameStore Call NameLoad Call NameLoad NameLoad NameLoad Assert Call NameLoad GeneratorExp Call NameLoad NameLoad comprehension NameStore NameLoad Assign NameStore Call NameLoad NameLoad Assign NameStore Call NameLoad If UnaryOpNot NameLoad body Expr Call AttributeLoad NameLoad attr IfExp CompareIsNot NameLoad NameLoad Dict ListLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign NameStore ListLoad For NameStore NameLoad body TryExcept body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If Call AttributeLoad NameLoad attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str keyword NameLoad orelse Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr body If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Call NameLoad Call NameLoad NameLoad NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call NameLoad For NameStore NameLoad body If CompareNotIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad body Return NameLoad orelse Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad TupleLoad body Expr Str Assign NameStore Call NameLoad Expr Call NameLoad NameLoad NameLoad If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam defaults body TryExcept body Expr Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad name NameStore body If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad keyword NameLoad decorator_list FunctionDef arguments args defaults body Expr Call AttributeLoad NameLoad attr Call NameLoad Str Expr Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad orelse Expr Call AttributeLoad NameLoad attr NameLoad Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Expr Call AttributeLoad Call AttributeLoad NameLoad attr attr NameLoad Lambda arguments args defaults Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list Assign NameStore Call NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Assign AttributeStore NameLoad attr Str Expr Call AttributeLoad NameLoad attr NameLoad ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad If Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Dict If CompareIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpOr CompareIs AttributeLoad NameLoad attr NameLoad CompareNotIn NameLoad AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str TupleLoad NameLoad Return CompareIn NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad If BoolOpAnd CompareIsNot AttributeLoad NameLoad attr NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr body TryExcept body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr handlers ExceptHandler body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return TryFinally body Assign AttributeStore NameLoad attr NameLoad While NameLoad body Assign NameStore AttributeLoad NameLoad attr If UnaryOpNot Call AttributeLoad NameLoad attr body Return Assign AttributeStore NameLoad attr NameLoad TryExcept body Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Str handlers ExceptHandler type TupleLoad NameLoad NameLoad name NameStore body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Raise Call NameLoad BinOpMod Str AttributeLoad NameLoad attr Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Return If UnaryOpNot Call AttributeLoad NameLoad attr NameLoad body Return finalbody Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad If Call NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr Call NameLoad FunctionDef arguments args defaults body TryExcept body Expr Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad NameLoad attr body Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list If CompareIs AttributeLoad NameLoad attr NameLoad body With Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameStore body Assign AttributeStore NameLoad attr NameLoad FunctionDef arguments args defaults body Expr Call NameLoad Expr Call AttributeLoad NameLoad attr decorator_list Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return NameLoad orelse Expr Call NameLoad orelse TryExcept body Assign AttributeStore NameLoad attr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr If BoolOpOr UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Lambda arguments args NameParam defaults Call AttributeLoad NameLoad attr Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Return NameLoad orelse Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad decorator_list decorator_list Assign NameStore Call AttributeLoad NameLoad attr Str ListLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args defaults vararg kwarg body If BoolOpOr NameLoad CompareGt Call NameLoad NameLoad Num body Expr Call NameLoad Call NameLoad NameLoad NameLoad orelse If NameLoad body Expr Call NameLoad SubscriptLoad NameLoad Index Num orelse Expr Call NameLoad NameLoad decorator_list Return NameLoad decorator_list If CompareGtE AttributeLoad NameLoad attr TupleLoad Num Num body Exec Call AttributeLoad NameLoad attr Str orelse FunctionDef arguments args NameParam defaults body If Call NameLoad NameLoad Str body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad NameLoad TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad orelse While Num body TryExcept body Assign NameStore Yield NameLoad handlers ExceptHandler type NameLoad name NameStore body TryExcept body Assign NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Pass orelse Expr Call NameLoad Raise NameLoad ExceptHandler type NameLoad name NameStore body Assign NameStore Call AttributeLoad NameLoad attr TryExcept body Assign NameStore AttributeLoad NameLoad attr handlers ExceptHandler type NameLoad body Raise NameLoad orelse TryExcept body Assign NameStore Call NameLoad NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad Break orelse TryExcept body If CompareIs NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad name NameStore body Assign NameStore Call NameLoad NameLoad Break Raise Call NameLoad NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad TupleLoad NameLoad NameLoad body Return Call NameLoad NameLoad orelse If Call NameLoad NameLoad body Return NameLoad orelse If Call NameLoad NameLoad body Return Call NameLoad NameLoad orelse Raise Call NameLoad BinOpMod Str TupleLoad NameLoad decorator_list If CompareIsNot NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad TryExcept body Import alias handlers ExceptHandler type NameLoad body Pass orelse Expr NameLoad
N/A N/A ``tornado.gen`` is a generator-based interface to make it easier to
work in an asynchronous environment.  Code using the ``gen`` module
is technically asynchronous, but it is written as a single generator
instead of a collection of separate functions.

For example, the following asynchronous handler:

.. testcode::

    class AsyncHandler(RequestHandler):
        @asynchronous
        def get(self):
            http_client = AsyncHTTPClient()
            http_client.fetch("http://example.com",
                              callback=self.on_fetch)

        def on_fetch(self, response):
            do_something_with_response(response)
            self.render("template.html")

.. testoutput::
   :hide:

could be written with ``gen`` as:

.. testcode::

    class GenAsyncHandler(RequestHandler):
        @gen.coroutine
        def get(self):
            http_client = AsyncHTTPClient()
            response = yield http_client.fetch("http://example.com")
            do_something_with_response(response)
            self.render("template.html")

.. testoutput::
   :hide:

Most asynchronous functions in Tornado return a `.Future`;
yielding this object returns its `~.Future.result`.

You can also yield a list or dict of ``Futures``, which will be
started at the same time and run in parallel; a list or dict of results will
be returned when they are all finished:

.. testcode::

    @gen.coroutine
    def get(self):
        http_client = AsyncHTTPClient()
        response1, response2 = yield [http_client.fetch(url1),
                                      http_client.fetch(url2)]
        response_dict = yield dict(response3=http_client.fetch(url3),
                                   response4=http_client.fetch(url4))
        response3 = response_dict['response3']
        response4 = response_dict['response4']

.. testoutput::
   :hide:

If the `~functools.singledispatch` library is available (standard in
Python 3.4, available via the `singledispatch
<https://pypi.python.org/pypi/singledispatch>`_ package on older
versions), additional types of objects may be yielded. Tornado includes
support for ``asyncio.Future`` and Twisted's ``Deferred`` class when
``tornado.platform.asyncio`` and ``tornado.platform.twisted`` are imported.
See the `convert_yielded` function to extend this mechanism.

.. versionchanged:: 3.2
   Dict support added.

.. versionchanged:: 4.1
   Support added for yielding ``asyncio`` Futures and Twisted Deferreds
   via ``singledispatch``.

 __future__ absolute_import division print_function with_statement N/A collections N/A functools N/A itertools N/A os N/A sys N/A textwrap N/A types tornado.concurrent Future TracebackFuture is_future chain_future tornado.ioloop IOLoop tornado.log app_log tornado stack_context tornado.util PY3 raise_exc_info N/A N/A N/A N/A functools singledispatch N/A N/A N/A ImportError N/A singledispatch singledispatch N/A N/A N/A ImportError N/A N/A N/A APPENGINE_RUNTIME N/A os environ N/A N/A N/A singledispatch None N/A N/A N/A N/A collections.abc Generator GeneratorType N/A N/A N/A ImportError N/A backports_abc Generator GeneratorType N/A N/A inspect isawaitable N/A N/A N/A ImportError N/A backports_abc isawaitable N/A N/A N/A ImportError N/A N/A N/A APPENGINE_RUNTIME N/A os environ N/A N/A types GeneratorType isawaitable N/A N/A x N/A N/A N/A False N/A N/A PY3 N/A N/A builtins N/A N/A __builtin__ builtins KeyReuseError N/A Exception N/A N/A N/A UnknownKeyError N/A Exception N/A N/A N/A LeakedCallbackError N/A Exception N/A N/A N/A BadYieldError N/A Exception N/A N/A N/A ReturnValueIgnoredError N/A Exception N/A N/A N/A TimeoutError N/A Exception N/A N/A Exception raised by ``with_timeout``. N/A _value_from_stopiteration N/A N/A e N/A N/A N/A N/A N/A N/A e value N/A N/A N/A AttributeError N/A N/A N/A N/A N/A N/A N/A e args N/A 0 N/A N/A N/A N/A AttributeError IndexError N/A N/A None N/A engine N/A N/A func N/A N/A N/A Callback-oriented decorator for asynchronous generators.

    This is an older interface; for new code that does not need to be
    compatible with versions of Tornado older than 3.0 the
    `coroutine` decorator is recommended instead.

    This decorator is similar to `coroutine`, except it does not
    return a `.Future` and the ``callback`` argument is not treated
    specially.

    In most cases, functions decorated with `engine` should take
    a ``callback`` argument and invoke it with their result when
    they are finished.  One notable exception is the
    `~tornado.web.RequestHandler` :ref:`HTTP verb methods <verbs>`,
    which use ``self.finish()`` in place of a callback argument.
     N/A func N/A _make_coroutine_wrapper func replace_callback False wrapper N/A N/A N/A args kwargs N/A N/A future N/A func args kwargs final_callback N/A N/A future N/A N/A N/A N/A N/A N/A future result None N/A N/A N/A ReturnValueIgnoredError N/A @gen.engine functions cannot return values: %r N/A N/A N/A future result N/A N/A N/A N/A future add_done_callback N/A N/A stack_context wrap final_callback N/A N/A N/A functools wraps func N/A wrapper N/A coroutine N/A N/A func replace_callback N/A True N/A N/A Decorator for asynchronous generators.

    Any generator that yields objects from this module must be wrapped
    in either this decorator or `engine`.

    Coroutines may "return" by raising the special exception
    `Return(value) <Return>`.  In Python 3.3+, it is also possible for
    the function to simply use the ``return value`` statement (prior to
    Python 3.3 generators were not allowed to also return values).
    In all versions of Python a coroutine that simply wishes to exit
    early may use the ``return`` statement without a value.

    Functions with this decorator return a `.Future`.  Additionally,
    they may be called with a ``callback`` keyword argument, which
    will be invoked with the future's result when it resolves.  If the
    coroutine fails, the callback will not be run and an exception
    will be raised into the surrounding `.StackContext`.  The
    ``callback`` argument is not visible inside the decorated
    function; it is handled by the decorator itself.

    From the caller's perspective, ``@gen.coroutine`` is similar to
    the combination of ``@return_future`` and ``@gen.engine``.

    .. warning::

       When exceptions occur inside a coroutine, the exception
       information will be stored in the `.Future` object. You must
       examine the result of the `.Future` object, or the exception
       may go unnoticed by your code. This means yielding the function
       if called from another coroutine, using something like
       `.IOLoop.run_sync` for top-level calls, or passing the `.Future`
       to `.IOLoop.add_future`.

     N/A N/A _make_coroutine_wrapper func replace_callback True N/A _make_coroutine_wrapper N/A N/A func replace_callback N/A N/A N/A The inner workings of ``@gen.coroutine`` and ``@gen.engine``.

    The two decorators differ in their treatment of the ``callback``
    argument, so we cannot simply implement ``@engine`` in terms of
    ``@coroutine``.
     N/A N/A hasattr types coroutine N/A N/A func N/A N/A types coroutine func wrapper N/A N/A N/A args kwargs N/A N/A future N/A TracebackFuture N/A N/A replace_callback N/A callback kwargs N/A N/A callback N/A N/A kwargs pop callback N/A N/A N/A N/A N/A IOLoop current add_future future N/A N/A N/A future N/A N/A callback N/A N/A future result N/A N/A N/A result N/A func args kwargs N/A N/A N/A N/A Return StopIteration N/A e N/A N/A result N/A _value_from_stopiteration e N/A N/A Exception N/A N/A N/A N/A future set_exc_info N/A N/A sys exc_info N/A future N/A N/A N/A isinstance result GeneratorType N/A N/A N/A N/A orig_stack_contexts N/A N/A stack_context _state contexts N/A yielded N/A next result N/A N/A N/A N/A stack_context _state contexts orig_stack_contexts N/A N/A yielded N/A TracebackFuture N/A N/A N/A yielded set_exception N/A N/A stack_context StackContextInconsistentError stack_context inconsistency (probably caused by yield within a "with StackContext" block) N/A N/A N/A N/A StopIteration Return N/A e N/A N/A N/A N/A future set_result N/A _value_from_stopiteration e N/A N/A Exception N/A N/A N/A N/A future set_exc_info N/A N/A sys exc_info N/A N/A N/A Runner result future yielded N/A N/A N/A future N/A N/A future None N/A N/A N/A future set_result result N/A future N/A N/A N/A functools wraps func N/A wrapper N/A Return N/A Exception N/A N/A Special exception to return a value from a `coroutine`.

    If this exception is raised, its value argument is used as the
    result of the coroutine::

        @gen.coroutine
        def fetch_json(url):
            response = yield AsyncHTTPClient().fetch(url)
            raise gen.Return(json_decode(response.body))

    In Python 3.3, this exception is no longer necessary: the ``return``
    statement can be used directly to return a value (previously
    ``yield`` and ``return`` with a value could not be combined in the
    same function).

    By analogy with the return statement, the value argument is optional,
    but it is never necessary to ``raise gen.Return()``.  The ``return``
    statement can be used with no arguments instead.
     __init__ N/A N/A self value N/A None N/A N/A N/A N/A N/A super Return self __init__ N/A N/A self value value N/A N/A self args N/A value N/A N/A WaitIterator N/A object N/A N/A Provides an iterator to yield the results of futures as they finish.

    Yielding a set of futures like this:

    ``results = yield [future1, future2]``

    pauses the coroutine until both ``future1`` and ``future2``
    return, and then restarts the coroutine with the results of both
    futures. If either future is an exception, the expression will
    raise that exception and all the results will be lost.

    If you need to get the result of each future as soon as possible,
    or if you need the result of some futures even if others produce
    errors, you can use ``WaitIterator``::

      wait_iterator = gen.WaitIterator(future1, future2)
      while not wait_iterator.done():
          try:
              result = yield wait_iterator.next()
          except Exception as e:
              print("Error {} from {}".format(e, wait_iterator.current_future))
          else:
              print("Result {} received from {} at {}".format(
                  result, wait_iterator.current_future,
                  wait_iterator.current_index))

    Because results are returned as soon as they are available the
    output from the iterator *will not be in the same order as the
    input arguments*. If you need to know which future produced the
    current result, you can use the attributes
    ``WaitIterator.current_future``, or ``WaitIterator.current_index``
    to get the index of the future from the input list. (if keyword
    arguments were used in the construction of the `WaitIterator`,
    ``current_index`` will use the corresponding keyword).

    On Python 3.5, `WaitIterator` implements the async iterator
    protocol, so it can be used with the ``async for`` statement (note
    that in this version the entire iteration is aborted if any value
    raises an exception, while the previous example can continue past
    individual errors)::

      async for result in gen.WaitIterator(future1, future2):
          print("Result {} received from {} at {}".format(
              result, wait_iterator.current_future,
              wait_iterator.current_index))

    .. versionadded:: 4.1

    .. versionchanged:: 4.3
       Added ``async for`` support in Python 3.5.

     __init__ N/A N/A self N/A args kwargs N/A N/A N/A args kwargs N/A N/A N/A ValueError You must provide args or kwargs, not both N/A kwargs N/A N/A N/A self _unfinished N/A dict N/A N/A f k N/A N/A k f N/A N/A kwargs items N/A futures N/A list N/A N/A kwargs values N/A N/A N/A self _unfinished N/A dict N/A N/A f i N/A N/A i f N/A enumerate args N/A futures args N/A N/A self _finished N/A N/A collections deque N/A N/A self current_index N/A self current_future None N/A N/A self _running_future None N/A future futures N/A N/A N/A N/A future add_done_callback N/A self _done_callback N/A done N/A N/A self N/A N/A N/A Returns True if this iterator has no more results. N/A N/A N/A self _finished N/A self _unfinished N/A N/A False N/A N/A self current_index N/A self current_future None N/A True N/A next N/A N/A self N/A N/A N/A Returns a `.Future` that will yield the next available result.

        Note that this `.Future` will not be the same object as any of
        the inputs.
         N/A N/A self _running_future N/A TracebackFuture N/A N/A self _finished N/A N/A N/A N/A self _return_result N/A N/A N/A self _finished popleft N/A N/A self _running_future N/A _done_callback N/A N/A self done N/A N/A N/A N/A N/A self _running_future N/A N/A N/A N/A self _running_future done N/A N/A N/A N/A self _return_result done N/A N/A N/A N/A N/A self _finished append done N/A _return_result N/A N/A self done N/A N/A N/A Called set the returned future's state that of the future
        we yielded, and set the current future for the iterator.
         N/A N/A chain_future done N/A self _running_future N/A N/A self current_future done N/A N/A self current_index N/A N/A N/A self _unfinished pop done N/A __aiter__ N/A N/A self N/A N/A N/A N/A Return self N/A coroutine __anext__ N/A N/A self N/A N/A N/A N/A N/A self done N/A N/A N/A N/A getattr builtins StopAsyncIteration N/A N/A N/A self next N/A N/A YieldPoint N/A object N/A N/A Base class for objects that may be yielded from the generator.

    .. deprecated:: 4.0
       Use `Futures <.Future>` instead.
     start N/A N/A self runner N/A N/A N/A Called by the runner after the generator has yielded.

        No other methods will be called on this object before ``start``.
         N/A N/A NotImplementedError N/A is_ready N/A N/A self N/A N/A N/A Called by the runner to determine whether to resume the generator.

        Returns a boolean; may be called more than once.
         N/A N/A NotImplementedError N/A get_result N/A N/A self N/A N/A N/A Returns the value to use as the result of the yield expression.

        This method will only be called once, and only after `is_ready`
        has returned true.
         N/A N/A NotImplementedError N/A N/A Callback N/A YieldPoint N/A N/A Returns a callable object that will allow a matching `Wait` to proceed.

    The key may be any value suitable for use as a dictionary key, and is
    used to match ``Callbacks`` to their corresponding ``Waits``.  The key
    must be unique among outstanding callbacks within a single run of the
    generator function, but may be reused across different runs of the same
    function (so constants generally work fine).

    The callback may be called with zero or one arguments; if an argument
    is given it will be returned by `Wait`.

    .. deprecated:: 4.0
       Use `Futures <.Future>` instead.
     __init__ N/A N/A self key N/A N/A N/A N/A self key key N/A start N/A N/A self runner N/A N/A N/A N/A self runner runner N/A N/A N/A runner register_callback N/A self key N/A is_ready N/A N/A self N/A N/A N/A True N/A get_result N/A N/A self N/A N/A N/A N/A N/A N/A self runner result_callback N/A self key N/A N/A Wait N/A YieldPoint N/A N/A Returns the argument passed to the result of a previous `Callback`.

    .. deprecated:: 4.0
       Use `Futures <.Future>` instead.
     __init__ N/A N/A self key N/A N/A N/A N/A self key key N/A start N/A N/A self runner N/A N/A N/A N/A self runner runner N/A is_ready N/A N/A self N/A N/A N/A N/A N/A N/A self runner is_ready N/A self key N/A get_result N/A N/A self N/A N/A N/A N/A N/A N/A self runner pop_result N/A self key N/A N/A WaitAll N/A YieldPoint N/A N/A Returns the results of multiple previous `Callbacks <Callback>`.

    The argument is a sequence of `Callback` keys, and the result is
    a list of results in the same order.

    `WaitAll` is equivalent to yielding a list of `Wait` objects.

    .. deprecated:: 4.0
       Use `Futures <.Future>` instead.
     __init__ N/A N/A self keys N/A N/A N/A N/A self keys keys N/A start N/A N/A self runner N/A N/A N/A N/A self runner runner N/A is_ready N/A N/A self N/A N/A N/A N/A all N/A N/A N/A N/A self runner is_ready key N/A key N/A self keys N/A get_result N/A N/A self N/A N/A N/A N/A N/A N/A N/A self runner pop_result key N/A key N/A self keys N/A N/A Task N/A N/A func N/A args kwargs N/A N/A Adapts a callback-based asynchronous function for use in coroutines.

    Takes a function (and optional additional arguments) and runs it with
    those arguments plus a ``callback`` keyword argument.  The argument passed
    to the callback is returned as the result of the yield expression.

    .. versionchanged:: 4.0
       ``gen.Task`` is now a function that returns a `.Future`, instead of
       a subclass of `YieldPoint`.  It still behaves the same way when
       yielded.
     N/A future N/A Future handle_exception N/A N/A typ value tb N/A N/A N/A N/A N/A future done N/A N/A False N/A N/A N/A future set_exc_info N/A typ value tb N/A True N/A set_result N/A N/A result N/A N/A N/A N/A N/A future done N/A N/A N/A N/A N/A future set_result result N/A N/A N/A N/A stack_context ExceptionStackContext handle_exception N/A N/A N/A func callback N/A _argument_adapter set_result args kwargs N/A future N/A YieldFuture N/A YieldPoint N/A __init__ N/A N/A self future io_loop N/A None N/A N/A Adapts a `.Future` to the `YieldPoint` interface.

        .. versionchanged:: 4.1
           The ``io_loop`` argument is deprecated.
         N/A N/A self future future N/A N/A self io_loop N/A io_loop N/A N/A IOLoop current N/A start N/A N/A self runner N/A N/A N/A N/A N/A N/A N/A self future done N/A N/A N/A self runner runner N/A N/A self key N/A object N/A N/A N/A runner register_callback N/A self key N/A N/A N/A N/A self io_loop add_future N/A self future N/A N/A runner result_callback N/A self key N/A N/A N/A self runner None N/A N/A self result_fn N/A N/A self future result N/A is_ready N/A N/A self N/A N/A N/A N/A N/A self runner None N/A N/A N/A N/A N/A self runner is_ready N/A self key N/A N/A True N/A get_result N/A N/A self N/A N/A N/A N/A N/A self runner None N/A N/A N/A N/A N/A N/A N/A self runner pop_result N/A self key result N/A N/A N/A N/A self result_fn N/A N/A _contains_yieldpoint N/A N/A children N/A N/A N/A Returns True if ``children`` contains any YieldPoints.

    ``children`` may be a dict or a list, as used by `MultiYieldPoint`
    and `multi_future`.
     N/A N/A isinstance children dict N/A N/A N/A any N/A N/A isinstance i YieldPoint N/A i N/A N/A children values N/A N/A isinstance children list N/A N/A N/A any N/A N/A isinstance i YieldPoint N/A i children N/A False N/A multi N/A N/A children quiet_exceptions N/A N/A N/A N/A Runs multiple asynchronous operations in parallel.

    ``children`` may either be a list or a dict whose values are
    yieldable objects. ``multi()`` returns a new yieldable
    object that resolves to a parallel structure containing their
    results. If ``children`` is a list, the result is a list of
    results in the same order; if it is a dict, the result is a dict
    with the same keys.

    That is, ``results = yield multi(list_of_futures)`` is equivalent
    to::

        results = []
        for future in list_of_futures:
            results.append(yield future)

    If any children raise exceptions, ``multi()`` will raise the first
    one. All others will be logged, unless they are of types
    contained in the ``quiet_exceptions`` argument.

    If any of the inputs are `YieldPoints <YieldPoint>`, the returned
    yieldable object is a `YieldPoint`. Otherwise, returns a `.Future`.
    This means that the result of `multi` can be used in a native
    coroutine if and only if all of its children can be.

    In a ``yield``-based coroutine, it is not normally necessary to
    call this function directly, since the coroutine runner will
    do it automatically when a list or dict is yielded. However,
    it is necessary in ``await``-based coroutines, or to pass
    the ``quiet_exceptions`` argument.

    This function is available under the names ``multi()`` and ``Multi()``
    for historical reasons.

    .. versionchanged:: 4.2
       If multiple yieldables fail, any exceptions after the first
       (which is raised) will be logged. Added the ``quiet_exceptions``
       argument to suppress this logging for selected exception types.

    .. versionchanged:: 4.3
       Replaced the class ``Multi`` and the function ``multi_future``
       with a unified function ``multi``. Added support for yieldables
       other than `YieldPoint` and `.Future`.

     N/A N/A _contains_yieldpoint children N/A N/A N/A MultiYieldPoint children quiet_exceptions quiet_exceptions N/A N/A N/A multi_future children quiet_exceptions quiet_exceptions N/A N/A Multi multi MultiYieldPoint N/A YieldPoint N/A N/A Runs multiple asynchronous operations in parallel.

    This class is similar to `multi`, but it always creates a stack
    context even when no children require it. It is not compatible with
    native coroutines.

    .. versionchanged:: 4.2
       If multiple ``YieldPoints`` fail, any exceptions after the first
       (which is raised) will be logged. Added the ``quiet_exceptions``
       argument to suppress this logging for selected exception types.

    .. versionchanged:: 4.3
       Renamed from ``Multi`` to ``MultiYieldPoint``. The name ``Multi``
       remains as an alias for the equivalent `multi` function.

    .. deprecated:: 4.3
       Use `multi` instead.
     __init__ N/A N/A self children quiet_exceptions N/A N/A N/A N/A N/A self keys None N/A N/A isinstance children dict N/A N/A N/A self keys N/A list N/A N/A children keys N/A children N/A N/A children values N/A N/A self children N/A N/A i children N/A N/A N/A N/A isinstance i YieldPoint N/A N/A i N/A convert_yielded i N/A N/A is_future i N/A N/A i N/A YieldFuture i N/A N/A N/A N/A self children append i N/A N/A all N/A N/A isinstance i YieldPoint N/A i N/A self children N/A N/A self unfinished_children N/A set N/A self children N/A N/A self quiet_exceptions quiet_exceptions N/A start N/A N/A self runner N/A N/A N/A i N/A self children N/A N/A N/A N/A i start runner N/A is_ready N/A N/A self N/A N/A N/A finished N/A list N/A N/A itertools takewhile N/A N/A N/A i N/A N/A N/A i is_ready N/A self unfinished_children N/A N/A N/A N/A self unfinished_children difference_update finished N/A N/A N/A self unfinished_children N/A get_result N/A N/A self N/A N/A N/A result_list N/A N/A exc_info None N/A f N/A self children N/A N/A N/A N/A N/A N/A result_list append N/A N/A f get_result N/A N/A N/A Exception N/A e N/A N/A N/A exc_info None N/A N/A exc_info N/A N/A sys exc_info N/A N/A N/A N/A isinstance e N/A self quiet_exceptions N/A N/A N/A N/A app_log error Multiple exceptions in yield list exc_info True N/A N/A exc_info None N/A N/A N/A raise_exc_info exc_info N/A N/A N/A self keys None N/A N/A N/A dict N/A zip N/A self keys result_list N/A N/A N/A list result_list N/A N/A multi_future N/A N/A children quiet_exceptions N/A N/A N/A N/A Wait for multiple asynchronous futures in parallel.

    This function is similar to `multi`, but does not support
    `YieldPoints <YieldPoint>`.

    .. versionadded:: 4.0

    .. versionchanged:: 4.2
       If multiple ``Futures`` fail, any exceptions after the first (which is
       raised) will be logged. Added the ``quiet_exceptions``
       argument to suppress this logging for selected exception types.

    .. deprecated:: 4.3
       Use `multi` instead.
     N/A N/A isinstance children dict N/A N/A keys N/A list N/A N/A children keys N/A children N/A N/A children values N/A N/A keys None N/A children N/A list N/A map convert_yielded children N/A N/A all N/A N/A is_future i N/A i children N/A unfinished_children N/A set children N/A future N/A Future N/A N/A children N/A N/A N/A N/A future set_result N/A N/A keys None N/A N/A callback N/A N/A f N/A N/A N/A N/A N/A unfinished_children remove f N/A N/A unfinished_children N/A N/A result_list N/A N/A f children N/A N/A N/A N/A N/A N/A result_list append N/A N/A f result N/A N/A N/A Exception N/A e N/A N/A N/A N/A future done N/A N/A N/A N/A isinstance e quiet_exceptions N/A N/A N/A N/A app_log error Multiple exceptions in yield list exc_info True N/A N/A N/A N/A future set_exc_info N/A N/A sys exc_info N/A N/A N/A N/A future done N/A N/A N/A keys None N/A N/A N/A N/A future set_result N/A dict N/A zip keys result_list N/A N/A N/A N/A future set_result result_list N/A N/A listening N/A set N/A f children N/A N/A N/A f listening N/A N/A N/A N/A listening add f N/A N/A N/A f add_done_callback callback N/A future N/A maybe_future N/A N/A x N/A N/A N/A Converts ``x`` into a `.Future`.

    If ``x`` is already a `.Future`, it is simply returned; otherwise
    it is wrapped in a new `.Future`.  This is suitable for use as
    ``result = yield gen.maybe_future(f())`` when you don't know whether
    ``f()`` returns a `.Future` or not.

    .. deprecated:: 4.3
       This function only handles ``Futures``, not other yieldable objects.
       Instead of `maybe_future`, check for the non-future result types
       you expect (often just ``None``), and ``yield`` anything unknown.
     N/A N/A is_future x N/A N/A x N/A N/A fut N/A Future N/A N/A N/A fut set_result x N/A fut N/A with_timeout N/A N/A timeout future io_loop quiet_exceptions N/A None N/A N/A N/A Wraps a `.Future` in a timeout.

    Raises `TimeoutError` if the input future does not complete before
    ``timeout``, which may be specified in any form allowed by
    `.IOLoop.add_timeout` (i.e. a `datetime.timedelta` or an absolute time
    relative to `.IOLoop.time`)

    If the wrapped `.Future` fails after it has timed out, the exception
    will be logged unless it is of a type contained in ``quiet_exceptions``
    (which may be an exception type or a sequence of types).

    Currently only supports Futures, not other `YieldPoint` classes.

    .. versionadded:: 4.0

    .. versionchanged:: 4.1
       Added the ``quiet_exceptions`` argument and the logging of unhandled
       exceptions.
     N/A result N/A Future N/A N/A chain_future future result N/A N/A io_loop None N/A N/A io_loop N/A N/A IOLoop current error_callback N/A N/A future N/A N/A N/A N/A N/A N/A N/A future result N/A N/A N/A Exception N/A e N/A N/A N/A N/A isinstance e quiet_exceptions N/A N/A N/A N/A app_log error Exception in Future %r after timeout future exc_info True N/A timeout_callback N/A N/A N/A N/A N/A N/A N/A result set_exception N/A TimeoutError Timeout N/A N/A N/A future add_done_callback error_callback N/A N/A timeout_handle N/A N/A io_loop add_timeout timeout timeout_callback N/A N/A isinstance future Future N/A N/A N/A N/A future add_done_callback N/A N/A N/A future N/A N/A N/A io_loop remove_timeout timeout_handle N/A N/A N/A N/A io_loop add_future future N/A N/A N/A future N/A N/A N/A io_loop remove_timeout timeout_handle N/A result N/A sleep N/A N/A duration N/A N/A N/A Return a `.Future` that resolves after the given number of seconds.

    When used with ``yield`` in a coroutine, this is a non-blocking
    analogue to `time.sleep` (which should not be used in coroutines
    because it is blocking)::

        yield gen.sleep(0.5)

    Note that calling this function on its own does nothing; you must
    wait on the `.Future` it returns (usually by yielding it).

    .. versionadded:: 4.1
     N/A f N/A Future N/A N/A N/A N/A N/A IOLoop current call_later duration N/A N/A N/A N/A N/A N/A f set_result None N/A f N/A N/A _null_future N/A Future N/A N/A N/A _null_future set_result None N/A moment N/A Future N/A N/A moment __doc__ A special object which may be yielded to allow the IOLoop to run for
one iteration.

This is not needed in normal use but it can be helpful in long-running
coroutines that are likely to yield Futures that are ready instantly.

Usage: ``yield gen.moment``

.. versionadded:: 4.0
 N/A N/A N/A moment set_result None Runner N/A object N/A N/A Internal implementation of `tornado.gen.engine`.

    Maintains information about pending callbacks and their results.

    The results of the generator are stored in ``result_future`` (a
    `.TracebackFuture`)
     __init__ N/A N/A self gen result_future first_yielded N/A N/A N/A N/A self gen gen N/A N/A self result_future result_future N/A N/A self future _null_future N/A N/A self yield_point None N/A N/A self pending_callbacks None N/A N/A self results None N/A N/A self running False N/A N/A self finished False N/A N/A self had_exception False N/A N/A self io_loop N/A N/A IOLoop current N/A N/A self stack_context_deactivate None N/A N/A N/A self handle_yield first_yielded N/A N/A N/A N/A self run N/A register_callback N/A N/A self key N/A N/A N/A Adds ``key`` to the list of callbacks. N/A N/A N/A self pending_callbacks None N/A N/A N/A self pending_callbacks N/A set N/A N/A self results N/A N/A N/A key N/A self pending_callbacks N/A N/A N/A KeyReuseError N/A key %r is already pending N/A key N/A N/A N/A N/A self pending_callbacks add key N/A is_ready N/A N/A self key N/A N/A N/A Returns true if a result is available for ``key``. N/A N/A N/A N/A self pending_callbacks None N/A key N/A self pending_callbacks N/A N/A N/A UnknownKeyError N/A key %r is not pending N/A key N/A N/A key N/A self results N/A set_result N/A N/A self key result N/A N/A N/A Sets the result for ``key`` and attempts to resume the generator. N/A N/A N/A self results N/A key result N/A N/A N/A N/A self yield_point None N/A N/A N/A self yield_point is_ready N/A N/A N/A N/A N/A N/A N/A self future set_result N/A N/A N/A self yield_point get_result N/A N/A N/A N/A N/A N/A N/A self future set_exc_info N/A N/A sys exc_info N/A N/A self yield_point None N/A N/A N/A self run N/A pop_result N/A N/A self key N/A N/A N/A Returns the result for ``key`` and unregisters it. N/A N/A N/A N/A self pending_callbacks remove key N/A N/A N/A N/A self results pop key N/A run N/A N/A self N/A N/A N/A Starts or resumes the generator, running until it reaches a
        yield point that is not ready.
         N/A N/A N/A self running N/A self finished N/A N/A N/A N/A N/A N/A self running True N/A True N/A N/A future N/A self future N/A N/A N/A N/A future done N/A N/A N/A N/A self future None N/A N/A N/A orig_stack_contexts N/A N/A stack_context _state contexts N/A exc_info None N/A N/A N/A value N/A N/A future result N/A N/A N/A Exception N/A N/A N/A self had_exception True N/A exc_info N/A N/A sys exc_info N/A N/A exc_info None N/A N/A yielded N/A N/A N/A self gen throw exc_info N/A exc_info None N/A N/A yielded N/A N/A N/A self gen send value N/A N/A N/A N/A stack_context _state contexts orig_stack_contexts N/A N/A N/A N/A N/A self gen throw N/A N/A stack_context StackContextInconsistentError stack_context inconsistency (probably caused by yield within a "with StackContext" block) N/A N/A N/A N/A StopIteration Return N/A e N/A N/A N/A self finished True N/A N/A self future _null_future N/A N/A N/A self pending_callbacks N/A N/A self had_exception N/A N/A N/A LeakedCallbackError N/A finished without waiting for callbacks %r N/A self pending_callbacks N/A N/A N/A N/A self result_future set_result N/A _value_from_stopiteration e N/A N/A self result_future None N/A N/A N/A self _deactivate_stack_context N/A N/A N/A Exception N/A N/A N/A self finished True N/A N/A self future _null_future N/A N/A N/A N/A self result_future set_exc_info N/A N/A sys exc_info N/A N/A self result_future None N/A N/A N/A self _deactivate_stack_context N/A N/A N/A N/A N/A self handle_yield yielded N/A N/A N/A N/A N/A self running False N/A handle_yield N/A N/A self yielded N/A N/A N/A N/A _contains_yieldpoint yielded N/A N/A yielded N/A multi yielded N/A N/A isinstance yielded YieldPoint N/A N/A N/A self future N/A TracebackFuture start_yield_point N/A N/A N/A N/A N/A N/A N/A N/A N/A yielded start self N/A N/A N/A yielded is_ready N/A N/A N/A N/A N/A self future set_result N/A N/A yielded get_result N/A N/A N/A self yield_point yielded N/A N/A N/A Exception N/A N/A N/A self future N/A TracebackFuture N/A N/A N/A N/A self future set_exc_info N/A N/A sys exc_info N/A N/A N/A N/A self stack_context_deactivate None N/A N/A N/A N/A stack_context ExceptionStackContext N/A self handle_exception deactivate N/A N/A N/A self stack_context_deactivate deactivate cb N/A N/A N/A N/A N/A N/A start_yield_point N/A N/A N/A self run N/A N/A N/A N/A N/A self io_loop add_callback cb N/A False N/A N/A N/A start_yield_point N/A N/A N/A N/A N/A self future N/A convert_yielded yielded N/A N/A N/A BadYieldError N/A N/A N/A self future N/A TracebackFuture N/A N/A N/A N/A self future set_exc_info N/A N/A sys exc_info N/A N/A N/A N/A N/A N/A self future done N/A N/A self future moment N/A N/A N/A N/A N/A self io_loop add_future N/A self future N/A N/A N/A f N/A N/A N/A self run N/A False N/A True N/A result_callback N/A N/A self key N/A N/A N/A N/A N/A stack_context wrap N/A _argument_adapter N/A N/A functools partial N/A self set_result key N/A handle_exception N/A N/A self typ value tb N/A N/A N/A N/A N/A N/A self running N/A N/A self finished N/A N/A N/A self future N/A TracebackFuture N/A N/A N/A N/A self future set_exc_info N/A typ value tb N/A N/A N/A self run N/A True N/A N/A False N/A _deactivate_stack_context N/A N/A self N/A N/A N/A N/A N/A self stack_context_deactivate None N/A N/A N/A N/A self stack_context_deactivate N/A N/A self stack_context_deactivate None N/A N/A N/A Arguments N/A N/A collections namedtuple Arguments N/A args kwargs _argument_adapter N/A N/A callback N/A N/A N/A Returns a function that when invoked runs ``callback`` with one arg.

    If the function returned by this function is called with exactly
    one argument, that argument is passed to ``callback``.  Otherwise
    the args tuple and kwargs dict are wrapped in an `Arguments` object.
     wrapper N/A N/A N/A args kwargs N/A N/A N/A kwargs N/A N/A len args 1 N/A N/A N/A callback N/A Arguments args kwargs N/A N/A args N/A N/A N/A callback N/A args N/A 0 N/A N/A N/A callback None N/A N/A wrapper N/A N/A N/A N/A sys version_info N/A 3 3 N/A N/A N/A N/A textwrap dedent 
    @coroutine
    def _wrap_awaitable(x):
        if hasattr(x, '__await__'):
            x = x.__await__()
        return (yield from x)
     N/A _wrap_awaitable N/A N/A x N/A N/A N/A N/A hasattr x __await__ N/A N/A _i N/A N/A x __await__ N/A N/A _i N/A iter x N/A N/A N/A _y N/A next _i N/A N/A N/A StopIteration N/A _e N/A N/A _r N/A _value_from_stopiteration _e N/A N/A 1 N/A N/A N/A N/A _s N/A _y N/A N/A N/A GeneratorExit N/A _e N/A N/A N/A N/A _m N/A _i close N/A N/A N/A AttributeError N/A N/A N/A N/A N/A _m N/A _e N/A N/A BaseException N/A _e N/A N/A _x N/A N/A sys exc_info N/A N/A N/A _m N/A _i throw N/A N/A N/A AttributeError N/A N/A _e N/A N/A N/A N/A _y N/A _m _x N/A N/A N/A StopIteration N/A _e N/A N/A _r N/A _value_from_stopiteration _e N/A N/A N/A N/A N/A N/A _s None N/A N/A _y N/A next _i N/A N/A _y N/A N/A _i send _s N/A N/A N/A StopIteration N/A _e N/A N/A _r N/A _value_from_stopiteration _e N/A N/A N/A Return _r N/A coroutine convert_yielded N/A N/A yielded N/A N/A N/A Convert a yielded object into a `.Future`.

    The default implementation accepts lists, dictionaries, and Futures.

    If the `~functools.singledispatch` library is available, this function
    may be extended to support additional types. For example::

        @convert_yielded.register(asyncio.Future)
        def _(asyncio_future):
            return tornado.platform.asyncio.to_tornado_future(asyncio_future)

    .. versionadded:: 4.1
     N/A N/A isinstance yielded N/A list dict N/A N/A N/A multi yielded N/A N/A N/A is_future yielded N/A N/A yielded N/A N/A N/A isawaitable yielded N/A N/A N/A _wrap_awaitable yielded N/A N/A N/A BadYieldError N/A yielded unknown object %r N/A yielded N/A N/A N/A singledispatch None N/A N/A convert_yielded N/A singledispatch convert_yielded N/A N/A N/A tornado.platform.asyncio N/A N/A N/A ImportError N/A N/A N/A N/A tornado