code: def _populate_random_tournament_row_col(n, r, row, col):
      
      k = 0
      for i in range(n):
          for j in range(i+1, n):
              if r[k] < 0.5:
                  row[k], col[k] = i, j
              else:
                  row[k], col[k] = j, i
              k += 1
docs: Populate ndarrays `row` and `col` with directed edge indices
      determined by random numbers in `r` for a tournament graph with n
      nodes, which has num_edges = n * (n-1) // 2 edges.
  
      Parameters
      ----------
      n : scalar(int)
          Number of nodes.
  
      r : ndarray(float, ndim=1)
          ndarray of length num_edges containing random numbers in [0, 1).
  
      row, col : ndarray(int, ndim=1)
          ndarrays of length num_edges to be modified in place.