#NEWLINE# def unique_array( arr ) : #NEWLINE# #INDENT# '\n    Returns an array of unique values in the input order\n    ' #NEWLINE# if pd : #NEWLINE# #INDENT# return pd . unique ( arr ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ( _ , uniq_inds ) = np . unique ( arr , return_index = True ) #NEWLINE# return arr [ np . sort ( uniq_inds ) ]