code: def test_benchmark_setup_generator_small(benchmark):
      n_feat = 1024
      n_edges = 100
      batch_size = 10
      num_samples = [20, 10]
  
      G = example_Graph_2(n_feat)
      nodes = list(G.nodes())
      edges_to_sample = np.reshape(
          random.choices(nodes, k=2 * n_edges), (n_edges, 2)
      )
  
      def setup_generator():
          generator = GraphSAGELinkGenerator(
              G, batch_size=batch_size, num_samples=num_samples
          )
  
      benchmark(setup_generator)
  
file_path: stellargraph/tests/mapper/test_benchmark_generators.py
imports: import random
  from stellargraph.mapper import *
  from stellargraph.core.graph import *
  import numpy
  import networkx
  import pytest
  from ..test_utils.graphs import example_graph_random
label_desc: Use image node_id 2 for calling a global function with example usage: test_benchmark_setup_generator_small(benchmark) without return types