code: def test_errors(result):
      # Directory already exists.
      dump_obj(
          result,
          dir_name="name",
          dump_design_info=False,
          overwrite_exist_dir=True,
      )
      with pytest.raises(
          FileExistsError,
          match="The directory already exists. "
          "Please either specify a new directory or "
          "set overwrite_exist_dir to True to overwrite it.",
      ):
          dump_obj(
              result,
              dir_name="name",
              dump_design_info=False,
              overwrite_exist_dir=False,
          )
      recursive_rm_dir("name")
  
      # Empty dir load.
      os.mkdir("this_dir_is_empty")
      with pytest.raises(ValueError, match="dir is empty!"):
          load_obj(dir_name="this_dir_is_empty")
      recursive_rm_dir("this_dir_is_empty")
  
      # Multiple elements in top level dir.
      os.mkdir("multiple_dir")
      dump_obj(1, "multiple_dir", "one", top_level=False)
      dump_obj(2, "multiple_dir", "two", top_level=False)
      with pytest.raises(
          ValueError, match="Multiple elements found in top level."
      ):
          load_obj(dir_name="multiple_dir")
      recursive_rm_dir("multiple_dir")
  
imports: import inspect
  import os
  import sys
  from collections import OrderedDict
  import pytest
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import generate_df_for_tests
  from greykite.framework.templates.autogen.forecast_config import ComputationParam
  from greykite.framework.templates.autogen.forecast_config import EvaluationPeriodParam
  from greykite.framework.templates.autogen.forecast_config import ForecastConfig
  from greykite.framework.templates.autogen.forecast_config import MetadataParam
  from greykite.framework.templates.autogen.forecast_config import ModelComponentsParam
  from greykite.framework.templates.forecaster import Forecaster
  from greykite.framework.templates.model_templates import ModelTemplateEnum
  from greykite.framework.templates.pickle_utils import dump_obj
  from greykite.framework.templates.pickle_utils import load_obj
  from greykite.framework.templates.pickle_utils import recursive_rm_dir
  from greykite.framework.utils.result_summary import summarize_grid_search_results
label_desc: Use image node_id 14 for calling a global function with example usage: test_errors(result) without return types