(config_path)
return config
load config from file
load config from file
load config from file
def load_config(config_path):
  ''' load config from file '''
  if isinstance(config_path, Path):
    config_path = str(config_path)

  with open(config_path, 'r') as f:  #pylint: disable=invalid-name
    if config_path.endswith('yml') or config_path.endswith('yaml'):
      config = yaml.load(f, Loader=yaml.SafeLoader)
    elif config_path.endswith('json'):
      config = json.load(f)
  # check config
  # valid_config(config)
  config_join_project_dir(config)
  return config
def load_config ( config_path ) : if isinstance ( config_path , Path ) : config_path = str ( config_path ) with open ( config_path , 'r' ) as f : #pylint: disable=invalid-name if config_path . endswith ( 'yml' ) or config_path . endswith ( 'yaml' ) : config = yaml . load ( f , Loader = yaml . SafeLoader ) elif config_path . endswith ( 'json' ) : config = json . load ( f ) # check config # valid_config(config) config_join_project_dir ( config ) return config