code: def resolve_authconfig(
      authconfig: Dict,
      registry: Optional[str] = None,
      credstore_env: Optional[Mapping] = None,
  ) -> Optional[Dict[str, Any]]:
      if not isinstance(authconfig, AuthConfig):
          authconfig = AuthConfig(authconfig, credstore_env)
      return authconfig.resolve_authconfig(registry)
  
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 9 for calling a global function with example usage: resolve_authconfig(authconfig, registry, credstore_env) and returns: authconfig