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)]
  
imports: import pytest
  import networkx
  from networkx.utils import nodes_equal
  from .test_graph import BaseAttrGraphTester, BaseGraphTester
  from .test_graph import TestEdgeSubgraph
  from .test_graph import TestGraph
label_desc: Use image node_id 11 for calling the BaseDiGraphTester obj's underlying member method code with example usage: obj.test_degree() without return types