code: def get_latest_checkpoint(
      directory: pathlib.PosixPath, args: argparse.Namespace
  ):
      latest_checkpoint = None
      checkpoint_files = list(
          directory.glob(f"*{args.checkpoint_id_pattern}*")
      )
      if checkpoint_files:
          latest_checkpoint = 0
          for checkpoint_file in checkpoint_files:
              checkpoint_file = str(checkpoint_file).split("/")[-1]
              checkpoint_epoch = re.findall(
                  args.checkpoint_extract_pattern, checkpoint_file
              )
              checkpoint_epoch = int(checkpoint_epoch[0])
              if checkpoint_epoch > latest_checkpoint:
                  latest_checkpoint = checkpoint_epoch
          pass
      else:
          print("Unable to parse latest checkpoint information")
      return latest_checkpoint
  
file_path: vissl/extra_scripts/experiment_spreadsheet_from_logs.py
imports: import argparse
  import ast
  import collections
  import os
  import pathlib
  import re
  import typing
  import pandas
label_desc: Use image node_id 6 for calling a global function with example usage: get_latest_checkpoint(directory, args) and returns: latest_checkpoint