code: def _value_from_stopiteration(
      e: Union[StopIteration, "Return"]
  ) -> Any:
      try:
          # StopIteration has a value attribute beginning in py33.
          # So does our Return class.
          return e.value
      except AttributeError:
          pass
      try:
          # Cython backports coroutine functionality by putting the value in
          # e.args[0].
          return e.args[0]
      except (AttributeError, IndexError):
          return None
  
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 1 for calling a global function with example usage: _value_from_stopiteration(e) and returns: e, e, None