code: def distnodedataloader_test(
      g,
      batch_size,
      drop_last,
      shuffle,
      num_workers,
      orig_nid_map,
      orig_uv_map,
  ):
      # We sample only a subset to minimize the test runtime
      num_nodes_to_sample = int(g.num_nodes(g.ntypes[-1]) * 0.05)
      # To make sure that drop_last is tested
      if num_nodes_to_sample % batch_size == 0:
          num_nodes_to_sample -= 1
  
      if len(g.ntypes) == 1:
          train_nid = F.arange(0, num_nodes_to_sample)
      else:
          train_nid = {g.ntypes[-1]: F.arange(0, num_nodes_to_sample)}
  
      if len(g.etypes) > 1:
          sampler = dgl.dataloading.MultiLayerNeighborSampler(
              [
                  {etype: 5 for etype in g.etypes},
                  10,
              ]
          )
      else:
          sampler = dgl.dataloading.MultiLayerNeighborSampler(
              [
                  5,
                  10,
              ]
          )
  
      dataloader = dgl.dataloading.DistNodeDataLoader(
          g,
          train_nid,
          sampler,
          batch_size=batch_size,
          shuffle=shuffle,
          drop_last=drop_last,
          num_workers=num_workers,
      )
  
      for _ in range(2):
          for _, (_, _, blocks) in zip(
              range(0, num_nodes_to_sample, batch_size), dataloader
          ):
              block = blocks[-1]
              for src_type, etype, dst_type in block.canonical_etypes:
                  orig_u, orig_v = orig_uv_map[etype]
                  o_src, o_dst = block.edges(etype=etype)
                  src_nodes_id = block.srcnodes[src_type].data[dgl.NID][
                      o_src
                  ]
                  dst_nodes_id = block.dstnodes[dst_type].data[dgl.NID][
                      o_dst
                  ]
                  src_nodes_id = orig_nid_map[src_type][src_nodes_id]
                  dst_nodes_id = orig_nid_map[dst_type][dst_nodes_id]
                  eids = block.edges[etype].data[dgl.EID]
                  F.allclose(src_nodes_id, orig_u[eids])
                  F.allclose(dst_nodes_id, orig_v[eids])
      del dataloader
  
imports: import json
  import os
  from itertools import product
  import dgl
  import dgl.backend
  import numpy
  from dgl.distributed import edge_split, load_partition_book, node_split
label_desc: Use image node_id 23 for calling a global function with example usage: distnodedataloader_test(g, batch_size, drop_last, shuffle, num_workers, orig_nid_map, orig_uv_map) without return types