def extract_loader_info(methods: list[tuple[str, str]]) -> dict:
            """Helper function to extract information for each dataloader method."""
            info: dict[str, Union[dataset_info, Iterable[dataset_info]]] = {}
            for loader_name, func_name in methods:
                loader_method = getattr(self, func_name, None)

                try:
                    loader = loader_method()  # type: ignore
                    info[loader_name] = loader_info(loader)
                except Exception:
                    info[loader_name] = dataset_info(False, "")

            return info
Helper function to extract information for each dataloader method.
src/lightning/pytorch/core/datamodule.py