code: def resolve_pretrained_cfg(
      variant: str,
      pretrained_cfg=None,
      pretrained_cfg_overlay=None,
  ) -> PretrainedCfg:
      model_with_tag = variant
      pretrained_tag = None
      if pretrained_cfg:
          if isinstance(pretrained_cfg, dict):
              # pretrained_cfg dict passed as arg, validate by converting to PretrainedCfg
              pretrained_cfg = PretrainedCfg(**pretrained_cfg)
          elif isinstance(pretrained_cfg, str):
              pretrained_tag = pretrained_cfg
              pretrained_cfg = None
  
      # fallback to looking up pretrained cfg in model registry by variant identifier
      if not pretrained_cfg:
          if pretrained_tag:
              model_with_tag = ".".join([variant, pretrained_tag])
          pretrained_cfg = get_pretrained_cfg(model_with_tag)
  
      if not pretrained_cfg:
          _logger.warning(
              f"No pretrained configuration specified for {model_with_tag} model. Using a default."
              f" Please add a config to the model pretrained_cfg registry or pass explicitly."
          )
          pretrained_cfg = PretrainedCfg()  # instance with defaults
  
      pretrained_cfg_overlay = pretrained_cfg_overlay or {}
      if not pretrained_cfg.architecture:
          pretrained_cfg_overlay.setdefault("architecture", variant)
      pretrained_cfg = dataclasses.replace(
          pretrained_cfg, **pretrained_cfg_overlay
      )
  
      return pretrained_cfg
  
imports: import dataclasses
  import logging
  import os
  from copy import deepcopy
  from typing import Optional, Dict, Callable, Any, Tuple
  from torch import nn
  from torch.hub import load_state_dict_from_url
  from timm.models._features import FeatureListNet, FeatureHookNet
  from timm.models._features_fx import FeatureGraphNet
  from timm.models._helpers import load_state_dict
  from timm.models._hub import has_hf_hub, download_cached_file, check_cached_file, load_state_dict_from_hf
  from timm.models._manipulate import adapt_input_conv
  from timm.models._pretrained import PretrainedCfg
  from timm.models._prune import adapt_model_from_file
  from timm.models._registry import get_pretrained_cfg
label_desc: Use image node_id 9 for calling a global function with example usage: resolve_pretrained_cfg(variant, pretrained_cfg, pretrained_cfg_overlay) and returns: pretrained_cfg