code: def _calculate_max_updates(self) -> None:
      self._max_updates = self.trainer_config.max_steps
      self._max_epochs = self.trainer_config.max_epochs
      if self._max_updates is None and self._max_epochs is None:
          raise ValueError(
              "Neither max_updates nor max_epochs is specified."
          )
  
      self._max_updates, max_epochs = get_max_updates(
          self._max_updates,
          self._max_epochs,
          self.train_loader,
          self.trainer_config.accumulate_grad_batches,
      )
      if max_epochs and max_epochs != math.inf:
          self._max_epochs = math.ceil(max_epochs)
      return self._max_updates
  
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 22 for calling the LightningTrainer obj's underlying member method code with example usage: obj._calculate_max_updates() and returns: self