<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def unique(ar):
 r"""Find the unique elements of an array. It uses ``dask.array.unique`` if necessary. Args: ar (array_like):
 Input array. Returns: array_like: the sorted unique elements. """


    import dask.array as da

    if isinstance(ar, da.core.Array):
        return da.unique(ar)

    return _unique(ar)