code: def _init_runner_class():
      import doctest
  
      class PytestDoctestRunner(doctest.DebugRunner):
          """
          Runner to collect failures.  Note that the out variable in this case is
          a list instead of a stdout-like object
          """
  
          def __init__(
              self,
              checker=None,
              verbose=None,
              optionflags=0,
              continue_on_failure=True,
          ):
              doctest.DebugRunner.__init__(
                  self,
                  checker=checker,
                  verbose=verbose,
                  optionflags=optionflags,
              )
              self.continue_on_failure = continue_on_failure
  
          def report_failure(self, out, test, example, got):
              failure = doctest.DocTestFailure(test, example, got)
              if self.continue_on_failure:
                  out.append(failure)
              else:
                  raise failure
  
          def report_unexpected_exception(
              self, out, test, example, exc_info
          ):
              if isinstance(exc_info[1], Skipped):
                  raise exc_info[1]
              failure = doctest.UnexpectedException(
                  test, example, exc_info
              )
              if self.continue_on_failure:
                  out.append(failure)
              else:
                  raise failure
  
      return PytestDoctestRunner
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import inspect
  import platform
  import sys
  import traceback
  import warnings
  from contextlib import contextmanager
  import pytest
  from _pytest._code.code import ExceptionInfo
  from _pytest._code.code import ReprFileLocation
  from _pytest._code.code import TerminalRepr
  from _pytest.compat import safe_getattr
  from _pytest.fixtures import FixtureRequest
  from _pytest.outcomes import Skipped
  from _pytest.warning_types import PytestWarning
label_desc: Use image node_id 5 for calling a global function with example usage: _init_runner_class() and returns: PytestDoctestRunner