docs: def _items(mappingorseq):
      """Wrapper for efficient iteration over mappings represented by dicts
      or sequences::
  
          >>> for k, v in _items((i, i*i) for i in xrange(5)):
          ...    assert k*k == v
  
          >>> for k, v in _items(dict((i, i*i) for i in xrange(5))):
          ...    assert k*k == v
  
      """
      if hasattr(mappingorseq, "iteritems"):
          return mappingorseq.iteritems()
      elif hasattr(mappingorseq, "items"):
          return mappingorseq.items()
      return mappingorseq