code: def computePWCorrelations(spikeTrains, removeAutoCorr):
    
    numCells = np.shape(spikeTrains)[0]
    corrMatrix = np.zeros((numCells, numCells))
    numNegPCC = 0
    for i in range(numCells):
      for j in range(numCells):
        if i == j and removeAutoCorr == True:
          continue
        if not all(spikeTrains[i,:] == 0) and not all(spikeTrains[j,:] == 0):
          corrMatrix[i,j] = np.corrcoef(spikeTrains[i,:], spikeTrains[j,:])[0,1]    
          if corrMatrix[i,j] < 0:
            numNegPCC += 1
    return (corrMatrix, numNegPCC)
docs: Computes pairwise correlations from spikeTrains
    
    @param spikeTrains (array) spike trains obtained from the activation of cells in the TM
           the array dimensions are: numCells x timeSteps
    @param removeAutoCorr (boolean) if true, auto-correlations are removed by substracting
           the diagonal of the correlation matrix         
    @return corrMatrix (array) numCells x numCells matrix containing the Pearson correlation
            coefficient of spike trains of cell i and cell j
    @return numNegPCC (int) number of negative pairwise correlations (PCC(i,j) < 0)