import functools


def env(**env_vector):
    """Decorator for task callable - inject environment into function args
    
    Keyword Arguments:
        env_vector {dict} -- Additional environment to pass into function as named argument "env")
    
    Returns:
        callable -- Wrapped node
    """
    def decorator(func):
        @functools.wraps(func)
        def wrapper(context, **kwargs):
            env = kwargs.get('env', {})
            env.update(env_vector)
            kwargs.update({"env": env})
            return func(context, **kwargs)
        return wrapper
    return decorator