<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def insert(self, index, *grids):
 """Return a copy with ``grids`` inserted before ``index``. The given grids are inserted (as a block) into ``self``, yielding a new grid whose number of dimensions is the sum of the numbers of dimensions of all involved grids. Note that no changes are made in-place. Parameters index : int The index of the dimension before which ``grids`` are to be inserted. Negative indices count backwards from ``self.ndim``. The grids to be inserted into ``self``. Returns ------- newgrid : `RectGrid` The enlarged grid. Examples -------- RectGrid( [ 0., 1.], [ 1.], [ -6., 15.], [-1., 0., 2.] ) RectGrid( [ 0., 1.], [ 1.], [ -6., 15.], [ 1.], [ -6., 15.], [-1., 0., 2.] ) See Also -------- append """

        index, index_in = safe_int_conv(index), index
        if not -self.ndim <= index <= self.ndim:
            raise IndexError('index {0} outside the valid range -{1} ... {1}'
                             ''.format(index_in, self.ndim))
        if index < 0:
            index += self.ndim

        if len(grids) == 0:
            # Copy of `self`
            return RectGrid(*self.coord_vectors)
        elif len(grids) == 1:
            # Insert single grid
            grid = grids[0]
            if not isinstance(grid, RectGrid):
                raise TypeError('{!r} is not a `RectGrid` instance'
                                ''.format(grid))
            new_vecs = (self.coord_vectors[:index] + grid.coord_vectors +
                        self.coord_vectors[index:])
            return RectGrid(*new_vecs)
        else:
            # Recursively insert first grid and the remaining into the result
            return self.insert(index, grids[0]).insert(
                index + grids[0].ndim, *(grids[1:]))