def inverted(arg):
inv = getattr(arg, '<STR_LIT>', None)<EOL>if callable(inv):<EOL><INDENT>return inv()<EOL><DEDENT>return ((val, key) for (key, val) in _iteritems_mapping_or_iterable(arg))<EOL>
Yield the inverse items of the provided object.

    If *arg* has a :func:`callable` ``__inverted__`` attribute,
    return the result of calling it.

    Otherwise, return an iterator over the items in `arg`,
    inverting each item on the fly.

    *See also* :attr:`bidict.BidirectionalMapping.__inverted__`