code: def distinct(iterable, keyfunc=None):
      '''Yields distinct items from `iterable` in the order that they appear.
      '''
      seen = set()
      for item in iterable:
          key = item if keyfunc is None else keyfunc(item)
          if key not in seen:
              seen.add(key)
              yield itef distinct(iterable, keyfunc=None):
      '''Yields distinct items from `iterable` in the order that they appear.
      '''
      seen = set()
      for item in iterable:
          key = item if keyfunc is None else keyfunc(item)
          if key not in seen:
              seen.add(key)
              yield item
docs: Yields distinct items from `iterable` in the order that they appear.