code: def resolve_vae_near_checkpoint(checkpoint_file) -> VaeResolution:
      vae_near_checkpoint = find_vae_near_checkpoint(checkpoint_file)
      if vae_near_checkpoint is not None and (
          not shared.opts.sd_vae_overrides_per_model_preferences
          or is_automatic()
      ):
          return VaeResolution(
              vae_near_checkpoint, "found near the checkpoint"
          )
  
      return VaeResolution(resolved=False)
  
imports: import os
  import collections
  from dataclasses import dataclass
  from modules import paths, shared, devices, script_callbacks, sd_models, extra_networks, lowvram, sd_hijack, hashes
  import glob
  from copy import deepcopy
label_desc: Use image node_id 13 for calling a global function with example usage: resolve_vae_near_checkpoint(checkpoint_file) and returns: VaeResolution, VaeResolution