code: def test_zero_deg(self):
      G = nx.DiGraph()
      G.add_edge(1, 2)
      G.add_edge(1, 3)
      G.add_edge(1, 4)
      c = nx.average_degree_connectivity(G)
      assert c == {1: 0, 3: 1}
      c = nx.average_degree_connectivity(G, source="in", target="in")
      assert c == {0: 0, 1: 0}
      c = nx.average_degree_connectivity(G, source="in", target="out")
      assert c == {0: 0, 1: 3}
      c = nx.average_degree_connectivity(
          G, source="in", target="in+out"
      )
      assert c == {0: 0, 1: 3}
      c = nx.average_degree_connectivity(G, source="out", target="out")
      assert c == {0: 0, 3: 0}
      c = nx.average_degree_connectivity(G, source="out", target="in")
      assert c == {0: 0, 3: 1}
      c = nx.average_degree_connectivity(
          G, source="out", target="in+out"
      )
      assert c == {0: 0, 3: 1}
  
file_path: networkx/networkx/algorithms/assortativity/tests/test_connectivity.py
imports: from itertools import permutations
  import pytest
  import networkx
label_desc: Use image node_id 5 for calling the TestNeighborConnectivity obj's underlying member method code with example usage: obj.test_zero_deg() without return types