code: def update_config(args):
      """
      Update an existing config file with the latest defaults while maintaining the old configuration.
      """
      config_file = args.config_file
      if config_file is None and Path(default_config_file).exists():
          config_file = default_config_file
      elif not Path(config_file).exists():
          raise ValueError(
              f"The passed config file located at {config_file} doesn't exist."
          )
      config = load_config_from_file(config_file)
  
      if config_file.endswith(".json"):
          config.to_json_file(config_file)
      else:
          config.to_yaml_file(config_file)
      return config_file
  
imports: from pathlib import Path
  from .config_args import default_config_file, load_config_from_file
  from .config_utils import SubcommandHelpFormatter
label_desc: Use image node_id 1 for calling a global function with example usage: update_config(args) and returns: config_file