

def args_from_config(func):
    'Decorator that injects parameters from the configuration.\n    '
    func_args = signature(func_args).parameters

    @wraps(func)
    def wrapper(*args, **kwargs):
        config = get_config()
        for (i, argname) in enumerate(func_args):
            if ((len(args) > i) or (argname in kwargs)):
                continue
            elif (argname in config):
                kwargs[argname] = config[argname]
        try:
            getcallargs(func, *args, **kwargs)
        except TypeError as exc:
            msg = '{}\n{}'.format(exc.args[0], PALLADIUM_CONFIG_ERROR)
            exc.args = (msg,)
            raise exc
        return func(*args, **kwargs)
    wrapper.__wrapped__ = func
    return wrapper

dataset/ETHPy150Open ottogroup/palladium/palladium/util.py args_from_config/VarMisuse@16/39 `func`->`func_args`