code: def load_config(cls, config_path, config_dict, credstore_env=None):
          
  
          if not config_dict:
              config_file = find_config_file(config_path)
  
              if not config_file:
                  return cls({}, credstore_env)
              try:
                  with open(config_file) as f:
                      config_dict = json.load(f)
              except (IOError, KeyError, ValueError) as e:
                  # Likely missing new Docker config file or it's in an
                  # unknown format, continue to attempt to read old location
                  # and format.
                  log.debug(e)
                  return cls(_load_legacy_config(config_file), credstore_env)
  
          res = {}
          if config_dict.get('auths'):
              log.debug("Found 'auths' section")
              res.update({
                  'auths': cls.parse_auth(
                      config_dict.pop('auths'), raise_on_error=True
                  )
              })
          if config_dict.get('credsStore'):
              log.debug("Found 'credsStore' section")
              res.update({'credsStore': config_dict.pop('credsStore')})
          if config_dict.get('credHelpers'):
              log.debug("Found 'credHelpers' section")
              res.update({'credHelpers': config_dict.pop('credHelpers')})
          if res:
              return cls(res, credstore_env)
  
          log.debug(
              "Couldn't find auth-related section ; attempting to interpret "
              "as auth-only file"
          )
          return cls({'auths': cls.parse_auth(config_dict)}, credstore_env)
docs: Loads authentication data from a Docker configuration file in the given
          root directory or if config_path is passed use given path.
          Lookup priority:
              explicit config_path parameter > DOCKER_CONFIG environment
              variable > ~/.docker/config.json > ~/.dockercfg