code: def _verify_dataloader_idx_requirement(
      hooks: Tuple[str, ...],
      is_expected: bool,
      stage: RunningStage,
      pl_module: "pl.LightningModule",
  ) -> None:
      for hook in hooks:
          fx = getattr(pl_module, hook)
          # this validation only works if "dataloader_idx" is used, no other names such as "dl_idx"
          param_present = is_param_in_hook_signature(
              fx, "dataloader_idx"
          )
          if not is_expected:
              if param_present:
                  params = inspect.signature(fx).parameters
                  if (
                      "dataloader_idx" in params
                      and params["dataloader_idx"].default
                      is inspect.Parameter.empty
                  ):
                      raise RuntimeError(
                          f"You provided only a single `{stage.dataloader_prefix}_dataloader`, but have included "
                          f"`dataloader_idx` in `{type(pl_module).__name__}.{hook}()`. Either remove the"
                          " argument or give it a default value i.e. `dataloader_idx=0`."
                      )
          elif not param_present:
              raise RuntimeError(
                  f"You provided multiple `{stage.dataloader_prefix}_dataloader`, but no `dataloader_idx`"
                  f" argument in `{type(pl_module).__name__}.{hook}()`. Try adding `dataloader_idx=0` to its"
                  " signature."
              )
  
imports: import inspect
  from contextlib import contextmanager
  from typing import Any, Callable, ContextManager, Generator, Optional, Tuple, Type
  import torch
  import torch.distributed
  from torch import Tensor
  import lightning.pytorch
  from lightning.fabric.utilities.distributed import _distributed_is_initialized
  from lightning.fabric.utilities.imports import _TORCH_EQUAL_2_0, _TORCH_GREATER_EQUAL_1_13
  from lightning.fabric.utilities.warnings import PossibleUserWarning
  from lightning.pytorch.accelerators.xla import XLAAccelerator
  from lightning.pytorch.callbacks.timer import Timer
  from lightning.pytorch.loops import _Loop
  from lightning.pytorch.loops.fetchers import _DataFetcher, _DataLoaderIterDataFetcher, _PrefetchDataFetcher
  from lightning.pytorch.loops.progress import _BaseProgress
  from lightning.pytorch.strategies import FSDPStrategy
  from lightning.pytorch.strategies.parallel import ParallelStrategy
  from lightning.pytorch.strategies.strategy import Strategy
  from lightning.pytorch.trainer.states import RunningStage
  from lightning.pytorch.utilities.rank_zero import rank_zero_warn
  from lightning.pytorch.utilities.signature_utils import is_param_in_hook_signature
label_desc: Use image node_id 8 for calling a global function with example usage: _verify_dataloader_idx_requirement(hooks, is_expected, stage, pl_module) without return types