docstr: Load authentication data from a Docker configuration file.
  
  If the config_path is not passed in it looks for a configuration file in the
  root directory.
  
  Lookup priority:
      explicit config_path parameter > DOCKER_CONFIG environment
      variable > ~/.docker/config.json > ~/.dockercfg.
docstr_tok: ["Load","authentication","data","from","a","Docker","configuration","file",".","If","the","config_path","is","not","passed","in","it","looks","for","a","configuration","file","in","the","root","directory",".","Lookup","priority",":","explicit","config_path","parameter",">","DOCKER_CONFIG","environment","variable",">","~\/.docker\/config.json",">","~\/.dockercfg","."]
code: def load_config(
      cls,
      config_path: Optional[str],
      config_dict: Optional[Dict[str, Any]],
      credstore_env: Optional[Mapping] = None,
  ) -> "AuthConfig":
      """Load authentication data from a Docker configuration file.
  
      If the config_path is not passed in it looks for a configuration file in the
      root directory.
  
      Lookup priority:
          explicit config_path parameter > DOCKER_CONFIG environment
          variable > ~/.docker/config.json > ~/.dockercfg.
      """
      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 (OSError, 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 = {}
      assert isinstance(config_dict, Dict)  # worship mypy
      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)
  
imports: import base64
  import json
  import logging
  import os
  import platform
  from typing import Any, Dict, Mapping, Optional, Tuple, Union
  import dockerpycreds
label_desc: Use image node_id 3 for calling the AuthConfig obj's underlying member method code with example usage: obj.load_config(cls, config_path, config_dict, credstore_env) and returns: cls, cls, cls, cls