code: def save_config(file_path, config, replace=False):
      """
      :param file_path: the file path of config to be saved.
      :param config: dict. The config to be saved
      :param replace: whether to replace if the config file already existed.
      :return:
      """
      if os.path.isfile(file_path) and not replace:
          with open(file_path, "r") as input_file:
              old_config = json.load(input_file)
          old_config.update(config)
          config = old_config.copy()
  
      file_dirname = os.path.dirname(os.path.abspath(file_path))
      if file_dirname and not os.path.exists(file_dirname):
          os.makedirs(file_dirname)
  
      with open(file_path, "w") as output_file:
          json.dump(config, output_file, cls=NumpyEncoder)
  
file_path: analytics-zoo/pyzoo/zoo/chronos/autots/deprecated/feature/utils.py
imports: import json
  import os
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: save_config(file_path, config, replace) without return types