code: def test_graph_dataloader(batch_size):
      num_batches = 2
      num_samples = num_batches * (
          batch_size if batch_size is not None else 1
      )
      minigc_dataset = dgl.data.MiniGCDataset(num_samples, 10, 20)
      data_loader = dgl.dataloading.GraphDataLoader(
          minigc_dataset, batch_size=batch_size, shuffle=True
      )
      assert isinstance(iter(data_loader), Iterator)
      for graph, label in data_loader:
          assert isinstance(graph, dgl.DGLGraph)
          if batch_size is not None:
              assert F.asnumpy(label).shape[0] == batch_size
          else:
              # If batch size is None, the label element will be a single scalar following
              # PyTorch's practice.
              assert F.asnumpy(label).ndim == 0
  
imports: import os
  import unittest
  from collections.abc import Iterator, Mapping
  from functools import partial
  import backend
  import dgl
  import dgl.ops
  import numpy
  import pytest
  import torch
  import torch.distributed
  import torch.multiprocessing
  from utils import parametrize_idtype
label_desc: Use image node_id 1 for calling a global function with example usage: test_graph_dataloader(batch_size) without return types