# 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
        self._sl = self.to_monitorSpikeList(self._data)
        self._sl.complete(self.addr_group.laddr)
        del self._data

    def get_normalized_addr(self, s_start=0.0, s_stop=1.0):
        """
        Return a an address list with the spikelist addresses mapped linearly to the interval (s_start, s_stop)
        """
        return self.__normalize_addr(s_start, s_stop)

    def __normalize_addr(self, s_start=0.0, s_stop=1.0):
        N = len(self)
        new_addrset = np.linspace(s_start, s_stop, N)
        return new_addrset

    def get_remapped_spikelist(self, s_start=0.0, s_stop=1.0):
        """
        Return a spikelist whose addresses are mapped linearly to the interval (s_start, s_stop)
        """
        mapping = dict(zip(
            self.addr_group.laddr, self.get_normalized_addr(s_start, s_stop)))
        return self.sl.id_list_map(mapping)

    def raster_plot(self, plot_kwargs={}, *args, **kwargs):
        """
        Raster plot of the spikelist. plot_kwargs is passed to the plot in raster_plot, whereas kwargs and args are passed to raster_plot.
        """
        plot_kwargs_mon = self.get_plotargs(plot_kwargs)
        self.sl.raster_plot(kwargs=plot_kwargs_mon, *args, **kwargs)


# 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

        self._sl = self.to_monitorSpikeList(self._data)
        self._sl.complete(self.addr_group.laddr)
        del self._data

    def get_normalized_addr(self, s_start=0.0, s_stop=1.0):
        """
        Return a an address list with the spikelist addresses mapped linearly to the interval (s_start, s_stop)
        """
        return self.__normalize_addr(s_start, s_stop)

    def __normalize_addr(self, s_start=0.0, s_stop=1.0):
        N = len(self)
        new_addrset = np.linspace(s_start, s_stop, N)
        return new_addrset

    def get_remapped_spikelist(self, s_start=0.0, s_stop=1.0):
        """
        Return a spikelist whose addresses are mapped linearly to the interval (s_start, s_stop)
        """
        mapping = dict(zip(
            self.addr_group.laddr, self.get_normalized_addr(s_start, s_stop)))
        return self.sl.id_list_map(mapping)

    def raster_plot(self, plot_kwargs={}, *args, **kwargs):
        """
        Raster plot of the spikelist. plot_kwargs is passed to the plot in raster_plot, whereas kwargs and args are passed to raster_plot.
        """
        plot_kwargs_mon = self.get_plotargs(plot_kwargs)
        self.sl.raster_plot(kwargs=plot_kwargs_mon, *args, **kwargs)


    def composite_plot(self, *args, **kwargs):