code: def save_checkpoint(
      state, args, is_best, filename="checkpoint.pth.tar"
  ):
      """Saves checkpoint to disk"""
      if args.model == "acnet":
          directory = (
              "%s/model/%s_model_%s_%s_thvflag%s_%s_gpu%dbs%depochs%d/%s/"
              % (
                  args.dataset,
                  args.model,
                  args.backbone,
                  args.context_head,
                  args.thv_learn_flag,
                  args.dataset,
                  args.gpu_nums,
                  args.batch_size,
                  args.epochs,
                  args.checkname,
              )
          )
      else:
          directory = (
              "%s/model/%s_model_%s_%s_gpu%dbs%depochs%d/%s/"
              % (
                  args.dataset,
                  args.model,
                  args.backbone,
                  args.dataset,
                  args.gpu_nums,
                  args.batch_size,
                  args.epochs,
                  args.checkname,
              )
          )
  
      if not os.path.exists(directory):
          os.makedirs(directory)
      filename = directory + filename
      print("saving file:", filename)
      torch.save(state, filename)
      if is_best:
          shutil.copyfile(filename, directory + "model_best.pth.tar")
  
file_path: pywick/pywick/models/segmentation/testnets/tkcnet/files.py
imports: import os
  import requests
  import errno
  import shutil
  import hashlib
  from tqdm import tqdm
  import torch
label_desc: Use image node_id 1 for calling a global function with example usage: save_checkpoint(state, args, is_best, filename) without return types