human
Complete this python program:
def iternext_impl(func):
assistant
#Here is the Python program you requested.

    """Wrap the given iternext() implementation so that it gets passed
    an _IternextResult() object easing the returning of the iternext()
    result pair.
    The wrapped function will be called with the following signature:
    (context, builder, sig, args, iternext_result)
    """
    def wrapper(context, builder, sig, args):
        pair_type = sig.return_type
        pairobj = context.make_helper(builder, pair_type)
        func(context, builder, sig, args, _IternextResult(context, builder, pairobj))
        return impl_ret_borrowed(context, builder, pair_type, pairobj._getvalue())
    return wrapper