def insert_synapses(self, cell, cellindex, synParams, idx = np.array([]),<EOL>X='<STR_LIT>', SpCell = np.array([]),<EOL>synDelays = None):
<EOL>try:<EOL><INDENT>spikes = self.networkSim.dbs[X].select(SpCell[:idx.size])<EOL><DEDENT>except AttributeError as ae:<EOL><INDENT>raise ae('<STR_LIT>')<EOL><DEDENT>if synDelays is not None and idx.size > <NUM_LIT:0>:<EOL><INDENT>for i, delay in enumerate(synDelays):<EOL><INDENT>if spikes[i].size > <NUM_LIT:0>:<EOL><INDENT>spikes[i] += delay<EOL><DEDENT><DEDENT><DEDENT>for i in range(idx.size):<EOL><INDENT>if len(spikes[i]) == <NUM_LIT:0>:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>synParams.update({'<STR_LIT>' : idx[i]})<EOL>synapse = LFPy.Synapse(cell, **synParams)<EOL>synapse.set_spike_times(spikes[i] + cell.tstartms)<EOL><DEDENT><DEDENT>
Insert synapse with `parameters`=`synparams` on cell=cell, with
segment indexes given by `idx`. `SpCell` and `SpTimes` picked from
Brunel network simulation


Parameters
----------
cell : `LFPy.Cell` instance
    Postsynaptic target cell.
cellindex : int
    Index of cell in population.
synParams : dict
    Parameters passed to `LFPy.Synapse`.
idx : numpy.ndarray
    Postsynaptic compartment indices.
X : str
    presynaptic population name
SpCell : numpy.ndarray
    Presynaptic spiking cells.
synDelays : numpy.ndarray
    Per connection specific delays.


Returns
-------
None


See also
--------
Population.insert_all_synapses