code: def test_fabric_spike_detection_integration(
      tmp_path, global_rank_spike, num_devices, spike_value, finite_only
  ):
      fabric = Fabric(
          accelerator="cpu",
          devices=num_devices,
          callbacks=[
              SpikeDetection(
                  exclude_batches_path=tmp_path, finite_only=finite_only
              )
          ],
          strategy="ddp_spawn",
      )
  
      # spike_value == None -> typical spike detection
      # finite_only -> typical spike detection and raise with NaN +/- inf
      # if inf -> inf >> other values -> typical spike detection
      should_raise = (
          spike_value is None
          or finite_only
          or spike_value == float("inf")
      )
      fabric.launch(
          spike_detection_test,
          global_rank_spike=global_rank_spike,
          spike_value=spike_value,
          should_raise=should_raise,
      )
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_spike.py
imports: import contextlib
  import sys
  import pytest
  import torch
  from lightning.fabric import Fabric
  from lightning.fabric.utilities.spike import _TORCHMETRICS_GREATER_EQUAL_1_0_0, SpikeDetection, TrainingSpikeException
label_desc: Use image node_id 2 for calling a global function with example usage: test_fabric_spike_detection_integration(tmp_path, global_rank_spike, num_devices, spike_value, finite_only) without return types