code: def __call__(
      self,
      fn: "typing.Callable[..., typing.Union[typing.Generator[typing.Any, typing.Any, _RetValT], Future[_RetValT]]]",
      *args: typing.Any,
      **kwargs: typing.Any,
  ) -> "typing.Generator[typing.Any, typing.Any, _RetValT]":
      self.begin()
  
      retry_state = RetryCallState(
          retry_object=self, fn=fn, args=args, kwargs=kwargs
      )
      while True:
          do = self.iter(retry_state=retry_state)
          if isinstance(do, DoAttempt):
              try:
                  result = yield fn(*args, **kwargs)
              except BaseException:  # noqa: B902
                  retry_state.set_exception(sys.exc_info())  # type: ignore[arg-type]
              else:
                  retry_state.set_result(result)
          elif isinstance(do, DoSleep):
              retry_state.prepare_for_next_attempt()
              yield self.sleep(do)
          else:
              raise gen.Return(do)
  
file_path: catboost/contrib/python/tenacity/py3/tenacity/tornadoweb.py
imports: import sys
  import typing
  from tenacity import BaseRetrying
  from tenacity import DoAttempt
  from tenacity import DoSleep
  from tenacity import RetryCallState
  from tornado import gen
label_desc: Use image node_id 2 for calling the TornadoRetrying obj's underlying member method code with example usage: obj.__call__(fn) without return types