code: def __init__(
      self,
      g,
      user_type,
      item_type,
      random_walk_length,
      random_walk_restart_prob,
      num_random_walks,
      num_neighbors,
      num_layers,
  ):
      self.g = g
      self.user_type = user_type
      self.item_type = item_type
      self.user_to_item_etype = list(
          g.metagraph()[user_type][item_type]
      )[0]
      self.item_to_user_etype = list(
          g.metagraph()[item_type][user_type]
      )[0]
      self.samplers = [
          dgl.sampling.PinSAGESampler(
              g,
              item_type,
              user_type,
              random_walk_length,
              random_walk_restart_prob,
              num_random_walks,
              num_neighbors,
          )
          for _ in range(num_layers)
      ]
  
imports: import argparse
  import pickle
  import time
  import dgl
  import dgl.function
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from torch.utils.data import DataLoader, IterableDataset
  from ..None import utils
label_desc: Use image node_id 1 to create a new NeighborSampler object from inherited base classes: object with example: obj = NeighborSampler(g, user_type, item_type, random_walk_length, random_walk_restart_prob, num_random_walks, num_neighbors, num_layers)