code: def sample_neighbors_with_args(g, size, fanout):
      num_nodes = {ntype: g.num_nodes(ntype) for ntype in g.ntypes}
      etypes = g.canonical_etypes
  
      sampled_graph = g.sample_neighbors(
          {
              ntype: np.random.randint(0, n, size=size)
              for ntype, n in num_nodes.items()
          },
          fanout,
      )
  
      for ntype, n in num_nodes.items():
          assert sampled_graph.num_nodes(ntype) == n
      for t in etypes:
          src, dst = sampled_graph.edges(etype=t)
          eids = sampled_graph.edges[t].data[dgl.EID]
          dist_u, dist_v = g.find_edges(eids, etype=t[1])
          assert F.allclose(dist_u, src)
          assert F.allclose(dist_v, dst)
  
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 10 for calling a global function with example usage: sample_neighbors_with_args(g, size, fanout) without return types