code: def unique(g):
      
      yielded = set()
      for value in g:
          if value not in yielded:
              yield value
              yielded.add(value)
docs: Yield values yielded by ``g``, removing any duplicates.
  
      Example
      -------
      >>> list(unique(iter([1, 3, 1, 2, 3])))
      [1, 3, 2]