def single_key_output(items):
    """Override ``MapReduce.output()`` with a custom method that passes
    ``items`` to this method when dealing with outputs that only have a single
    value for every key.  For the standard word count example this would
    change the output from:

        (word1, (sum,)
        (word2, (sum,)
        (word3, (sum,)

    to:

        (word1, sum)
        (word2, sum)
        (word3, sum)

    The result is that the output can be passed directly to ``dict()``, if it
    fits in memory for more straightforwad key -> value lookups, rather than
    doing: ``next(iter(output[key]))``.

    Parameters
    ----------
    items : iter
        Stream of ``(key, values)`` pairs where ``values`` is also an iterable.

    Yields
    ------
    tuple
        The equivalent of ``(key, next(iter(values)))``.
    """
    for key, value in items:
        yield key, next(iter(value))
