code: def test_ibmb_batch_loader(use_sparse_tensor, kwargs):
      data = KarateClub()[0]
  
      loader = IBMBBatchLoader(
          data,
          batch_order="order",
          input_nodes=torch.randperm(data.num_nodes)[:20],
          return_edge_index_type="adj"
          if use_sparse_tensor
          else "edge_index",
          **kwargs,
      )
      assert str(loader) == "IBMBBatchLoader()"
      assert len(loader) == 4
      assert (
          sum([batch.output_node_mask.sum() for batch in loader]) == 20
      )
  
      for batch in loader:
          if use_sparse_tensor:
              assert isinstance(batch.edge_index, SparseTensor)
          else:
              assert isinstance(batch.edge_index, Tensor)
  
file_path: pytorch_geometric/test/loader/test_ibmb_loader.py
imports: import pytest
  import torch
  from torch import Tensor
  import torch_geometric.typing
  from torch_geometric.datasets import KarateClub
  from torch_geometric.loader.ibmb_loader import IBMBBatchLoader, IBMBNodeLoader
  from torch_geometric.testing import withPackage
  from torch_geometric.typing import SparseTensor
label_desc: Use image node_id 1 for calling a global function with example usage: test_ibmb_batch_loader(use_sparse_tensor, kwargs) without return types