code: def mock_xla_available(
      monkeypatch: pytest.MonkeyPatch, value: bool = True
  ) -> None:
      monkeypatch.setattr(
          lightning.fabric.accelerators.xla, "_XLA_AVAILABLE", value
      )
      monkeypatch.setattr(
          lightning.fabric.plugins.environments.xla,
          "_XLA_AVAILABLE",
          value,
      )
      monkeypatch.setattr(
          lightning.fabric.plugins.precision.xla,
          "_XLA_AVAILABLE",
          value,
      )
      monkeypatch.setattr(
          lightning.fabric.plugins.io.xla, "_XLA_AVAILABLE", value
      )
      monkeypatch.setattr(
          lightning.fabric.strategies.single_xla,
          "_XLA_AVAILABLE",
          value,
      )
      monkeypatch.setattr(
          lightning.fabric.strategies.xla_fsdp, "_XLA_AVAILABLE", value
      )
      monkeypatch.setattr(
          lightning.fabric.strategies.launchers.xla,
          "_XLA_AVAILABLE",
          value,
      )
      monkeypatch.setitem(sys.modules, "torch_xla", Mock())
      monkeypatch.setitem(
          sys.modules, "torch_xla.core.xla_model", Mock()
      )
      monkeypatch.setitem(sys.modules, "torch_xla.experimental", Mock())
      monkeypatch.setitem(
          sys.modules, "torch_xla.distributed.fsdp.wrap", Mock()
      )
  
imports: import os
  import sys
  import threading
  from typing import List
  from unittest.mock import Mock
  import lightning.fabric
  import pytest
  import torch.distributed
  from lightning.fabric.accelerators import XLAAccelerator
  from lightning.fabric.strategies.launchers.subprocess_script import _ChildProcessObserver
  from lightning.fabric.utilities.distributed import _distributed_is_initialized
label_desc: Use image node_id 7 for calling a global function with example usage: mock_xla_available(monkeypatch, value) without return types