<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_monotonic(a, increasing=True):
 """ Tests whether a vector a has monotonicity. Parameters a : array-like Array that should be tested for monotonicity increasing : bool, default: True Test if the array is montonically increasing, otherwise test if the array is montonically decreasing. """

    a = np.asarray(a) # ensure a is array-like

    if a.ndim > 1:
        raise ValueError("not supported for multi-dimensonal arrays")

    if len(a) <= 1:
        return True

    if increasing:
        return np.all(a[1:] >= a[:-1], axis=0)
    return np.all(a[1:] <= a[:-1], axis=0)