code: def is_tournament(G):
      """Returns True if and only if `G` is a tournament.
  
      A tournament is a directed graph, with neither self-loops nor
      multi-edges, in which there is exactly one directed edge joining
      each pair of distinct nodes.
  
      Parameters
      ----------
      G : NetworkX graph
          A directed graph representing a tournament.
  
      Returns
      -------
      bool
          Whether the given graph is a tournament graph.
  
      Examples
      --------
      >>> G = nx.DiGraph([(0, 1), (1, 2), (2, 0)])
      >>> nx.is_tournament(G)
      True
  
      Notes
      -----
      Some definitions require a self-loop on each node, but that is not
      the convention used here.
  
      """
      # In a tournament, there is exactly one directed edge joining each pair.
      return (
          all((v in G[u]) ^ (u in G[v]) for u, v in combinations(G, 2))
          and nx.number_of_selfloops(G) == 0
      )
  
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 2 for calling a global function with example usage: is_tournament(G) and returns: unknown