import functools


def partial_at(func, indices, *args):
    """Partial function application for arguments at given indices."""

    @functools.wraps(func)
    def wrapper(*fargs, **fkwargs):
        nargs = len(args) + len(fargs)
        iargs = iter(args)
        ifargs = iter(fargs)

        posargs = (next((ifargs, iargs)[i in indices]) for i in range(nargs))
        # posargs = list( posargs )
        # print( 'posargs', posargs )

        return func(*posargs, **fkwargs)

    return wrapper