code: def _load_counts_and_lr_scheduler(self, ckpt):
      ckpt_config = self.trainer.config.checkpoint
      if "best_update" in ckpt:
          if ckpt_config.resume_best:
              self.trainer.num_updates = ckpt.get(
                  "best_update", self.trainer.num_updates
              )
              self.trainer.current_iteration = ckpt.get(
                  "best_iteration", self.trainer.current_iteration
              )
          else:
              self.trainer.num_updates = ckpt.get(
                  "num_updates", self.trainer.num_updates
              )
              self.trainer.current_iteration = ckpt.get(
                  "current_iteration", self.trainer.current_iteration
              )
  
          self.trainer.current_epoch = ckpt.get(
              "current_epoch", self.trainer.current_epoch
          )
      elif "best_iteration" in ckpt:
          # Preserve old behavior for old checkpoints where we always
          # load best iteration
          if ckpt_config.resume_best and "current_iteration" in ckpt:
              self.trainer.current_iteration = ckpt["current_iteration"]
          else:
              self.trainer.current_iteration = ckpt.get(
                  "best_iteration", self.trainer.current_iteration
              )
  
          self.trainer.num_updates = self.trainer.current_iteration
  
      lr_scheduler = self.trainer.lr_scheduler_callback
  
      if (
          lr_scheduler is not None
          and getattr(lr_scheduler, "_scheduler", None) is not None
      ):
          lr_scheduler = lr_scheduler._scheduler
  
          if "lr_scheduler" in ckpt:
              lr_scheduler.load_state_dict(ckpt["lr_scheduler"])
          else:
              warnings.warn(
                  "'lr_scheduler' key is not present in the "
                  "checkpoint asked to be loaded. Setting lr_scheduler's "
                  "last_epoch to current_iteration."
              )
              lr_scheduler.last_epoch = self.trainer.current_iteration
  
      registry.register(
          "current_iteration", self.trainer.current_iteration
      )
      registry.register("num_updates", self.trainer.num_updates)
  
      self.trainer.current_epoch = ckpt.get(
          "best_epoch", self.trainer.current_epoch
      )
      registry.register("current_epoch", self.trainer.current_epoch)
  
imports: import glob
  import importlib
  import logging
  import os
  import sys
  import warnings
  from typing import Any, Dict
  import torch
  from mmf.common.registry import registry
  from mmf.utils.checkpoint_updater import get_pretrained_state_mapping_checkpoint
  from mmf.utils.configuration import get_mmf_env, load_yaml
  from mmf.utils.distributed import is_main, is_xla, open_if_main, synchronize
  from mmf.utils.download import download_pretrained_model
  from mmf.utils.file_io import PathManager
  from mmf.utils.general import get_current_device, updir
  from mmf.utils.xla import save_xla_ckpt
  from omegaconf import OmegaConf
label_desc: Use image node_id 7 for calling the Checkpoint obj's underlying member method code with example usage: obj._load_counts_and_lr_scheduler(ckpt) without return types