code: def test_eval_results_plus_build_doc():
      # test docs
  
      # docstring was build already:
      with swallow_logs(new_level=logging.DEBUG) as cml:
          TestUtils().__call__(1)
          assert_not_in("Building doc for", cml.out)
      # docstring accessible both ways:
      doc1 = Dataset.fake_command.__doc__
      doc2 = TestUtils().__call__.__doc__
  
      # docstring was built from Test_Util's definition:
      assert_equal(doc1, doc2)
      assert_in("TestUtil's fake command", doc1)
      assert_in("Parameters", doc1)
      assert_in("It's a number", doc1)
  
      # docstring shows correct override values of defaults in eval_params
      assert_re_in("Default:\\s+'tailored'", doc1, match=False)
      assert_re_in("Default:\\s+'item-or-list'", doc1, match=False)
  
      # docstring also contains eval_result's parameters:
      assert_in("result_filter", doc1)
      assert_in("return_type", doc1)
      assert_in("list", doc1)
      assert_in("None", doc1)
      assert_in("return value behavior", doc1)
      assert_in("dictionary is passed", doc1)
  
      # test eval_results is able to determine the call, a method of which it is
      # decorating:
      with swallow_logs(new_level=logging.DEBUG) as cml:
          Dataset("/does/not/matter").fake_command(3)
          assert_in(
              "Determined class of decorated function: {}"
              "".format(TestUtils().__class__),
              cml.out,
          )
  
      # test results:
      result = TestUtils().__call__(2)
      assert_equal(len(list(result)), 2)
      result = Dataset("/does/not/matter").fake_command(3)
      assert_equal(len(list(result)), 3)
  
      # test absent side-effect of popping eval_defaults
      kwargs = dict(return_type="list")
      TestUtils().__call__(2, **kwargs)
      assert_equal(list(kwargs), ["return_type"])
  
      # test signature:
      from datalad.utils import getargspec
  
      assert_equal(
          getargspec(Dataset.fake_command)[0],
          ["number", "dataset", "result_fn"],
      )
      assert_equal(
          getargspec(TestUtils.__call__)[0],
          ["number", "dataset", "result_fn"],
      )
  
imports: import logging
  import re
  from contextlib import contextmanager
  from os.path import exists
  from os.path import join
  from time import sleep
  from datalad.distribution.dataset import Dataset, EnsureDataset, datasetmethod
  from datalad.interface.base import build_doc, eval_results
  from datalad.support.constraints import EnsureKeyChoice, EnsureNone, EnsureStr
  from datalad.support.param import Parameter
  from datalad.tests.utils_pytest import assert_dict_equal, assert_equal, assert_in, assert_not_equal, assert_not_in, assert_raises, assert_re_in, assert_repo_status, assert_result_count, assert_true, ok_, slow, with_tempfile, with_tree
  from datalad.utils import swallow_logs, swallow_outputs
  from ..base import Interface
  from ..results import get_status_dict
  from ..utils import discover_dataset_trace_to_targets, handle_dirty_dataset
label_desc: Use image node_id 6 for calling a global function with example usage: test_eval_results_plus_build_doc() without return types