def call(f, *args, **kwargs):
    """When used in pipe, calls given function.

    Calls given function, passing pipe argument first, before args and kwargs.
    Hence function should be (re)designed to handle this.
    Resulting value is then used as pipe argument and passed along further.

    Note:
        kwargs will overwrite pipe argument ``if xarg in kwarg``.

    Args:
        f: function to call
        *args: other positional arguments to the function
        **kwargs: keyword arguments to the function

    Returns:
        function that performs the required action in pipe

    """

    def g(x):
        pargs = (x,) + args
        return f(*pargs, **kwargs)

    return g