parameters: (x, n, axis=-1)
return_statement: return ext
docstring: Create an ndarray that is an even 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, optional
          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]])
      >>> _even_ext(a, 2)
      array([[  3.,   2.,   1.,   2.,   3.,   4.,   5.,   4.,   3.],
             [  4.,   1.,   0.,   1.,   4.,   9.,  16.,   9.,   4.]])
docstring_summary: Create an ndarray that is an even extension of x along an axis.
docstring_tokens: Create an ndarray that is an even extension of x along an axis .
function: def even_ext(x, n, axis=-1):
      """Create an ndarray that is an even 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, optional
          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]])
      >>> _even_ext(a, 2)
      array([[  3.,   2.,   1.,   2.,   3.,   4.,   5.,   4.,   3.],
             [  4.,   1.,   0.,   1.,   4.,   9.,  16.,   9.,   4.]])
      """
      if n < 1:
          return x
      if n > x.shape[axis] - 1:
          raise ValueError(("The extension length n (%d) is too big. " +
                           "It must not exceed x.shape[axis]-1, which is %d.")
                           % (n, x.shape[axis] - 1))
      left_ext = axis_slice(x, start=n, stop=0, step=-1, axis=axis)
      right_ext = axis_slice(x, start=-2, stop=-(n + 2), step=-1, axis=axis)
      ext = np.concatenate((left_ext,
                            x,
                            right_ext),
                           axis=axis)
      return ext
function_tokens: def even_ext ( x , n , axis = - 1 ) : if n < 1 : return x if n > x . shape [ axis ] - 1 : raise ValueError ( ( "The extension length n (%d) is too big. " + "It must not exceed x.shape[axis]-1, which is %d." ) % ( n , x . shape [ axis ] - 1 ) ) left_ext = axis_slice ( x , start = n , stop = 0 , step = - 1 , axis = axis ) right_ext = axis_slice ( x , start = - 2 , stop = - ( n + 2 ) , step = - 1 , axis = axis ) ext = np . concatenate ( ( left_ext , x , right_ext ) , axis = axis ) return ext