code: def test_in_degree_weighted(self):
      G = self.K3.copy()
      G.add_edge(0, 1, weight=0.3, other=1.2)
      assert sorted(G.in_degree(weight="weight")) == [
          (0, 2),
          (1, 1.3),
          (2, 2),
      ]
      assert dict(G.in_degree(weight="weight")) == {0: 2, 1: 1.3, 2: 2}
      assert G.in_degree(1, weight="weight") == 1.3
      assert sorted(G.in_degree(weight="other")) == [
          (0, 2),
          (1, 2.2),
          (2, 2),
      ]
      assert dict(G.in_degree(weight="other")) == {0: 2, 1: 2.2, 2: 2}
      assert G.in_degree(1, weight="other") == 2.2
      assert list(G.in_degree(iter([1]), weight="other")) == [(1, 2.2)]
  
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 2 for calling the BaseAttrDiGraphTester obj's underlying member method code with example usage: obj.test_in_degree_weighted() without return types