code: def test_is_path_in_lightning(monkeypatch, tmp_path):
      monkeypatch.chdir(tmp_path)
      if sys.platform != "win32":
          assert _is_path_in_lightning(Path("/a/b/c/lightning"))
          assert _is_path_in_lightning(
              Path("/a/b/c/lightning/core/lightning.py")
          )
          assert _is_path_in_lightning(
              Path("/a/b/c/lightning/lightning")
          )
          assert not _is_path_in_lightning(Path("/a/b/c/"))
          # The following statements should assert the opposite for correctness, but a naive implementation of
          # `_is_path_in_lightning` was requested, thus it cannot handle these cases
          assert _is_path_in_lightning(Path(""))
          assert _is_path_in_lightning(Path("/a/b/lightning"))
          assert _is_path_in_lightning(Path("a/b/c/lightning"))
      else:
          assert _is_path_in_lightning(Path(r"C:\a\b\c\lightning"))
          assert _is_path_in_lightning(
              Path(r"C:\a\b\c\lightning\core\lightning.py")
          )
          assert _is_path_in_lightning(
              Path(r"C:\a\b\c\lightning\lightning")
          )
          assert not _is_path_in_lightning(Path(r"\a\b\c"))
          assert not _is_path_in_lightning(Path(r"C:\a\b\c"))
          # The following statements should assert the opposite for correctness, but a naive implementation of
          # `_is_path_in_lightning` was requested, thus it cannot handle these cases
          assert _is_path_in_lightning(Path(r"D:\a\b\c\lightning"))
  
file_path: pytorch-lightning/tests/tests_fabric/utilities/test_warnings.py
imports: import importlib
  import inspect
  import os
  import sys
  import warnings
  from contextlib import redirect_stderr
  from io import StringIO
  from pathlib import Path
  from unittest import mock
  import lightning.fabric
  import pytest
  from lightning.fabric.utilities.rank_zero import rank_zero_deprecation, rank_zero_warn
  from lightning.fabric.utilities.warnings import PossibleUserWarning, _is_path_in_lightning, disable_possible_user_warnings
  from lightning_utilities.core.rank_zero import WarningCache, _warn
  from lightning_utilities.test.warning import no_warning_call
label_desc: Use image node_id 2 for calling a global function with example usage: test_is_path_in_lightning(monkeypatch, tmp_path) without return types