docstr: Modularity eigenvalues
docstr_tok: ["Modularity","eigenvalues"]
code: def test_modularity_spectrum(self):
      "Modularity eigenvalues"
      evals = np.array([-1.5, 0.0, 0.0])
      e = sorted(nx.modularity_spectrum(self.P))
      np.testing.assert_almost_equal(e, evals)
      # Directed modularity eigenvalues
      evals = np.array([-0.5, 0.0, 0.0])
      e = sorted(nx.modularity_spectrum(self.DG))
      np.testing.assert_almost_equal(e, evals)
  
file_path: networkx/networkx/linalg/tests/test_spectrum.py
imports: import pytest
  import networkx
  from networkx.generators.degree_seq import havel_hakimi_graph
label_desc: Use image node_id 5 for calling the TestSpectrum obj's underlying member method code with example usage: obj.test_modularity_spectrum() without return types