code: def load_config(config: Union[str, Dict], default_config_file: str):
      """
      Load config based on the default_config.
      """
      # use default config
      if isinstance(config, str):
          filename = config
          config = load_service_config_file(filename)
      else:
          full_config = load_service_config_file(default_config_file)
          config = _merge_config(full_config, config)
      if config["scheduling"]["speculation"]["enabled"] is True:
          # if `initial_same_color_num` > 1, coloring based fusion will make subtask too heterogeneous such that
          # the speculative scheduler can't get enough homogeneous subtasks to calculate statistics
          warnings.warn(
              "speculative execution is enabled, set initial_same_color_num to 1 to "
              "ensure enough homogeneous subtasks to calculate statistics."
          )
          config["task"]["default_config"]["initial_same_color_num"] = 1
      ray_execution_config = config["task"][
          "execution_config"
      ].setdefault("ray", {})
      subtask_max_retries = config["scheduling"].get(
          "subtask_max_retries"
      )
      if subtask_max_retries is not None:
          ray_execution_config.setdefault(
              "subtask_max_retries", subtask_max_retries
          )
      return config
  
file_path: mars/mars/deploy/utils.py
imports: import asyncio
  import os
  import time
  import warnings
  from typing import Callable, Dict, List, Union, TextIO
  import yaml
  from ..services import NodeRole
  from ..utils import merge_dict, flatten_dict_to_nested_dict
label_desc: Use image node_id 4 for calling a global function with example usage: load_config(config, default_config_file) and returns: config