code: def poissonSpikeGenerator(firingRate, nBins, nTrials):
    
    dt = 0.001 # we are simulating a ms as a single bin in a vector, ie 1sec = 1000bins
    poissonSpikeTrain = np.zeros((nTrials, nBins), dtype = "uint32")
    for i in range(nTrials):
      for j in range(int(nBins)):
        if random.random() < firingRate*dt:
          poissonSpikeTrain[i,j] = 1
    return poissonSpikeTrain
docs: Generates a Poisson spike train.
    
    @param firingRate (int) firing rate of sample of Poisson spike trains to be generated
    @param nBins (int) number of bins or timesteps for the Poisson spike train
    @param nTrials (int) number of trials (or cells) in the spike train
    @return poissonSpikeTrain (array)