Flummoxed by IT: Python AttributeError: 'set' object has no attribute 'items'