def iter_items(iterable):
if hasattr(iterable, "<STR_LIT>"):<EOL><INDENT>for key in iterable.keys():<EOL><INDENT>yield key, iterable[key]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>for key, value in iterable:<EOL><INDENT>yield key, value<EOL><DEDENT><DEDENT>
Iterate through all items (key-value pairs) within an iterable
    dictionary-like object. If the object has a `keys` method, this is
    used along with `__getitem__` to yield each pair in turn. If no
    `keys` method exists, each iterable element is assumed to be a
    2-tuple of key and value.