def iteritems(dictionary):
    """Replacement to account for iteritems/items switch in Py3."""
    if hasattr(dictionary, 'iteritems'):
        return dictionary.iteritems()
    return dictionary.items()
