def iteritems(obj, **kwargs):
    "replacement for six's iteritems for Python2/3 compat\n       uses 'iteritems' if available and otherwise uses 'items'.\n\n       Passes kwargs to method.\n    "
    func = getattr(obj, 'iteritems', None)
    if (not func):
        func = obj.items
    return func(**kwargs)
replacement for six's iteritems for Python2/3 compat
uses 'iteritems' if available and otherwise uses 'items'.

Passes kwargs to method.
def iteritems(obj, **kwargs):
    "replacement for six's iteritems for Python2/3 compat\n       uses 'iteritems' if available and otherwise uses 'items'.\n\n       Passes kwargs to method.\n    "
    func = getattr(obj, 'iteritems', None)
    if (not func):
        func = obj.items
    return func(**kwargs)