code: def _condensedIndex(indicesA, indicesB, n):
      
      indicesA = numpy.array(indicesA, dtype=int)
      indicesB = numpy.array(indicesB, dtype=int)
      n = int(n)
  
      # Ensure that there are no self-comparisons
      assert (indicesA != indicesB).all()
  
      # re-arrange indices to ensure that rowIxs[i] < colIxs[i] for all i
      rowIxs = numpy.where(indicesA < indicesB, indicesA, indicesB)
      colIxs = numpy.where(indicesA < indicesB, indicesB, indicesA)
  
      flatIxs = rowIxs * (n - 1) - (rowIxs + 1) * rowIxs / 2 + colIxs - 1
  
      return flatIxs
docs: Given a set of n points for which pairwise overlaps are stored in a flat
      array X in the format returned by _computeOverlaps (upper triangular of the
      overlap matrix in row-major order), this function returns the indices in X
      that correspond to the overlaps for the pairs of points specified.
  
      Example
      -------
      Consider the case with n = 5 data points for which pairwise overlaps are
      stored in array X, which has length 10 = n(n-1)/2. To obtain the overlap
      of points 2 and 3 and the overlap of points 4 and 1, call 
  
        idx = _condensedIndex([2, 4], [3, 1], 5) # idx == [6, 1]
  
      Note: Since X does not contain the diagonal (self-comparisons), it is
      invalid to pass arrays such that indicesA[i] == indicesB[i] for any i.
  
      @param indicesA (arraylike) First dimension of pairs of datapoint indices
  
      @param indicesB (arraylike) Second dimension of pairs of datapoint indices
  
      @param n (int) Number of datapoints
  
      @returns (numpy.ndarray) Indices in condensed overlap matrix containing
          specified overlaps. Dimension will be same as indicesA and indicesB.