def move(cm, from_start, from_end, insert_pos):
    """
    Move rows from_start - from_end to insert_pos in-place.

    Parameters
    ----------
    cm : ndarray
    from_start : int
    from_end : int
    insert_pos : int

    Returns
    -------
    cm : ndarray

    Examples
    --------
    >>> cm = np.array([[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 0, 1], [2, 3, 4, 5]])
    >>> move(cm, 1, 2, 0)
    array([[5, 6, 4, 7],
           [9, 0, 8, 1],
           [1, 2, 0, 3],
           [3, 4, 2, 5]])
    """
    if not (insert_pos < from_start or insert_pos > from_end):
        raise ValueError(
            'insert_pos={} needs to be smaller than from_start={} or greater than from_end={}'
            .format(insert_pos, from_start, from_end))
    if insert_pos > from_end:
        p_new = list(range(from_end + 1, insert_pos + 1)) + list(range(
            from_start, from_end + 1))
    else:
        p_new = list(range(from_start, from_end + 1)) + list(range(
            insert_pos, from_start))
    p_old = sorted(p_new)
    cm[:, (p_old)] = cm[:, (p_new)]
    cm[(p_old), :] = cm[(p_new), :]
    return cm
