class_docstr: This class implements the functionality for checkpointing your model and trainer state
  during training. It is agnostic as to what those states look like (they are typed as
  `Dict[str, Any]`), but they will be fed to `torch.save` so they should be serializable
  in that sense. They will also be restored as `Dict[str, Any]`, which means the calling
  code is responsible for knowing what to do with them.
  
  # Parameters
  
  save_completed_epochs : `bool`, (default=`True`)
      Saves model and trainer state at the end of each completed epoch.
  save_every_num_seconds : `int`, optional (default=`None`)
      If set, makes sure we never go longer than this number of seconds between saving a model.
  save_every_num_batches : `int`, optional (default=`None`)
      If set, makes sure we never go longer than this number of batches between saving a model.
  keep_most_recent_by_count : `int`, optional (default=`2`)
      Sets the number of model checkpoints to keep on disk. If both `keep_most_recent_by_count` and
      `keep_most_recent_by_age` are set, we'll keep checkpoints that satisfy either criterion.
      If both are `None`, we keep all checkpoints.
  keep_most_recent_by_age : `int`, optional (default=`None`)
      Sets the number of seconds we'll keep a checkpoint before deleting it. If both
      `keep_most_recent_by_count` and `keep_most_recent_by_age` are set, we'll keep checkpoints
      that satisfy either criterion. If both are `None`, we keep all checkpoints.
class_docstr_tok: ["This","class","implements","the","functionality","for","checkpointing","your","model","and","trainer","state","during","training",".","It","is","agnostic","as","to","what","those","states","look","like","(","they","are","typed","as","`","Dict","[","str",",","Any","]","`",")",",","but","they","will","be","fed","to","`","torch.save","`","so","they","should","be","serializable","in","that","sense",".","They","will","also","be","restored","as","`","Dict","[","str",",","Any","]","`",",","which","means","the","calling","code","is","responsible","for","knowing","what","to","do","with","them",".","#","Parameters","save_completed_epochs",":","`","bool","`",",","(","default=","`","True","`",")","Saves","model","and","trainer","state","at","the","end","of","each","completed","epoch",".","save_every_num_seconds",":","`","int","`",",","optional","(","default=","`","None","`",")","If","set",",","makes","sure","we","never","go","longer","than","this","number","of","seconds","between","saving","a","model",".","save_every_num_batches",":","`","int","`",",","optional","(","default=","`","None","`",")","If","set",",","makes","sure","we","never","go","longer","than","this","number","of","batches","between","saving","a","model",".","keep_most_recent_by_count",":","`","int","`",",","optional","(","default=","`","2","`",")","Sets","the","number","of","model","checkpoints","to","keep","on","disk",".","If","both","`","keep_most_recent_by_count","`","and","`","keep_most_recent_by_age","`","are","set",",","we","'ll","keep","checkpoints","that","satisfy","either","criterion",".","If","both","are","`","None","`",",","we","keep","all","checkpoints",".","keep_most_recent_by_age",":","`","int","`",",","optional","(","default=","`","None","`",")","Sets","the","number","of","seconds","we","'ll","keep","a","checkpoint","before","deleting","it",".","If","both","`","keep_most_recent_by_count","`","and","`","keep_most_recent_by_age","`","are","set",",","we","'ll","keep","checkpoints","that","satisfy","either","criterion",".","If","both","are","`","None","`",",","we","keep","all","checkpoints","."]
docstr: Return the location of the latest model and training state files.
  If there isn't a valid checkpoint then return None.
docstr_tok: ["Return","the","location","of","the","latest","model","and","training","state","files",".","If","there","is","n't","a","valid","checkpoint","then","return","None","."]
code: def find_latest_checkpoint(self) -> Optional[Tuple[str, str]]:
      """
      Return the location of the latest model and training state files.
      If there isn't a valid checkpoint then return None.
      """
      checkpoints = self._find_all_checkpoints()
      if len(checkpoints) <= 0:
          return None
      last_checkpoint = max(checkpoints)
      return self._model_state_path(
          *last_checkpoint
      ), self._training_state_path(*last_checkpoint)
  
imports: import glob
  from typing import Tuple, Optional, Set, Union
  import logging
  import os
  import re
  import time
  import torch
  import torch.distributed
  from allennlp.common import Registrable
  from allennlp.common.util import is_distributed
  from allennlp.nn import util
  from allennlp.training.trainer import Trainer, TrainerCheckpoint
label_desc: Use image node_id 11 for calling the Checkpointer obj's underlying member method code with example usage: obj.find_latest_checkpoint() and returns: self,  self, None