code: def unique(seq):
      
      # First check if all elements are hashable, if so O(n) can be done
      try:
          return list(OrderedDict.fromkeys(seq))
      except TypeError:
          # Unhashable, resort to O(n^2)
          unique_values = []
          for i in seq:
              if i not in unique_values:
                  unique_values.append(i)
          return unique_values
docs: Return the unique values in a sequence.
  
      Parameters
      ----------
      seq : sequence
          Sequence with (possibly duplicate) elements.
  
      Returns
      -------
      unique : list
          Unique elements of ``seq``.
          Order is guaranteed to be the same as in seq.
  
      Examples
      --------
      Determine unique elements in list
  
      >>> unique([1, 2, 3, 3])
      [1, 2, 3]
  
      >>> unique((1, 'str', 'str'))
      [1, 'str']
  
      The utility also works with unhashable types:
  
      >>> unique((1, [1], [1]))
      [1, [1]]