code: def _test_mixed_mode(layer, sparse=False, edges=False, **kwargs):
      X_batch = np.stack([X] * batch_size)
      A_in = Input(shape=(N,), sparse=sparse)
      X_in = Input(shape=(N, F))
      inputs = [X_in, A_in]
  
      if sparse:
          input_data = [X_batch, sp_matrix_to_sp_tensor(A)]
      else:
          input_data = [X_batch, A]
  
      if edges:
          E_in = Input(shape=(N * N, S))
          inputs.append(E_in)
          E_batch = np.stack([E_single] * batch_size)
          input_data.append(E_batch)
  
      layer_instance = layer(**kwargs)
      output = layer_instance(inputs)
      model = Model(inputs, output)
  
      output = model(input_data)
  
      assert output.shape == (batch_size, N, kwargs["channels"])
  
file_path: spektral/tests/test_layers/convolutional/core.py
imports: import itertools
  import numpy
  import tensorflow
  from tensorflow.keras import Input, Model
  from spektral.utils.sparse import sp_matrix_to_sp_tensor
label_desc: Use image node_id 3 for calling a global function with example usage: _test_mixed_mode(layer, sparse, edges) without return types