class_docstr: Tests of GraphSAGELinkGenerator class
docstr: Test for handling of isolated nodes
docstr_tok: ["Test","for","handling","of","isolated","nodes"]
code: def test_GraphSAGELinkGenerator_isolates(self):
      """
      Test for handling of isolated nodes
      """
      n_feat = 4
      n_batch = 2
      n_samples = [2, 2]
  
      # test graph
      G = example_graph_random(
          feature_size=n_feat, n_nodes=6, n_isolates=2, n_edges=10
      )
  
      # Check sizes with one isolated node
      head_links = [(1, 5)]
      gen = GraphSAGELinkGenerator(
          G, batch_size=n_batch, num_samples=n_samples
      ).flow(head_links)
  
      ne, nl = gen[0]
      assert pytest.approx([1, 1, 2, 2, 4, 4]) == [
          x.shape[1] for x in ne
      ]
  
      # Check sizes with two isolated nodes
      head_links = [(4, 5)]
      gen = GraphSAGELinkGenerator(
          G, batch_size=n_batch, num_samples=n_samples
      ).flow(head_links)
  
      ne, nl = gen[0]
      assert pytest.approx([1, 1, 2, 2, 4, 4]) == [
          x.shape[1] for x in ne
      ]
  
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 8 for calling the Test_GraphSAGELinkGenerator obj's underlying member method code with example usage: obj.test_GraphSAGELinkGenerator_isolates() without return types