class_docstr: Tests of Node2VecLinkGenerator class
code: def test_Node2VecLinkGenerator_unsupervisedSampler_sample_generation(
      self,
  ):
      G = example_graph()
  
      unsupervisedSamples = UnsupervisedSampler(G)
  
      mapper = Node2VecLinkGenerator(
          G, batch_size=self.batch_size
      ).flow(unsupervisedSamples)
  
      assert mapper.data_size == len(list(G.nodes())) * 2
      assert mapper.batch_size == self.batch_size
      assert len(mapper) == np.ceil(
          mapper.data_size / mapper.batch_size
      )
  
      for batch in range(len(mapper)):
          nf, nl = mapper[batch]
  
          assert len(nf) == 2
  
          assert nf[0].shape == (
              min(self.batch_size, mapper.data_size),
          )
          assert nf[1].shape == (
              min(self.batch_size, mapper.data_size),
          )
          assert len(nl) == min(self.batch_size, mapper.data_size)
          # assert sorted(nl) == [0, 1]
  
      with pytest.raises(IndexError):
          nf, nl = mapper[len(mapper)]
  
imports: import numpy
  import networkx
  import pytest
  import random
  from stellargraph.mapper import *
  from stellargraph.core.graph import *
  from stellargraph.data.unsupervised_sampler import *
  from ..test_utils.graphs import example_graph, example_graph_random, example_hin_1, repeated_features, weighted_tree
  from ..None import test_utils
label_desc: Use image node_id 7 for calling the Test_Node2VecLinkGenerator obj's underlying member method code with example usage: obj.test_Node2VecLinkGenerator_unsupervisedSampler_sample_generation() without return types