code: def read_profiles(profiles_dir=None):
      
      if profiles_dir is None:
          profiles_dir = PROFILES_DIR
  
      raw_profiles = read_profile(profiles_dir)
  
      if raw_profiles is None:
          profiles = {}
      else:
          profiles = {k: v for (k, v) in raw_profiles.items() if k != 'config'}
  
      return profiles
docs: This is only used for some error handling