code: def test_line_graph():
      """
      Tests that `line_graph` produces correct results.
      """
      # Arrange.
      # Compute the line graph using NX.
      graph = nx.house_graph()
  
      unordered_line_graph = nx.line_graph(graph)
      # NX puts the nodes in a weird order when making the line graph,
      # so we sort them to maintain consistency with the original graph and the
      # incidence matrix.
      line_graph = nx.Graph()
      line_graph.add_nodes_from(
          sorted(unordered_line_graph.nodes(data=True))
      )
      line_graph.add_edges_from(unordered_line_graph.edges(data=True))
  
      graph_incidence = nx.incidence_matrix(graph).toarray()
      true_line_graph_adj = nx.to_numpy_array(line_graph)
  
      # Act.
      got_line_graph_adj = convolution.line_graph(
          graph_incidence
      ).numpy()
  
      # Assert
      np.testing.assert_array_equal(
          true_line_graph_adj, got_line_graph_adj
      )
  
imports: import networkx
  import numpy
  import pytest
  import scipy.sparse
  from spektral.utils import convolution
label_desc: Use image node_id 14 for calling a global function with example usage: test_line_graph() without return types