code: def parse_backtest_config(path: str) -> dict:
      abs_path = os.path.abspath(path)
      check_file_exist(abs_path)
  
      file_ext_name = os.path.splitext(abs_path)[1]
      if file_ext_name not in (".py", ".json", ".yaml", ".yml"):
          raise IOError("Only py/yml/yaml/json type are supported now!")
  
      with tempfile.TemporaryDirectory() as tmp_config_dir:
          with tempfile.NamedTemporaryFile(
              dir=tmp_config_dir, suffix=file_ext_name
          ) as tmp_config_file:
              if platform.system() == "Windows":
                  tmp_config_file.close()
  
              tmp_config_name = os.path.basename(tmp_config_file.name)
              shutil.copyfile(abs_path, tmp_config_file.name)
  
              if abs_path.endswith(".py"):
                  tmp_module_name = os.path.splitext(tmp_config_name)[0]
                  sys.path.insert(0, tmp_config_dir)
                  module = import_module(tmp_module_name)
                  sys.path.pop(0)
  
                  config = {
                      k: v
                      for k, v in module.__dict__.items()
                      if not k.startswith("__")
                  }
  
                  del sys.modules[tmp_module_name]
              else:
                  with open(tmp_config_file.name) as input_stream:
                      config = yaml.safe_load(input_stream)
  
      if "_base_" in config:
          base_file_name = config.pop("_base_")
          if not isinstance(base_file_name, list):
              base_file_name = [base_file_name]
  
          for f in base_file_name:
              base_config = parse_backtest_config(
                  os.path.join(os.path.dirname(abs_path), f)
              )
              config = merge_a_into_b(a=config, b=base_config)
  
      return config
  
file_path: qlib/qlib/rl/contrib/naive_config_parser.py
imports: import os
  import platform
  import shutil
  import sys
  import tempfile
  from importlib import import_module
  import yaml
label_desc: Use image node_id 3 for calling a global function with example usage: parse_backtest_config(path) and returns: config