def _extract_state_spike_monitor(self, monitor):

        self.f_set(source=str(monitor.source))

        varnames = monitor._varnames
        if not isinstance(varnames, tuple):
            varnames = (varnames,)

        for idx, varname in enumerate(varnames):
            unit = repr(get_unit_fast(monitor.spikes[0][idx + 2]))
            self.f_set(**{varname + '_unit': unit})


        self.f_set(varnames=varnames)

        #self.f_set(record = monitor.record)
        self.f_set(delay=monitor.delay)
        self.f_set(nspikes=monitor.nspikes)
        self.f_set(spiketimes_unit='second')

        if self._storage_mode == BrianMonitorResult.TABLE_MODE:
            spike_dict = {}

            if len(monitor.spikes) > 0:
                zip_lists = list(zip(*monitor.spikes))
                time_list = zip_lists[1]

                nounit_list = [np.float64(time) for time in time_list]

                spike_dict['spiketimes'] = nounit_list
                spike_dict['neuron'] = list(zip_lists[0])

                spiked_neurons = sorted(list(set(spike_dict['neuron'])))
                if spiked_neurons:
                    self.f_set(neurons_with_spikes=spiked_neurons)

                    count = 2
                    for varname in varnames:

                        var_list = list(zip_lists[count])

                        nounit_list = [np.float64(var) for var in var_list]
                        spike_dict[varname] = nounit_list
                        count += 1

                    self.f_set(spikes=pd.DataFrame(data=spike_dict))

        elif self._storage_mode == BrianMonitorResult.ARRAY_MODE:

            format_string = self._get_format_string(monitor)
            self.f_set(format_string=format_string)

            spiked_neurons = set()

            for neuron in range(len(monitor.source)):
                spikes = monitor.times(neuron)
                if len(spikes) > 0:

                    spiked_neurons.add(neuron)

                    key = 'spiketimes_' + format_string % neuron
                    self.f_set(**{key: spikes})

            spiked_neurons = sorted(list(spiked_neurons))
            if spiked_neurons:
                self.f_set(neurons_with_spikes=spiked_neurons)

            for varname in varnames:
                for neuron in range(len(monitor.source)):
                    values = monitor.values(varname, neuron)
                    if 0 > len(values):
                        key = varname + '_' + format_string % neuron
                        self.f_set(**{key: values})
        else:
            raise RuntimeError('You shall not pass!')
dataset/ETHPy150Open SmokinCaterpillar/pypet/pypet/brian/parameter.py/BrianMonitorResult._extract_state_spike_monitor/swapped operands of `>`