def format_loader_info(info: dict[str, Union[dataset_info, Iterable[dataset_info]]]) -> str:
            """Helper function to format loader information."""
            output = []
            for loader_name, loader_info in info.items():
                # Single dataset
                if isinstance(loader_info, dataset_info):
                    loader_info_formatted = "None" if not loader_info.available else f"size={loader_info.length}"
                # Iterable of datasets
                else:
                    loader_info_formatted = " ; ".join(
                        "None" if not loader_info_i.available else f"{i}. size={loader_info_i.length}"
                        for i, loader_info_i in enumerate(loader_info, start=1)
                    )

                output.append(f"{{{loader_name}: {loader_info_formatted}}}")

            return os.linesep.join(output)
Helper function to format loader information.
src/lightning/pytorch/core/datamodule.py