code: def test_compact_representation():
      """Test that the compact representation of the graph is indeed correct"""
      G = basic_graph()
      idx, ne, we = G.compact_neighb()
      assert len(idx) == 21
      assert idx[0] == 0
      assert idx[20] == G.E
      assert len(ne) == G.E
      assert len(we) == G.E
  
imports: import numpy
  import numpy.random
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_array_equal
  from ..graph import WeightedGraph, complete_graph, concatenate_graphs, eps_nn, knn, mst, wgraph_from_3d_grid, wgraph_from_adjacency, wgraph_from_coo_matrix
label_desc: Use image node_id 31 for calling a global function with example usage: test_compact_representation() without return types