code: def test_save_config():
      ex = Experiment(name="experiment")
  
      config = {"a": 1, "b": 2, "seed": 42}
      ex.add_config(config)
  
      @ex.main
      def main():
          pass
  
      cwd = os.getcwd()
      try:
          with tempfile.TemporaryDirectory() as dirname:
              os.chdir(dirname)
  
              ex.run("save_config")
  
              with open(os.path.join(dirname, "config.json")) as f:
                  saved_config = json.load(f)
                  assert config == saved_config
  
              if opt.has_yaml:
                  ex.run(
                      "save_config", {"config_filename": "config.yaml"}
                  )
  
                  with open(os.path.join(dirname, "config.yaml")) as f:
                      saved_config = opt.yaml.load(
                          f, Loader=opt.yaml.FullLoader
                      )
                      assert config == saved_config
      finally:
          os.chdir(cwd)
  
imports: import os
  import sys
  import tempfile
  import pprint
  import json
  from collections import OrderedDict
  import pytest
  from sacred import Ingredient, Experiment
  from sacred.commands import COLOR_MODIFIED, ENDC, COLOR_DOC, COLOR_ADDED, COLOR_TYPECHANGED, ConfigEntry, PathEntry, _format_config, _format_entry, help_for_command, _iterate_marked, _format_named_configs, _format_named_config
  from sacred.config import ConfigScope
  from sacred.config.config_summary import ConfigSummary
  import sacred.optional
label_desc: Use image node_id 14 for calling a global function with example usage: test_save_config() without return types