code: def test_directed_degree_sequence():
      # Test a range of valid directed degree sequences
      n, r = 100, 10
      p = 1.0 / r
      for i in range(r):
          G = nx.erdos_renyi_graph(n, p * (i + 1), None, True)
          din = (d for n, d in G.in_degree())
          dout = (d for n, d in G.out_degree())
          assert nx.is_digraphical(din, dout)
  
file_path: networkx/networkx/algorithms/tests/test_graphical.py
imports: import pytest
  import networkx
label_desc: Use image node_id 8 for calling a global function with example usage: test_directed_degree_sequence() without return types