code: def countInSample(binaryWord, spikeTrain):
    
    count = 0
    timeSteps = np.shape(spikeTrain)[1]
    for i in range(timeSteps):
      if np.dot(binaryWord, spikeTrain[:,i]) == np.count_nonzero(binaryWord):
        count += 1
        #print i
    return count
docs: Counts the times in which a binary pattern (e.g. [1 0 0 1 1 0 1]) occurs in a spike train
    
    @param binaryWord (array) binary vector to be search within the spike train matrix.
    @param spikeTrain (array) matrix of spike trains. Dimensions of binary word are 1xN, whereas
           dimensions of spikeTrain must be NxtimeSteps
    @return count (int) number of occurrences of binaryWord in spikeTrains