'Expand SourceEstimate to include more vertices.
This will add rows to stc.data (zero-filled) and modify stc.vertices
to include all vertices in stc.vertices and the input vertices.
Parameters
vertices : list of array
New vertices to add. Can also contain old values.
Returns
stc : instance of SourceEstimate
The modified stc (note: method operates inplace).'

def expand(self, vertices):

    if (not isinstance(vertices, list)):
        raise TypeError('vertices    must    be    a    list')
    if (not (len(self.vertices) == len(vertices))):
        raise ValueError('vertices    must    have    the    same    length    as    stc.vertices')
    self._remove_kernel_sens_data_()
    inserters = list()
    offsets = [0]
    for (vi, (v_old, v_new)) in enumerate(zip(self.vertices, vertices)):
        v_new = np.setdiff1d(v_new, v_old)
        inds = np.searchsorted(v_old, v_new)
        inserters += [inds.copy()]
        offsets += [len(v_old)]
        self.vertices[vi] = np.insert(v_old, inds, v_new)
    inds = [(ii + offset) for (ii, offset) in zip(inserters, offsets[:(-1)])]
    inds = np.concatenate(inds)
    new_data = np.zeros((len(inds), self.data.shape[1]))
    self.data = np.insert(self.data, inds, new_data, axis=0)
    return self
