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