code: def test_single_config(text, expected, n_errors=0):
      print()
      with TemporaryDirectory() as target_dir:
          with open(os.path.join(target_dir, ".h2oconfig"), "wt") as f:
              f.write(text)
  
          if n_errors:
              print(
                  "Expecting %d error%s..."
                  % (n_errors, "s" if n_errors > 1 else "")
              )
          handler = LogErrorCounter()
          logging.getLogger("h2o").addHandler(handler)
          result = h2o.utils.config.H2OConfigReader(
              target_dir
          ).read_config()
          assert (
              result == expected
          ), "Expected config %r but obtained %r" % (expected, result)
          assert (
              handler.errorcount == n_errors
          ), "Expected %d errors but obtained %d" % (
              n_errors,
              handler.errorcount,
          )
          logging.getLogger("h2o").removeHandler(handler)
  
file_path: h2o-3/h2o-py/tests/testdir_utils/pyunit_h2oconfig.py
imports: import logging
  import os
  import h2o
  import h2o.utils.config
  from tests import TemporaryDirectory, pyunit_utils
label_desc: Use image node_id 2 for calling a global function with example usage: test_single_config(text, expected, n_errors) without return types