class_docstr: Internal implementation of `tornado.gen.coroutine`.
  
  Maintains information about pending callbacks and their results.
  
  The results of the generator are stored in ``result_future`` (a
  `.Future`)
class_docstr_tok: ["Internal","implementation","of","`","tornado.gen.coroutine","`",".","Maintains","information","about","pending","callbacks","and","their","results",".","The","results","of","the","generator","are","stored","in","``","result_future","``","(","a","`",".Future","`",")"]
docstr: Starts or resumes the generator, running until it reaches a
  yield point that is not ready.
code: def run(self) -> None:
      """Starts or resumes the generator, running until it reaches a
      yield point that is not ready.
      """
      if self.running or self.finished:
          return
      try:
          self.running = True
          while True:
              future = self.future
              if future is None:
                  raise Exception("No pending future")
              if not future.done():
                  return
              self.future = None
              try:
                  try:
                      value = future.result()
                  except Exception as e:
                      # Save the exception for later. It's important that
                      # gen.throw() not be called inside this try/except block
                      # because that makes sys.exc_info behave unexpectedly.
                      exc: Optional[Exception] = e
                  else:
                      exc = None
                  finally:
                      future = None
  
                  if exc is not None:
                      try:
                          yielded = self.gen.throw(exc)
                      finally:
                          # Break up a circular reference for faster GC on
                          # CPython.
                          del exc
                  else:
                      yielded = self.gen.send(value)
  
              except (StopIteration, Return) as e:
                  self.finished = True
                  self.future = _null_future
                  future_set_result_unless_cancelled(
                      self.result_future, _value_from_stopiteration(e)
                  )
                  self.result_future = None  # type: ignore
                  return
              except Exception:
                  self.finished = True
                  self.future = _null_future
                  future_set_exc_info(
                      self.result_future, sys.exc_info()
                  )
                  self.result_future = None  # type: ignore
                  return
              if not self.handle_yield(yielded):
                  return
              yielded = None
      finally:
          self.running = False
  
imports: import asyncio
  import builtins
  import collections
  from collections.abc import Generator
  import concurrent.futures
  import datetime
  import functools
  from functools import singledispatch
  from inspect import isawaitable
  import sys
  import types
  from tornado.concurrent import Future, is_future, chain_future, future_set_exc_info, future_add_done_callback, future_set_result_unless_cancelled
  from tornado.ioloop import IOLoop
  from tornado.log import app_log
  from tornado.util import TimeoutError
  import typing
  from typing import Union, Any, Callable, List, Type, Tuple, Awaitable, Dict, overload
label_desc: Use image node_id 2 for calling the Runner obj's underlying member method code with example usage: obj.run() without return types