code: def save_checkpoint(state, is_best, filename):
      r"""Save the model to a temporary file first, then copy it to filename,
      in case signals interrupt the torch.save() process.
      """
      torch.save(state, filename)
      logging.info(f"Checkpoint saved to {filename}")
  
      if is_best:
          path, best_filename = os.path.split(filename)
          best_filename = os.path.join(path, "best_" + best_filename)
          shutil.copyfile(filename, best_filename)
          logging.info(
              f"Current best checkpoint saved to {best_filename}"
          )
  
file_path: audio/examples/pipeline_tacotron2/utils.py
imports: import logging
  import os
  import shutil
  from typing import Callable, List, Tuple
  import torch
  from torch import Tensor
label_desc: Use image node_id 1 for calling a global function with example usage: save_checkpoint(state, is_best, filename) without return types