class_docstr: The TextAttack attack resume recipe module:
  
  A command line parser to resume a checkpointed attack from user
  specifications.
code: def _parse_checkpoint_from_args(self, args):
      file_name = os.path.basename(args.checkpoint_file)
      if file_name.lower() == "latest":
          dir_path = os.path.dirname(args.checkpoint_file)
          dir_path = dir_path if dir_path else "."
          chkpt_file_names = [
              f for f in os.listdir(dir_path) if f.endswith(".ta.chkpt")
          ]
          assert chkpt_file_names, "AttackCheckpoint directory is empty"
          timestamps = [
              int(f.replace(".ta.chkpt", "")) for f in chkpt_file_names
          ]
          latest_file = str(max(timestamps)) + ".ta.chkpt"
          checkpoint_path = os.path.join(dir_path, latest_file)
      else:
          checkpoint_path = args.checkpoint_file
  
      checkpoint = textattack.shared.AttackCheckpoint.load(
          checkpoint_path
      )
  
      return checkpoint
  
file_path: TextAttack/textattack/commands/attack_resume_command.py
imports: from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser
  import os
  import textattack
  from textattack import Attacker, CommandLineAttackArgs, DatasetArgs, ModelArgs
  from textattack.commands import TextAttackCommand
label_desc: Use image node_id 2 for calling the AttackResumeCommand obj's underlying member method code with example usage: obj._parse_checkpoint_from_args(args) and returns: checkpoint