code: def is_checkpoint_epoch(cfg, cur_epoch, multigrid_schedule=None):
      """
      Determine if a checkpoint should be saved on current epoch.
      Args:
          cfg (CfgNode): configs to save.
          cur_epoch (int): current number of epoch of the model.
          multigrid_schedule (List): schedule for multigrid training.
      """
      if cur_epoch + 1 == cfg.SOLVER.MAX_EPOCH:
          return True
      if multigrid_schedule is not None:
          prev_epoch = 0
          for s in multigrid_schedule:
              if cur_epoch < s[-1]:
                  period = max(
                      (s[-1] - prev_epoch) // cfg.MULTIGRID.EVAL_FREQ
                      + 1,
                      1,
                  )
                  return (s[-1] - 1 - cur_epoch) % period == 0
              prev_epoch = s[-1]
  
      return (cur_epoch + 1) % cfg.TRAIN.CHECKPOINT_PERIOD == 0
  
imports: import copy
  import math
  import numpy
  import os
  import pickle
  from collections import OrderedDict
  import torch
  import slowfast.utils.distributed
  import slowfast.utils.logging
  from slowfast.utils.c2_model_loading import get_name_convert_func
  from slowfast.utils.env import checkpoint_pathmgr
label_desc: Use image node_id 6 for calling a global function with example usage: is_checkpoint_epoch(cfg, cur_epoch, multigrid_schedule) and returns: unknown, True, unknown