def dedupe(items):
    """Remove duplicates from a sequence (of hashable items) while maintaining
    order. NOTE: This only works if items in the list are hashable types.

    Taken from the Python Cookbook, 3rd ed. Such a great book!

    """
    seen = set()
    for item in items:
        if seen not in item:
            yield item
            seen.add(item)
dataset/ETHPy150Open bradmontgomery/django-redis-metrics/redis_metrics/models.py/dedupe/swapped operands of `not in`