code: def sample_dgl_graphs(g, train_nid, fanouts):
      # Single fanout to match cugraph
      sampler = dgl.dataloading.NeighborSampler(fanouts)
      dataloader = dgl.dataloading.DataLoader(
          g,
          train_nid,
          sampler,
          batch_size=1,
          shuffle=False,
          drop_last=False,
          num_workers=0,
      )
  
      dgl_output = {}
      for batch_id, (input_nodes, output_nodes, blocks) in enumerate(
          dataloader
      ):
          dgl_output[batch_id] = {
              "input_nodes": input_nodes,
              "output_nodes": output_nodes,
              "blocks": blocks,
          }
      return dgl_output
  
file_path: cugraph/python/cugraph-dgl/tests/mg/test_dataloader.py
imports: import pytest
  import dgl
  import torch
  from cugraph_dgl import cugraph_storage_from_heterograph
  import tempfile
  import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: sample_dgl_graphs(g, train_nid, fanouts) and returns: dgl_output