code: def test_pytorch_lightning_pruning_callback_ddp_unsupported_storage() -> (
      None
  ):
      storage_mode = "inmemory"
  
      def objective(trial: optuna.trial.Trial) -> float:
          callback = PyTorchLightningPruningCallback(
              trial, monitor="accuracy"
          )
          trainer = pl.Trainer(
              max_epochs=1,
              accelerator="cpu",
              devices=2,
              enable_checkpointing=False,
              callbacks=[callback],
              strategy="ddp_spawn",
          )
  
          model = ModelDDP()
          trainer.fit(model)
  
          # Evoke pruning manually.
          callback.check_pruned()
  
          return 1.0
  
      with StorageSupplier(storage_mode) as storage:
          study = optuna.create_study(
              storage=storage, pruner=DeterministicPruner(True)
          )
          with pytest.raises(ProcessRaisedException):
              study.optimize(objective, n_trials=1)
  
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 4 for calling a global function with example usage: test_pytorch_lightning_pruning_callback_ddp_unsupported_storage() and returns: int