code: def test_docstring(self, docstring):
      # We ignore differences in whitespace in the doctest output, and enable
      # the use of an ellipsis "..." to match any string in the doctest
      # output. An ellipsis is useful for, e.g., memory addresses or
      # imprecise floating point values.
      skip_reason = skip_docstring(docstring)
      if skip_reason is not None:
          pytest.skip(reason=skip_reason)
  
      optionflags = doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE
      runner = doctest.DocTestRunner(optionflags=optionflags)
      np.random.seed(6)
      globs = dict(
          cudf=cudf,
          np=np,
          cugraph=cugraph,
          datasets_path=self.abs_datasets_path,
          scipy=scipy,
          pd=pd,
      )
      docstring.globs = globs
  
      # Capture stdout and include failing outputs in the traceback.
      doctest_stdout = io.StringIO()
      with contextlib.redirect_stdout(doctest_stdout):
          runner.run(docstring)
          results = runner.summarize()
      try:
          assert not results.failed, (
              f"{results.failed} of {results.attempted} doctests failed for "
              f"{docstring.name}:\n{doctest_stdout.getvalue()}"
          )
      except AssertionError:
          # If some failed but all the failures were due to lack of
          # cugraph-ops support, we can skip.
          out = doctest_stdout.getvalue()
          if (
              "CUGRAPH_UNKNOWN_ERROR" in out and "unimplemented" in out
          ) or ("built with NO_CUGRAPH_OPS" in out):
              pytest.skip("Doctest requires cugraph-ops support.")
          raise
  
imports: import contextlib
  import doctest
  import inspect
  import io
  import os
  import numpy
  import pandas
  import scipy
  import pytest
  import cugraph
  import pylibcugraph
  import cudf
  from numba import cuda
  from cugraph.testing import utils
label_desc: Use image node_id 2 for calling the TestDoctests obj's underlying member method code with example usage: obj.test_docstring(docstring) without return types