class_docstr: Grouped sampler iterator
  
  Parameters
  ----------
  dataloader_head : dgl.contrib.sampling.EdgeSampler
      EdgeSampler in head mode
  dataloader_tail : dgl.contrib.sampling.EdgeSampler
      EdgeSampler in tail mode
  neg_chunk_size : int
      How many edges in one chunk. We split one batch into chunks.
  neg_sample_size : int
      How many negative edges sampled for each node.
  is_chunked : bool
      If True, the sampled batch is chunked.
  num_nodes : int
      Total number of nodes in the whole graph.
class_docstr_tok: ["Grouped","sampler","iterator","Parameters","--","--","--","--","--","dataloader_head",":","dgl.contrib.sampling.EdgeSampler","EdgeSampler","in","head","mode","dataloader_tail",":","dgl.contrib.sampling.EdgeSampler","EdgeSampler","in","tail","mode","neg_chunk_size",":","int","How","many","edges","in","one","chunk",".","We","split","one","batch","into","chunks",".","neg_sample_size",":","int","How","many","negative","edges","sampled","for","each","node",".","is_chunked",":","bool","If","True",",","the","sampled","batch","is","chunked",".","num_nodes",":","int","Total","number","of","nodes","in","the","whole","graph","."]
code: def __next__(self):
      self.step += 1
      if self.step % 2 == 0:
          pos_g, neg_g = next(self.iterator_head)
      else:
          pos_g, neg_g = next(self.iterator_tail)
      return pos_g, neg_g
  
imports: import math
  import numpy
  import scipy
  import dgl.backend
  import dgl
  import os
  import sys
  import pickle
  import time
  from dgl.base import NID, EID
  import pdb
label_desc: Use image node_id 2 for calling the NewBidirectionalOneShotIterator obj's underlying member method code with example usage: obj.__next__() and returns: pos_g,  neg_g