code: def test_pytorch_lightning_pruning_callback_monitor_is_invalid() -> (
      None
  ):
      study = optuna.create_study(pruner=DeterministicPruner(True))
      trial = study.ask()
      callback = PyTorchLightningPruningCallback(
          trial, "InvalidMonitor"
      )
  
      trainer = pl.Trainer(
          max_epochs=1,
          enable_checkpointing=False,
          callbacks=[callback],
      )
      model = Model()
  
      with pytest.warns(UserWarning):
          callback.on_validation_end(trainer, model)
  
imports: from __future__ import annotations
  from collections.abc import Sequence
  import numpy
  import pytest
  import optuna
  from optuna._imports import try_import
  from optuna.integration import PyTorchLightningPruningCallback
  from optuna.testing.pruners import DeterministicPruner
  from optuna.testing.storages import StorageSupplier
label_desc: Use image node_id 2 for calling a global function with example usage: test_pytorch_lightning_pruning_callback_monitor_is_invalid() without return types