code: def get_snapshot_dir_from_model_version(version):
      model_id = model_version_map[version]["model_id"]
      repo_id, model_version = model_id.split("/")
      model_dir = REPO_ID_SEPARATOR.join(
          ["models", repo_id, model_version]
      )
      snapshot_dir = os.path.join("models", model_dir, "snapshots")
      snapshots = os.listdir(snapshot_dir)
      assert (
          len(snapshots) != 0
      ), "No models available, please download the model first"
      latest_snapshot = snapshots[0]
      mtime = os.path.getmtime(os.path.join(snapshot_dir, snapshots[0]))
      # check if there are newer snapshots
      for snap in snapshots:
          dir = os.path.join(snapshot_dir, snap)
          if os.path.getmtime(dir) > mtime:
              mtime = os.path.getmtime(dir)
              latest_snapshot = snap
  
      return os.path.join(snapshot_dir, latest_snapshot)
  
imports: import os
  import shutil
  from huggingface_hub.constants import REPO_ID_SEPARATOR
label_desc: Use image node_id 1 for calling a global function with example usage: get_snapshot_dir_from_model_version(version) and returns: os