code: def setup_class(cls):
      deg = [3, 2, 2, 1, 0]
      cls.G = havel_hakimi_graph(deg)
      cls.P = nx.path_graph(3)
      cls.WG = nx.Graph(
          (u, v, {"weight": 0.5, "other": 0.3})
          for (u, v) in cls.G.edges()
      )
      cls.WG.add_node(4)
      cls.DG = nx.DiGraph()
      nx.add_path(cls.DG, [0, 1, 2])
  
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 1 for calling the TestSpectrum obj's underlying member method code with example usage: obj.setup_class(cls) without return types