code: def get_checkpoint_and_refs_dir(
      model_id: str,
      bucket_uri: str,
      s3_sync_args: Optional[List[str]] = None,
      mkdir: bool = False,
  ) -> str:
      from transformers.utils.hub import TRANSFORMERS_CACHE
  
      f_hash = get_hash_from_bucket(bucket_uri, s3_sync_args)
  
      path = os.path.join(
          TRANSFORMERS_CACHE, f"models--{model_id.replace('/', '--')}"
      )
  
      refs_dir = os.path.join(path, "refs")
      checkpoint_dir = os.path.join(path, "snapshots", f_hash)
  
      if mkdir:
          os.makedirs(refs_dir, exist_ok=True)
          os.makedirs(checkpoint_dir, exist_ok=True)
  
      return checkpoint_dir, refs_dir
  
file_path: ray/doc/source/templates/04_finetuning_llms_with_deepspeed/utils.py
imports: from typing import List, Optional
  import os
  import subprocess
  import logging
label_desc: Use image node_id 2 for calling a global function with example usage: get_checkpoint_and_refs_dir(model_id, bucket_uri, s3_sync_args, mkdir) and returns: checkpoint_dir,  refs_dir