code: def __init__(self, g, metapath_list, num_neighbors):
      self.sampler_list = []
      for metapath in metapath_list:
          # note: random walk may get same route(same edge), which will be removed in the sampled graph.
          # So the sampled graph's edges may be less than num_random_walks(num_neighbors).
          self.sampler_list.append(
              RandomWalkNeighborSampler(
                  G=g,
                  num_traversals=1,
                  termination_prob=0,
                  num_random_walks=num_neighbors,
                  num_neighbors=num_neighbors,
                  metapath=metapath,
              )
          )
  
imports: import argparse
  import dgl
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  from dgl.nn.pytorch import GATConv
  from dgl.sampling import RandomWalkNeighborSampler
  from model_hetero import SemanticAttention
  from sklearn.metrics import f1_score
  from torch.utils.data import DataLoader
  from utils import EarlyStopping, set_random_seed
label_desc: Use image node_id 1 to create a new HANSampler object from inherited base classes: object with example: obj = HANSampler(g, metapath_list, num_neighbors)