code: def random_tournament(n, seed=None):
      r"""Returns a random tournament graph on `n` nodes.
  
      Parameters
      ----------
      n : int
          The number of nodes in the returned graph.
      seed : integer, random_state, or None (default)
          Indicator of random number generation state.
          See :ref:`Randomness<randomness>`.
  
      Returns
      -------
      G : DiGraph
          A tournament on `n` nodes, with exactly one directed edge joining
          each pair of distinct nodes.
  
      Notes
      -----
      This algorithm adds, for each pair of distinct nodes, an edge with
      uniformly random orientation. In other words, `\binom{n}{2}` flips
      of an unbiased coin decide the orientations of the edges in the
      graph.
  
      """
      # Flip an unbiased coin for each pair of distinct nodes.
      coins = (seed.random() for i in range((n * (n - 1)) // 2))
      pairs = combinations(range(n), 2)
      edges = (
          (u, v) if r < 0.5 else (v, u)
          for (u, v), r in zip(pairs, coins)
      )
      return nx.DiGraph(edges)
  
file_path: networkx/networkx/algorithms/tournament.py
imports: from itertools import combinations
  import networkx
  from networkx.algorithms.simple_paths import is_simple_path
  from networkx.utils import arbitrary_element, not_implemented_for, py_random_state
label_desc: Use image node_id 4 for calling a global function with example usage: random_tournament(n, seed) and returns: nx