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

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
create an ndarray that is an even extension of x along an axis .