code: def test_degree(self):
      G = self.K3
      assert sorted(G.degree()) == [(0, 4), (1, 4), (2, 4)]
      assert dict(G.degree()) == {0: 4, 1: 4, 2: 4}
      assert G.degree(0) == 4
      assert list(G.degree(iter([0]))) == [(0, 4)]
      G.add_edge(0, 1, weight=0.3, other=1.2)
      assert sorted(G.degree(weight="weight")) == [
          (0, 4.3),
          (1, 4.3),
          (2, 4),
      ]
      assert sorted(G.degree(weight="other")) == [
          (0, 5.2),
          (1, 5.2),
          (2, 4),
      ]
  
imports: from collections import UserDict
  import pytest
  import networkx
  from networkx.utils import edges_equal
  from .test_multigraph import BaseMultiGraphTester
  from .test_multigraph import TestEdgeSubgraph
  from .test_multigraph import TestMultiGraph
label_desc: Use image node_id 17 for calling the BaseMultiDiGraphTester obj's underlying member method code with example usage: obj.test_degree() without return types