class_docstr: Tests of GraphSAGELinkGenerator class
code: def test_GraphSAGELinkGenerator_unsupervisedSampler_sample_generation(
      self,
  ):
      G = example_graph(feature_size=self.n_feat)
  
      unsupervisedSamples = UnsupervisedSampler(G)
  
      gen = GraphSAGELinkGenerator(
          G, batch_size=self.batch_size, num_samples=self.num_samples
      )
      mapper = gen.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
      )
      assert len(set(gen.head_node_types)) == 1
  
      for batch in range(len(mapper)):
          nf, nl = mapper[batch]
  
          assert len(nf) == 3 * 2
  
          for ii in range(2):
              assert nf[ii].shape == (
                  min(self.batch_size, mapper.data_size),
                  1,
                  self.n_feat,
              )
              assert nf[ii + 2].shape == (
                  min(self.batch_size, mapper.data_size),
                  2,
                  self.n_feat,
              )
              assert nf[ii + 2 * 2].shape == (
                  min(self.batch_size, mapper.data_size),
                  2 * 2,
                  self.n_feat,
              )
              assert len(nl) == min(self.batch_size, mapper.data_size)
  
      with pytest.raises(IndexError):
          nf, nl = mapper[8]
  
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 10 for calling the Test_GraphSAGELinkGenerator obj's underlying member method code with example usage: obj.test_GraphSAGELinkGenerator_unsupervisedSampler_sample_generation() without return types