docstr: Bethe Hessian eigenvalues
docstr_tok: ["Bethe","Hessian","eigenvalues"]
code: def test_bethe_hessian_spectrum(self):
      "Bethe Hessian eigenvalues"
      evals = np.array(
          [0.5 * (9 - np.sqrt(33)), 4, 0.5 * (9 + np.sqrt(33))]
      )
      e = sorted(nx.bethe_hessian_spectrum(self.P, r=2))
      np.testing.assert_almost_equal(e, evals)
      # Collapses back to Laplacian:
      e1 = sorted(nx.bethe_hessian_spectrum(self.P, r=1))
      e2 = sorted(nx.laplacian_spectrum(self.P))
      np.testing.assert_almost_equal(e1, e2)
  
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 6 for calling the TestSpectrum obj's underlying member method code with example usage: obj.test_bethe_hessian_spectrum() without return types