code: def test_degree(self):
      G = self.G()
      G.add_edges_from(
          [("A", "B"), ("A", "C"), ("B", "D"), ("C", "B"), ("C", "D")]
      )
      assert G.degree("A") == 2
  
      # degree of single node in iterable container must return dict
      assert list(G.degree(["A"])) == [("A", 2)]
      assert sorted(d for n, d in G.degree(["A", "B"])) == [2, 3]
      assert sorted(d for n, d in G.degree()) == [2, 2, 3, 3]
  
imports: import pytest
  import networkx
  from networkx import convert_node_labels_to_integers
  from networkx.utils import edges_equal, nodes_equal
label_desc: Use image node_id 20 for calling the HistoricalTests obj's underlying member method code with example usage: obj.test_degree() without return types