def get_xy(self, xlim, fraction=<NUM_LIT:1.>):
x = {}<EOL>y = {}<EOL>for X, nodes in self.nodes.items():<EOL><INDENT>x[X] = np.array([])<EOL>y[X] = np.array([])<EOL>if fraction != <NUM_LIT:1>:<EOL><INDENT>nodes = np.random.permutation(nodes)[:int(nodes.size*fraction)]<EOL>nodes.sort()<EOL><DEDENT>spiketimes = self.dbs[X].select_neurons_interval(nodes, T=xlim)<EOL>i = <NUM_LIT:0><EOL>for times in spiketimes:<EOL><INDENT>x[X] = np.r_[x[X], times]<EOL>y[X] = np.r_[y[X], np.zeros(times.size) + nodes[i]]<EOL>i += <NUM_LIT:1><EOL><DEDENT><DEDENT>return x, y<EOL>
Get pairs of node units and spike trains on specific time interval.


Parameters
----------
xlim : list of floats
    Spike time interval, e.g., [0., 1000.].
fraction : float in [0, 1.]
    If less than one, sample a fraction of nodes in random order.


Returns
-------
x : dict
    In `x` key-value entries are population name and neuron spike times.
y : dict
    Where in `y` key-value entries are population name and neuron gid number.