code: def migrate_config(name, env):
      """Migrate a config file
  
      Includes substitutions for updated configurable names.
      """
      log = get_logger()
      src_base = pjoin("{profile}", "ipython_{name}_config").format(
          name=name, **env
      )
      dst_base = pjoin(
          "{jupyter_config}", "jupyter_{name}_config"
      ).format(name=name, **env)
      loaders = {
          ".py": PyFileConfigLoader,
          ".json": JSONFileConfigLoader,
      }
      migrated = []
      for ext in (".py", ".json"):
          src = src_base + ext
          dst = dst_base + ext
          if os.path.exists(src):
              cfg = loaders[ext](src).load_config()
              if cfg:
                  if migrate_file(
                      src, dst, substitutions=config_substitutions
                  ):
                      migrated.append(src)
              else:
                  # don't migrate empty config files
                  log.debug("Not migrating empty config file: %s" % src)
      return migrated
  
file_path: catboost/contrib/python/jupyter-core/py2/jupyter_core/migrate.py
imports: from __future__ import unicode_literals
  import os
  import re
  import shutil
  from datetime import datetime
  from traitlets.config import PyFileConfigLoader, JSONFileConfigLoader
  from traitlets.log import get_logger
  from .utils import ensure_dir_exists
  from .paths import jupyter_config_dir, jupyter_data_dir
  from .application import JupyterApp
label_desc: Use image node_id 6 for calling a global function with example usage: migrate_config(name, env) and returns: migrated