code: def get_config(config_file=None):
      config_paths = []
      if config_file:
          if not os.path.exists(config_file):
              raise ValueError(
                  "User config file {} not found".format(config_file)
              )
          config_paths.append(os.path.expanduser(config_file))
  
      config_paths.append(os.path.expanduser("~/.studioml/config.yaml"))
      config_paths.append(
          os.path.join(
              os.path.dirname(os.path.realpath(__file__)),
              "default_config.yaml",
          )
      )
  
      for path in config_paths:
          if not os.path.exists(path):
              continue
  
          with open(path) as f_in:
              if path.endswith(".hocon"):
                  config = pyhocon.ConfigFactory.parse_string(
                      f_in.read()
                  )
              else:
                  config = yaml.load(
                      f_in.read(), Loader=yaml.FullLoader
                  )
  
                  def replace_with_env(config):
                      for key, value in config.items():
                          if isinstance(value, str):
                              config[key] = os.path.expandvars(value)
  
                          elif isinstance(value, dict):
                              replace_with_env(value)
  
                  replace_with_env(config)
  
              return config
  
      raise ValueError(
          "None of the config paths {0} exists!".format(config_paths)
      )
  
file_path: studio/studio/db_providers/db_provider_setup.py
imports: import os
  import yaml
  import pyhocon
  from studio.db_providers.local_db_provider import LocalDbProvider
  from studio.db_providers.s3_provider import S3Provider
  from studio.storage.storage_handler import StorageHandler
  from studio.storage.storage_handler_factory import StorageHandlerFactory
  from studio.storage.storage_setup import setup_storage, get_storage_db_provider, set_storage_verbose_level
  from studio.storage.storage_type import StorageType
  from studio.util import logs
  from studio.util.util import parse_verbosity
label_desc: Use image node_id 1 for calling a global function with example usage: get_config(config_file) and returns: config