code: def test_incidence_matrix_batch():
      """
      Tests that `incidence_matrix` works with multiple
      graphs in a batch.
      """
      # Arrange.
      # Create test graphs.
      graph1 = nx.to_numpy_array(nx.house_graph())
      graph2 = nx.to_numpy_array(nx.house_x_graph())
  
      # Act.
      # Get the incidence matrix for both graphs individually, and both together
      # as a batch.
      graph1_incidence = convolution.incidence_matrix(graph1)
      # The first graph will be padded with two extra rows columns so that it
      # can be batched with the other one, which has two more edges.
      graph1_incidence = np.pad(graph1_incidence, ((0, 0), (0, 2)))
      graph2_incidence = convolution.incidence_matrix(graph2)
  
      batch = np.stack([graph1, graph2], axis=0)
      batch_incidence = convolution.incidence_matrix(batch)
  
      # Assert.
      # Both ways of doing it should produce the same results.
      np.testing.assert_array_equal(
          graph1_incidence, batch_incidence[0]
      )
      np.testing.assert_array_equal(
          graph2_incidence, batch_incidence[1]
      )
  
imports: import networkx
  import numpy
  import pytest
  import scipy.sparse
  from spektral.utils import convolution
label_desc: Use image node_id 13 for calling a global function with example usage: test_incidence_matrix_batch() without return types