def odd_ext(x, n, axis=-<NUM_LIT:1>):
if n < <NUM_LIT:1>:<EOL><INDENT>return x<EOL><DEDENT>if n > x.shape[axis] - <NUM_LIT:1>:<EOL><INDENT>raise ValueError(("<STR_LIT>" +<EOL>"<STR_LIT>")<EOL>% (n, x.shape[axis] - <NUM_LIT:1>))<EOL><DEDENT>left_end = axis_slice(x, start=<NUM_LIT:0>, stop=<NUM_LIT:1>, axis=axis)<EOL>left_ext = axis_slice(x, start=n, stop=<NUM_LIT:0>, step=-<NUM_LIT:1>, axis=axis)<EOL>right_end = axis_slice(x, start=-<NUM_LIT:1>, axis=axis)<EOL>right_ext = axis_slice(x, start=-<NUM_LIT:2>, stop=-(n + <NUM_LIT:2>), step=-<NUM_LIT:1>, axis=axis)<EOL>ext = np.concatenate((<NUM_LIT:2> * left_end - left_ext,<EOL>x,<EOL><NUM_LIT:2> * right_end - right_ext),<EOL>axis=axis)<EOL>return ext<EOL>
Generate a new ndarray by making an odd extension of x along an axis.

    Parameters
    ----------
    x : ndarray
        The array to be extended.
    n : int
        The number of elements by which to extend x at each end of the axis.
    axis : int
        The axis along which to extend x.  Default is -1.

    Examples
    --------
    >>> a = array([[1.0,2.0,3.0,4.0,5.0], [0.0, 1.0, 4.0, 9.0, 16.0]])
    >>> _odd_ext(a, 2)
    array([[-1.,  0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.],
           [-4., -1,   0.,  1.,  4.,  9., 16., 23., 28.]])