code: def test_degree_values(self):
      d_m = 0  # multihoming degree for M nodes
      d_cp = 0  # multihoming degree for CP nodes
      d_c = 0  # multihoming degree for C nodes
      p_m_m = 0  # avg number of peering edges between M and M
      p_cp_m = 0  # avg number of peering edges between CP and M
      p_cp_cp = 0  # avg number of peering edges between CP and CP
      t_m = 0  # probability M's provider is T
      t_cp = 0  # probability CP's provider is T
      t_c = 0  # probability C's provider is T
  
      for i, j in self.G.edges():
          e = self.G.edges[(i, j)]
          if e["type"] == "transit":
              cust = int(e["customer"])
              if i == cust:
                  prov = j
              elif j == cust:
                  prov = i
              else:
                  raise ValueError(
                      "Inconsistent data in the graph edge attributes"
                  )
              if cust in self.M:
                  d_m += 1
                  if self.G.nodes[prov]["type"] == "T":
                      t_m += 1
              elif cust in self.C:
                  d_c += 1
                  if self.G.nodes[prov]["type"] == "T":
                      t_c += 1
              elif cust in self.CP:
                  d_cp += 1
                  if self.G.nodes[prov]["type"] == "T":
                      t_cp += 1
              else:
                  raise ValueError(
                      "Inconsistent data in the graph edge attributes"
                  )
          elif e["type"] == "peer":
              if (
                  self.G.nodes[i]["type"] == "M"
                  and self.G.nodes[j]["type"] == "M"
              ):
                  p_m_m += 1
              if (
                  self.G.nodes[i]["type"] == "CP"
                  and self.G.nodes[j]["type"] == "CP"
              ):
                  p_cp_cp += 1
              if (
                  self.G.nodes[i]["type"] == "M"
                  and self.G.nodes[j]["type"] == "CP"
                  or self.G.nodes[i]["type"] == "CP"
                  and self.G.nodes[j]["type"] == "M"
              ):
                  p_cp_m += 1
          else:
              raise ValueError(
                  "Unexpected data in the graph edge attributes"
              )
  
      assert d_m / len(self.M) == approx(
          (2 + (2.5 * self.n) / 10000), abs=1e-0
      )
      assert d_cp / len(self.CP) == approx(
          (2 + (1.5 * self.n) / 10000), abs=1e-0
      )
      assert d_c / len(self.C) == approx(
          (1 + (5 * self.n) / 100000), abs=1e-0
      )
  
      assert p_m_m / len(self.M) == approx(
          (1 + (2 * self.n) / 10000), abs=1e-0
      )
      assert p_cp_m / len(self.CP) == approx(
          (0.2 + (2 * self.n) / 10000), abs=1e-0
      )
      assert p_cp_cp / len(self.CP) == approx(
          (0.05 + (2 * self.n) / 100000), abs=1e-0
      )
  
      assert t_m / d_m == approx(0.375, abs=1e-1)
      assert t_cp / d_cp == approx(0.375, abs=1e-1)
      assert t_c / d_c == approx(0.125, abs=1e-1)
  
file_path: networkx/networkx/generators/tests/test_internet_as_graphs.py
imports: from pytest import approx
  from networkx import is_connected, neighbors
  from networkx.generators.internet_as_graphs import random_internet_as_graph
label_desc: Use image node_id 8 for calling the TestInternetASTopology obj's underlying member method code with example usage: obj.test_degree_values() without return types