code: def test_joint_degree_graph(ntimes=10):
      for _ in range(ntimes):
          seed = int(time.time())
  
          n, m, p = 20, 10, 1
          # generate random graph with model powerlaw_cluster and calculate
          # its joint degree
          g = powerlaw_cluster_graph(n, m, p, seed=seed)
          joint_degrees_g = degree_mixing_dict(g, normalized=False)
  
          # generate simple undirected graph with given joint degree
          # joint_degrees_g
          G = joint_degree_graph(joint_degrees_g)
          joint_degrees_G = degree_mixing_dict(G, normalized=False)
  
          # assert that the given joint degree is equal to the generated
          # graph's joint degree
          assert joint_degrees_g == joint_degrees_G
  
file_path: networkx/networkx/generators/tests/test_joint_degree_seq.py
imports: import time
  from networkx.algorithms.assortativity import degree_mixing_dict
  from networkx.generators import gnm_random_graph, powerlaw_cluster_graph
  from networkx.generators.joint_degree_seq import directed_joint_degree_graph, is_valid_directed_joint_degree, is_valid_joint_degree, joint_degree_graph
label_desc: Use image node_id 2 for calling a global function with example usage: test_joint_degree_graph(ntimes) without return types