code: def test_edge_index_dataloader(num_workers, sort_order):
      if sort_order == "col":
          edge_index = [[1, 0, 2, 1], [0, 1, 1, 2]]
      else:
          edge_index = [[0, 1, 1, 2], [1, 0, 2, 1]]
  
      edge_index = EdgeIndex(
          edge_index,
          sparse_size=(3, 3),
          sort_order=sort_order,
          is_undirected=True,
      )
      data = Data(edge_index=edge_index)
      assert data.num_nodes == 3
  
      loader = DataLoader(
          [data, data, data, data],
          batch_size=2,
          num_workers=num_workers,
      )
      assert len(loader) == 2
  
      for batch in loader:
          assert isinstance(batch.edge_index, EdgeIndex)
          assert batch.edge_index.sparse_size() == (6, 6)
          assert batch.edge_index.sort_order == sort_order
          assert batch.edge_index.is_undirected
  
file_path: pytorch_geometric/test/loader/test_dataloader.py
imports: import multiprocessing
  import sys
  from collections import namedtuple
  import pytest
  import torch
  from torch_geometric import EdgeIndex
  from torch_geometric.data import Data, HeteroData, OnDiskDataset
  from torch_geometric.loader import DataLoader
  from torch_geometric.testing import get_random_edge_index, get_random_tensor_frame, withCUDA, withPackage
label_desc: Use image node_id 7 for calling a global function with example usage: test_edge_index_dataloader(num_workers, sort_order) without return types