code: def save_ckpt(ckpt, file_dir, file_name="model.ckpt", is_best=False):
      if not os.path.exists(file_dir):
          os.makedirs(file_dir)
      ckpt_path = os.path.join(file_dir, file_name)
      torch.save(ckpt, ckpt_path)
      if is_best:
          shutil.copyfile(
              ckpt_path, os.path.join(file_dir, f"best_{file_name}")
          )
  
imports: import math
  import os
  import random
  import sys
  import time
  import warnings
  import numpy
  import numpy
  import shutil
  import logging
  import torch
  import torchvision.transforms
  import torchvision.datasets
  import torch.nn
label_desc: Use image node_id 16 for calling a global function with example usage: save_ckpt(ckpt, file_dir, file_name, is_best) without return types