code: def save_checkpoint(
      self,
      state,
      is_best,
      filename,
  ):
      if (
          torch.distributed.is_initialized()
          and torch.distributed.get_rank() != 0
      ):
          assert False
  
      full_path = self.get_full_path(filename)
  
      print("SAVING {}".format(full_path))
      torch.save(state, full_path)
      self.checkpoints.append(filename)
  
      shutil.copyfile(full_path, self.get_full_path(self.last_filename))
  
      if is_best:
          shutil.copyfile(
              full_path, self.get_full_path("model_best.pth.tar")
          )
  
      self.cleanup()
  
imports: import math
  import os
  import numpy
  import torch
  import shutil
  import signal
  import torch.distributed
label_desc: Use image node_id 4 for calling the Checkpointer obj's underlying member method code with example usage: obj.save_checkpoint(state, is_best, filename) without return types