code: def test_tuner_with_evaluation_methods(tmpdir, trainer_fn):
      """Test batch size tuner with Trainer's evaluation methods."""
      before_batch_size = 2
      max_trials = 4
      expected_scaled_batch_size = before_batch_size ** (max_trials + 1)
  
      model = BatchSizeModel(batch_size=before_batch_size)
      trainer = Trainer(default_root_dir=tmpdir, max_epochs=100)
      tuner = Tuner(trainer)
      tuner.scale_batch_size(
          model,
          max_trials=max_trials,
          batch_arg_name="batch_size",
          method=trainer_fn,
      )
  
      after_batch_size = model.batch_size
      loop = getattr(trainer, f"{trainer_fn}_loop")
  
      assert trainer.global_step == 0
      assert trainer.current_epoch == 0
      assert loop.batch_progress.current.completed == 0
      assert expected_scaled_batch_size == after_batch_size
      assert not any(
          f
          for f in os.listdir(tmpdir)
          if f.startswith(".scale_batch_size_temp_model")
      )
  
imports: import logging
  import os
  from copy import deepcopy
  from unittest.mock import patch
  import pytest
  import torch
  from lightning.pytorch import Trainer
  from lightning.pytorch.callbacks.batch_size_finder import BatchSizeFinder
  from lightning.pytorch.demos.boring_classes import BoringDataModule, BoringModel, RandomDataset
  from lightning.pytorch.tuner.tuning import Tuner
  from lightning.pytorch.utilities.exceptions import MisconfigurationException
  from lightning_utilities.test.warning import no_warning_call
  from torch.utils.data import DataLoader
  from tests_pytorch.helpers.runif import RunIf
label_desc: Use image node_id 13 for calling a global function with example usage: test_tuner_with_evaluation_methods(tmpdir, trainer_fn) without return types