code: def test_invalid_method_in_tuner():
      """Test that an invalid value for `method` raises an error in `Tuner`"""
      trainer = Trainer()
      tuner = Tuner(trainer)
      model = BoringModel()
  
      with pytest.raises(ValueError, match="method .* is invalid."):
          tuner.scale_batch_size(model, method="prediction")
  
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 15 for calling a global function with example usage: test_invalid_method_in_tuner() without return types