code: def multilayer_sample(A, fanouts, seeds, ndata):
      sampled_matrices = []
      src = seeds
  
      #####################################################################
      # (HIGHLIGHT) Using the sparse sample operator to preform random
      # sampling on the neighboring nodes of the seeds nodes. The sparse
      # compact operator is then employed to compact and relabel the sampled
      # matrix, resulting in the sampled matrix and the relabel index.
      #####################################################################
  
      for fanout in fanouts:
          # Sample neighbors.
          sampled_matrix = A.sample(1, fanout, ids=src).coalesce()
          # Compact the sampled matrix.
          compacted_mat, row_ids = sampled_matrix.compact(0)
          sampled_matrices.insert(0, compacted_mat)
          src = row_ids
  
      x = ndata["feat"][src]
      y = ndata["label"][seeds]
      return sampled_matrices, x, y
  
imports: import argparse
  import dgl.sparse
  import torch
  import torch.nn
  import torch.nn.functional
  import torchmetrics.functional
  from dgl.data import AsNodePredDataset
  from ogb.nodeproppred import DglNodePropPredDataset
label_desc: Use image node_id 1 for calling a global function with example usage: multilayer_sample(A, fanouts, seeds, ndata) and returns: sampled_matrices,  x,  y