<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(values):
 """ Hash table-based unique. Uniques are returned in order of appearance. This does NOT sort. Significantly faster than numpy.unique. Includes NA values. Parameters values : 1d array-like Returns ------- numpy.ndarray or ExtensionArray The return can be: * Index : when the input is an Index * Categorical : when the input is a Categorical dtype * ndarray : when the input is a Series/ndarray Return numpy.ndarray or ExtensionArray. See Also -------- Index.unique Series.unique Examples -------- array([2, 1, 3]) array([2, 1]) array(['2016-01-01T00:00:00.000000000'], dtype='datetime64[ns]') array([Timestamp('2016-01-01 00:00:00-0500', tz='US/Eastern')], dtype=object) DatetimeIndex(['2016-01-01 00:00:00-05:00'], array(['b', 'a', 'c'], dtype=object) An unordered Categorical will return categories in the order of appearance. [b, a, c] Categories (3, object):
 [b, a, c] [b, a, c] Categories (3, object):
 [b, a, c] An ordered Categorical preserves the category ordering. [b, a, c] Categories (3, object):
 [a < b < c] An array of tuples array([('a', 'b'), ('b', 'a'), ('a', 'c')], dtype=object) """


    values = _ensure_arraylike(values)

    if is_extension_array_dtype(values):
        # Dispatch to extension dtype's unique.
        return values.unique()

    original = values
    htable, _, values, dtype, ndtype = _get_hashtable_algo(values)

    table = htable(len(values))
    uniques = table.unique(values)
    uniques = _reconstruct_data(uniques, dtype, original)
    return uniques