code: def unique(objects, key=None):
      
      dupl = []
      for obj, group in itertools.groupby(sorted(objects), key):
          if sum(1 for _ in group) > 1:
              dupl.append(obj)
      if dupl:
          raise ValueError('Found duplicates %s' % dupl)
      return objects
docs: Raise a ValueError if there is a duplicated object, otherwise
      returns the objects as they are.