code: def mock_tpu_available(
      monkeypatch: pytest.MonkeyPatch, value: bool = True
  ) -> None:
      mock_xla_available(monkeypatch, value)
      monkeypatch.setattr(
          lightning.fabric.accelerators.xla.XLAAccelerator,
          "is_available",
          lambda: value,
      )
      monkeypatch.setattr(
          lightning.fabric.accelerators.xla.XLAAccelerator,
          "auto_device_count",
          lambda *_: 8,
      )
  
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 9 for calling a global function with example usage: mock_tpu_available(monkeypatch, value) without return types