code: def caplog(caplog):
      """Workaround for https://github.com/pytest-dev/pytest/issues/3697.
  
      Setting ``filterwarnings`` with pytest breaks ``caplog`` when ``not logger.propagate``.
  
      """
      import logging
  
      lightning_logger = logging.getLogger("lightning.fabric")
      propagate = lightning_logger.propagate
      lightning_logger.propagate = True
      yield caplog
      lightning_logger.propagate = propagate
  
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 11 for calling a global function with example usage: caplog(caplog) without return types