code: def test_pooling(pooling):
      # no GCN layers, to just test the pooling directly
      if pooling == "default":
          gcn_graph_model = GCNSupervisedGraphClassification(
              layer_sizes=[], activations=[], generator=generator
          )
  
          def expected_values(array):
              return array.mean(axis=0)
  
      else:
          # shift the features to make it a bit more interesting
          shift = 10
  
          def shifted_sum_pooling(tensor, mask):
              mask_floats = tf.expand_dims(
                  tf.cast(mask, tf.float32), axis=-1
              )
              return tf.math.reduce_sum(
                  tf.multiply(mask_floats, shift + tensor), axis=1
              )
  
          gcn_graph_model = GCNSupervisedGraphClassification(
              layer_sizes=[],
              activations=[],
              generator=generator,
              pooling=shifted_sum_pooling,
          )
  
          def expected_values(array):
              return (shift + array).sum(axis=0)
  
      train_graphs = [0, 1, 2]
      train_gen = generator.flow(
          graphs=train_graphs, batch_size=2, shuffle=False
      )
      model = tf.keras.Model(*gcn_graph_model.in_out_tensors())
  
      predictions = model.predict(train_gen)
      assert predictions.shape == (3, 4)
  
      expected = np.vstack(
          [
              expected_values(
                  graphs[iloc].node_features(node_type="n-0")
              )
              for iloc in train_graphs
          ]
      )
      np.testing.assert_almost_equal(predictions, expected)
  
file_path: stellargraph/tests/layer/test_graph_classification.py
imports: import numpy
  import tensorflow
  from stellargraph.layer.graph_classification import *
  from stellargraph.layer import SortPooling
  from stellargraph.mapper import PaddedGraphGenerator, FullBatchNodeGenerator
  import pytest
  from ..test_utils.graphs import example_graph_random
  from ..None import test_utils
label_desc: Use image node_id 4 for calling a global function with example usage: test_pooling(pooling) and returns: array, tf, unknown