code: def allow_implicit_stop(gen_func):
      
      @functools.wraps(gen_func)
      def wrapper(*args, **kwargs):
          with warnings.catch_warnings():
              for cls in [DeprecationWarning, PendingDeprecationWarning]:
                  warnings.filterwarnings(
                      action="ignore",
                      message=".* raised StopIteration",
                      category=cls,
                  )
              try:
                  for item in gen_func(*args, **kwargs):
                      yield item
              except RuntimeError as exc:
                  if type(exc.__cause__) is StopIteration:
                      return
                  raise
      return wrapper
docs: Fix the backwards-incompatible PEP-0479 gotcha/bug
      https://www.python.org/dev/peps/pep-0479