code: def _test_batch_mode(layer, **kwargs):
      A_batch = np.ones((batch_size, N, N))
      X_batch = np.random.normal(size=(batch_size, N, F))
  
      A_in = Input(shape=(N, N))
      X_in = Input(shape=(N, F))
      inputs = [X_in, A_in]
      input_data = [X_batch, A_batch]
  
      layer_instance = layer(**kwargs)
      output = layer_instance(inputs)
      model = Model(inputs, output)
  
      output = model(input_data)
  
      X_pool, A_pool, mask = output
      if "ratio" in kwargs.keys():
          N_exp = kwargs["ratio"] * N
          N_pool_expected = int(np.ceil(N_exp))
      elif "k" in kwargs.keys():
          N_pool_expected = int(kwargs["k"])
      else:
          N_pool_expected = None
      N_pool_true = A_pool.shape[-1]
  
      if N_pool_expected is not None:
          _check_number_of_nodes(N_pool_expected, N_pool_true)
  
          assert X_pool.shape == (batch_size, N_pool_expected, F)
          assert A_pool.shape == (
              batch_size,
              N_pool_expected,
              N_pool_expected,
          )
  
      output_shape = [o.shape for o in output]
      _check_output_and_model_output_shapes(
          output_shape, model.output_shape
      )
  
file_path: spektral/tests/test_layers/pooling/core.py
imports: import numpy
  import scipy.sparse
  import tensorflow
  from tensorflow.keras import Input, Model
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
  from tests.test_layers.convolutional.core import _test_get_config
label_desc: Use image node_id 4 for calling a global function with example usage: _test_batch_mode(layer) without return types