code: def test_max_step_computation(self):
      def train(
          max_epochs,
          accumulate_grad_batches,
          limit_train_batches,
          devices,
          batch_size,
          dataset_len,
          drop_last,
      ):
          trainer = pl.Trainer(
              max_epochs=max_epochs,
              strategy="ddp_spawn",
              accelerator="cpu",
              devices=devices,
              accumulate_grad_batches=accumulate_grad_batches,
              limit_train_batches=limit_train_batches,
              enable_checkpointing=False,
              enable_progress_bar=False,
          )
          max_steps = optim.lr_scheduler.compute_max_steps(
              max_epochs,
              accumulate_grad_batches,
              limit_train_batches,
              devices,
              dataset_len,
              batch_size,
              drop_last,
          )
          model = ExampleModel(
              batch_size, dataset_len, drop_last, max_steps
          )
          trainer.callbacks.append(Callback())
          trainer.fit(model)
  
      # This test will break once we and lightning upgrade to pytorch 1.7.0 due to a bug fix in pytorch 1.7.0
      train(
          31,
          accumulate_grad_batches=1,
          limit_train_batches=1.0,
          devices=9,
          batch_size=60,
          dataset_len=1613,
          drop_last=True,
      )
      train(
          5,
          accumulate_grad_batches=1,
          limit_train_batches=0.5,
          devices=4,
          batch_size=97,
          dataset_len=498,
          drop_last=False,
      )
      train(
          5,
          accumulate_grad_batches=8,
          limit_train_batches=0.5,
          devices=4,
          batch_size=54,
          dataset_len=629,
          drop_last=True,
      )
      train(
          5,
          accumulate_grad_batches=1,
          limit_train_batches=0.5,
          devices=1,
          batch_size=68,
          dataset_len=488,
          drop_last=False,
      )
      for _ in range(5):
          drop_last = bool(random.randint(0, 1))
          accumulate_grad_batches = random.randint(1, 10)
  
          limit_train_batches_int = random.randint(1, 10)
          limit_train_batches_float = random.uniform(0.5, 1)
          limit_train_batches = random.choice(
              [limit_train_batches_int, limit_train_batches_float]
          )
          max_epochs = random.randint(4, 20)
          devices = random.randint(1, 5)
          dataset_len = random.randint(20, devices * 500)
          batch_size = random.randint(
              math.ceil(5.0 / devices), min(dataset_len // devices, 128)
          )
          train(
              max_epochs,
              accumulate_grad_batches,
              limit_train_batches,
              devices,
              batch_size,
              dataset_len,
              drop_last,
          )
  
imports: import math
  import random
  import omegaconf
  import pytest
  import pytorch_lightning
  import torch
  import torch.optim
  from pytorch_lightning.utilities import rank_zero_only
  from nemo.core import config, optim
  from nemo.core.optim.lr_scheduler import AVAILABLE_SCHEDULERS
  from nemo.core.optim.optimizers import AVAILABLE_OPTIMIZERS
  from nemo.utils import logging
label_desc: Use image node_id 22 for calling the TestOptimizersSchedulers obj's underlying member method code with example usage: obj.test_max_step_computation() without return types