code: def init_emb2neg_index(negative, batch_size):
      """select embedding of negative nodes from a batch of node embeddings
      for fast negative sampling
  
      Return
      ------
      index_emb_negu torch.LongTensor : the indices of u_embeddings
      index_emb_negv torch.LongTensor : the indices of v_embeddings
  
      Usage
      -----
      # emb_u.shape: [batch_size, dim]
      batch_emb2negu = torch.index_select(emb_u, 0, index_emb_negu)
      """
      idx_list_u = list(range(batch_size)) * negative
      idx_list_v = list(range(batch_size)) * negative
      random.shuffle(idx_list_v)
  
      index_emb_negu = torch.LongTensor(idx_list_u)
      index_emb_negv = torch.LongTensor(idx_list_v)
  
      return index_emb_negu, index_emb_negv
  
imports: import random
  import numpy
  import torch
  import torch.multiprocessing
  import torch.nn
  import torch.nn.functional
  from torch.multiprocessing import Queue
  from torch.nn import init
label_desc: Use image node_id 1 for calling a global function with example usage: init_emb2neg_index(negative, batch_size) and returns: index_emb_negu,  index_emb_negv