code: def _get_full_path_of_ckpt(args):
      if args.from_checkpoint is None:
          args.last_epoch_of_checkpoint = -1
          return
  
      def _check_file_exist(path_with_prefix):
          pdopt_path = path_with_prefix + _PDOPT_SUFFIX
          pdparams_path = path_with_prefix + _PDPARAMS_SUFFIX
          found = False
          if os.path.exists(pdopt_path) and os.path.exists(
              pdparams_path
          ):
              found = True
          return found, pdopt_path, pdparams_path
  
      target_from_checkpoint = os.path.join(
          args.from_checkpoint, args.model_prefix
      )
      if args.last_epoch_of_checkpoint is None:
          args.last_epoch_of_checkpoint = -1
      elif args.last_epoch_of_checkpoint == _AUTO_LAST_EPOCH:
          folders = os.listdir(args.from_checkpoint)
          args.last_epoch_of_checkpoint = -1
          for folder in folders:
              tmp_ckpt_path = os.path.join(
                  args.from_checkpoint, folder, args.model_prefix
              )
  
              try:
                  folder = int(folder)
              except ValueError:
                  logging.warning(
                      f"Skip folder '{folder}' since its name is not integer-convertable."
                  )
                  continue
  
              if (
                  folder > args.last_epoch_of_checkpoint
                  and _check_file_exist(tmp_ckpt_path)[0]
              ):
                  args.last_epoch_of_checkpoint = folder
          epoch_with_prefix = (
              os.path.join(
                  str(args.last_epoch_of_checkpoint), args.model_prefix
              )
              if args.last_epoch_of_checkpoint > -1
              else args.model_prefix
          )
          target_from_checkpoint = os.path.join(
              args.from_checkpoint, epoch_with_prefix
          )
      else:
          try:
              args.last_epoch_of_checkpoint = int(
                  args.last_epoch_of_checkpoint
              )
          except ValueError:
              raise ValueError(
                  f"The value of --last-epoch-of-checkpoint should be None, {_AUTO_LAST_EPOCH}"
                  f" or integer >= 0, but receive {args.last_epoch_of_checkpoint}"
              )
  
      args.from_checkpoint = target_from_checkpoint
      found, pdopt_path, pdparams_path = _check_file_exist(
          args.from_checkpoint
      )
      if not found:
          args.from_checkpoint = None
          args.last_epoch_of_checkpoint = -1
          logging.warning(
              f"Cannot find {pdopt_path} and {pdparams_path}, disable --from-checkpoint."
          )
  
file_path: DALI/docs/examples/use_cases/paddle/resnet50/utils/config.py
imports: import os
  import copy
  import argparse
  import logging
  import distutils.util
  import dllogger
  from utils.mode import RunScope
  from utils.utility import get_num_trainers
  from utils.save_load import _PDOPT_SUFFIX, _PDPARAMS_SUFFIX
label_desc: Use image node_id 1 for calling a global function with example usage: _get_full_path_of_ckpt(args) and returns: found,  pdopt_path,  pdparams_path