def _parameters_link(args, parameters):
    """Build arguments based on the arguments and parameters provided."""
    args_ = {}
    for index, arg in enumerate(args):
        args_.setdefault(arg, []).append(index)
    args_ = {key: iter(value) for key, value in args_.items()}
    return [next(args_.get(p, iter([p]))) for p in parameters]