code: def test_max_batches_leq_steps_completed(
      self,
      max_batches: int,
      steps_completed: int,
      tmp_path: pathlib.Path,
  ):
      checkpoint_dir = str(tmp_path.joinpath("checkpoint"))
      (
          trial_A,
          trial_controller_A,
      ) = pytorch_utils.create_trial_and_trial_controller(
          trial_class=pytorch_onevar_model.OneVarTrial,
          checkpoint_dir=checkpoint_dir,
          hparams=self.hparams,
          trial_seed=self.trial_seed,
          max_batches=steps_completed,
          min_validation_batches=steps_completed,
          min_checkpoint_batches=steps_completed,
      )
      trial_controller_A.run()
  
      checkpoint_callback = trial_A.checkpoint_callback
      assert (
          len(checkpoint_callback.uuids) == 1
      ), "trial did not return a checkpoint UUID"
  
      (
          trial_B,
          trial_controller_B,
      ) = pytorch_utils.create_trial_and_trial_controller(
          trial_class=pytorch_onevar_model.OneVarTrial,
          checkpoint_dir=checkpoint_dir,
          hparams=self.hparams,
          trial_seed=self.trial_seed,
          max_batches=max_batches,
          min_validation_batches=1,
          min_checkpoint_batches=1,
          latest_checkpoint=checkpoint_callback.uuids[0],
      )
      trial_controller_B.run()
  
      assert len(trial_B.metrics_callback.validation_metrics) == 0
      assert len(trial_B.metrics_callback.training_metrics) == 0
  
imports: import contextlib
  import importlib
  import io
  import os
  import pathlib
  import sys
  import typing
  from unittest import mock
  import numpy
  import pytest
  import torch
  from _pytest import monkeypatch
  from torch.distributed import launcher
  import determined
  from determined import pytorch
  from tests.experiment import pytorch_utils, utils
  from tests.experiment.fixtures import pytorch_onevar_model
label_desc: Use image node_id 31 for calling the TestPyTorchTrial obj's underlying member method code with example usage: obj.test_max_batches_leq_steps_completed(max_batches, steps_completed, tmp_path) without return types