# Path: src/pyNCS/pyST/STsl.py
# def plot_raster(SL, id_list=None, t_start=None, t_stop=None, display=True, id_color=None, kwargs={}):
# def composite_plot_superimposed(st_pre, st_post, kwargs={}, colors=['blue', 'k'], id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, pre_rate_mult=1.):
# def composite_plot(SL, id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, display=True, kwargs={}, kwargs_bar={}):
# def composite_plot_movie(SL, time_bin=10, t_start=None, t_stop=None, output="animation.mpg", bounds=(0, 5), fps=10, display=True, maxrate=None, ratebin=None, kwargs={}):
# def mapSpikeListAddresses(SL, mapping=None):
# def ksi(SL, t_stop=800, pow_freq=None, t_bin=10.):
#     N = len(SL)


import numpy as np
import pylab
import copy
import matplotlib.ticker as mticker
from collections import defaultdict
from .pyST.STsl import mapSpikeListAddresses, composite_plot, SpikeList, SpikeTrain, merge_spikelists
    from pyNCS import AddrGroupBase
    """
    A container for SpikeMonitors.
    This object is automatically generated by NeuroSetup as neurosetup.monitors
    """
    def __init__(self):
        self.monitors = []
        self.__class__.get_t_start = get_t_start
        self.__class__.get_t_stop = get_t_stop

    def __iter__(self):
        for mon in self.monitors:
            yield mon

    def __len__(self):
        return len(self.monitors)

    def __getitem__(self, item_id):
        return self.monitors[item_id]

    def __setitem__(self, item_id, item):
        self.monitors[item_id] = item

    def append(self, spikemonitor):
        if not isinstance(spikemonitor, SpikeMonitor):
            raise TypeError('Can only append a object of type SpikeMonitor')

    def to_chstlist(self):
        '''
        Returns a dictionary with channels as keys and merged SpikeLists as values.
        '''

# Path: src/pyNCS/pyST/STsl.py
# def plot_raster(SL, id_list=None, t_start=None, t_stop=None, display=True, id_color=None, kwargs={}):
# def composite_plot_superimposed(st_pre, st_post, kwargs={}, colors=['blue', 'k'], id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, pre_rate_mult=1.):
# def composite_plot(SL, id_list=None, t_start=None, t_stop=None, t_start_rate=None, t_stop_rate=None, display=True, kwargs={}, kwargs_bar={}):
# def composite_plot_movie(SL, time_bin=10, t_start=None, t_stop=None, output="animation.mpg", bounds=(0, 5), fps=10, display=True, maxrate=None, ratebin=None, kwargs={}):
# def mapSpikeListAddresses(SL, mapping=None):
# def ksi(SL, t_stop=800, pow_freq=None, t_bin=10.):
#     N = len(SL)


# Path: src/pyNCS/monitors.py
import numpy as np
import pylab
import copy
import matplotlib.ticker as mticker
from collections import defaultdict
from .pyST.STsl import mapSpikeListAddresses, composite_plot, SpikeList, SpikeTrain, merge_spikelists
    from pyNCS import AddrGroupBase

    """
    A container for SpikeMonitors.
    This object is automatically generated by NeuroSetup as neurosetup.monitors
    """
    def __init__(self):
        self.monitors = []
        self.__class__.get_t_start = get_t_start
        self.__class__.get_t_stop = get_t_stop

    def __iter__(self):
        for mon in self.monitors:
            yield mon

    def __len__(self):
        return len(self.monitors)

    def __getitem__(self, item_id):
        return self.monitors[item_id]

    def __setitem__(self, item_id, item):
        self.monitors[item_id] = item

    def append(self, spikemonitor):
        if not isinstance(spikemonitor, SpikeMonitor):
            raise TypeError('Can only append a object of type SpikeMonitor')

    def to_chstlist(self):
        '''
        Returns a dictionary with channels as keys and merged SpikeLists as values.
        '''

        chstlist = defaultdict(SpikeList)