code: def init_config():
      # Read configuration from $METAFLOW_HOME/config_<profile>.json.
      home = os.environ.get("METAFLOW_HOME", "~/.metaflowconfig")
      profile = os.environ.get("METAFLOW_PROFILE")
      path_to_config = os.path.join(home, "config.json")
      if profile:
          path_to_config = os.path.join(
              home, "config_%s.json" % profile
          )
      path_to_config = os.path.expanduser(path_to_config)
      config = {}
      if os.path.exists(path_to_config):
          with open(path_to_config, encoding="utf-8") as f:
              return json.load(f)
      elif profile:
          raise MetaflowException(
              "Unable to locate METAFLOW_PROFILE '%s' in '%s')"
              % (profile, home)
          )
      return config
  
file_path: metaflow/metaflow/metaflow_config_funcs.py
imports: import json
  import os
  from collections import namedtuple
  from metaflow.exception import MetaflowException
  from metaflow.util import is_stringish
label_desc: Use image node_id 1 for calling a global function with example usage: init_config() and returns: config, json