docstr: This function gets checkpoint file path on disk from
  config.trainer.params.resume_from_checkpoint. However if it not specified,
  it gets checkpoint path from config.checkpoint. If config.resume is specified
  it gets the latest checkpoint from the config's save directory (alternatively it
  gets the best checkpoint if config.resume_best is True). If config.resume is not
  specified, then it gets config.resume_file or the checkpoint file from
  config.resume_zoo (in that order).
  
  Returns:
      Dict[str, Any]: a dict containing the following keys,
      `checkpoint_path` (str) local file path for the checkpoint;
      `ckpt` (Dict[str, Any])
      `is_zoo` (Bool) whether or not the checkpoint is specified through a
          zoo identifier
      `config` (Dict[str, Any]]) the config that is stored together with this
          checkpoint
docstr_tok: ["This","function","gets","checkpoint","file","path","on","disk","from","config.trainer.params.resume_from_checkpoint",".","However","if","it","not","specified",",","it","gets","checkpoint","path","from","config.checkpoint",".","If","config.resume","is","specified","it","gets","the","latest","checkpoint","from","the","config","'s","save","directory","(","alternatively","it","gets","the","best","checkpoint","if","config.resume_best","is","True",")",".","If","config.resume","is","not","specified",",","then","it","gets","config.resume_file","or","the","checkpoint","file","from","config.resume_zoo","(","in","that","order",")",".","Returns",":","Dict","[","str",",","Any","]",":","a","dict","containing","the","following","keys",",","`","checkpoint_path","`","(","str",")","local","file","path","for","the","checkpoint",";","`","ckpt","`","(","Dict","[","str",",","Any","]",")","`","is_zoo","`","(","Bool",")","whether","or","not","the","checkpoint","is","specified","through","a","zoo","identifier","`","config","`","(","Dict","[","str",",","Any","]","]",")","the","config","that","is","stored","together","with","this","checkpoint"]
code: def get_checkpoint_data(self) -> Dict[str, Any]:
      """This function gets checkpoint file path on disk from
      config.trainer.params.resume_from_checkpoint. However if it not specified,
      it gets checkpoint path from config.checkpoint. If config.resume is specified
      it gets the latest checkpoint from the config's save directory (alternatively it
      gets the best checkpoint if config.resume_best is True). If config.resume is not
      specified, then it gets config.resume_file or the checkpoint file from
      config.resume_zoo (in that order).
  
      Returns:
          Dict[str, Any]: a dict containing the following keys,
          `checkpoint_path` (str) local file path for the checkpoint;
          `ckpt` (Dict[str, Any])
          `is_zoo` (Bool) whether or not the checkpoint is specified through a
              zoo identifier
          `config` (Dict[str, Any]]) the config that is stored together with this
              checkpoint
      """
      # get ckpt file path from config.trainer.params.resume_from_checkpoint
      path = self.config.trainer.params.get(
          "resume_from_checkpoint", None
      )
      if path is not None:
          is_zoo = self.is_zoo_path(path)
          ckpt_filepath = path
          if is_zoo:
              folder = download_pretrained_model(path)
              ckpt_filepath = get_ckpt_path_from_folder(folder)
              ckpt = get_ckpt_from_path(ckpt_filepath)
              config = get_config_from_folder_or_ckpt(folder, ckpt)
          else:
              ckpt = get_ckpt_from_path(ckpt_filepath)
              config = None
  
          return {
              "ckpt": ckpt,
              "checkpoint_path": ckpt_filepath,
              "is_zoo": is_zoo,
              "config": config,
          }
  
      is_zoo = False
      config = None
      ckpt = None
      # get ckpt file path from config.checkpoint
      ckpt_config = self.config.checkpoint
      suffix = (
          "best.ckpt" if ckpt_config.resume_best else "current.ckpt"
      )
      path = os.path.join(get_mmf_env(key="save_dir"), suffix)
      ckpt_filepath = None
      resume_from_specified_path = (
          ckpt_config.resume_file is not None
          or ckpt_config.resume_zoo is not None
      ) and (not ckpt_config.resume or not PathManager.exists(path))
      if resume_from_specified_path:
          if ckpt_config.resume_file and PathManager.exists(
              ckpt_config.resume_file
          ):
              ckpt_filepath = ckpt_config.resume_file
          elif ckpt_config.resume_zoo is not None:
              is_zoo = True
              folder = download_pretrained_model(ckpt_config.resume_zoo)
              ckpt_filepath = get_ckpt_path_from_folder(folder)
              ckpt = get_ckpt_from_path(ckpt_filepath)
              config = get_config_from_folder_or_ckpt(folder, ckpt)
          else:
              raise RuntimeError(
                  f"{ckpt_config.resume_file} doesn't exist"
              )
  
      if ckpt_config.resume and PathManager.exists(path):
          ckpt_filepath = path
  
      if ckpt_filepath is not None:
          ckpt = get_ckpt_from_path(ckpt_filepath)
  
      return {
          "ckpt": ckpt,
          "checkpoint_path": ckpt_filepath,
          "is_zoo": is_zoo,
          "config": config,
      }
  
imports: import logging
  import math
  import os
  from typing import Any, Dict, List, Optional
  import omegaconf
  from mmf.common.registry import registry
  from mmf.datasets.lightning_multi_datamodule import LightningMultiDataModule
  from mmf.modules.metrics import Metrics
  from mmf.trainers.base_trainer import BaseTrainer
  from mmf.trainers.lightning_core.loop_callback import LightningLoopCallback
  from mmf.trainers.lightning_core.loop_callback_with_torchmetrics import LightningTorchMetricsCallback
  from mmf.trainers.lightning_core.torchmetric import LightningTorchMetrics
  from mmf.utils.build import build_lightning_model
  from mmf.utils.checkpoint import get_ckpt_from_path, get_ckpt_path_from_folder, get_config_from_folder_or_ckpt
  from mmf.utils.checkpoint_updater import is_model_only_checkpoint
  from mmf.utils.configuration import get_mmf_env
  from mmf.utils.download import download_pretrained_model
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_max_updates, print_model_parameters
  from mmf.utils.logger import setup_output_folder, TensorboardLogger
  from omegaconf import DictConfig, OmegaConf
  from pytorch_lightning import seed_everything, Trainer
  from pytorch_lightning.callbacks import ModelCheckpoint
label_desc: Use image node_id 10 for calling the LightningTrainer obj's underlying member method code with example usage: obj.get_checkpoint_data() and returns: dict, dict