code: def get_last_checkpoint(path_to_job, task):
      """
      Get the last checkpoint from the checkpointing folder.
      Args:
          path_to_job (string): the path to the folder of the current job.
      """
  
      d = get_checkpoint_dir(path_to_job)
      names = pathmgr.ls(d) if pathmgr.exists(d) else []
      if task != "":
          names = [
              f for f in names if "{}_checkpoint".format(task) in f
          ]
      else:
          names = [f for f in names if f.startswith("checkpoint")]
      if len(names) == 0:
          return None
      # Sort the checkpoints by epoch.
      name = sorted(names)[-1]
      return os.path.join(d, name)
  
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 4 for calling a global function with example usage: get_last_checkpoint(path_to_job, task) and returns: os, None