def sink_return(func, sink, splitter=None):  # pragma: no cover
    """Transform a function `func` that returns tuples into a function that returns
    single values. Call a function `sink` on the unused values.
    """

    def wrap(*args, **kwargs):
        output = func(*args, **kwargs)
        if splitter is None:
            to_keep, to_sink = output
        else:
            to_keep, to_sink = splitter(*output)
        sink(to_sink)
        return to_keep

    return wrap
def sink_return ( func , sink , splitter = None ) : def wrap ( * args , ** kwargs ) : output = func ( * args , ** kwargs ) if splitter is None : to_keep , to_sink = output else : to_keep , to_sink = splitter ( * output ) sink ( to_sink ) return to_keep return wrap
Transform a function `func` that returns tuples into a function that returns
    single values. Call a function `sink` on the unused values.