def required_data(*data):
def decorator_fn(f):<EOL><INDENT>@wraps(f)<EOL>def required_data_decorator(*args, **kwargs):<EOL><INDENT>task_data = _get_data_from_args(args).get_data()<EOL>for i in data:<EOL><INDENT>if i not in task_data:<EOL><INDENT>raise KeyError(<EOL>'<STR_LIT>'.format(i))<EOL><DEDENT><DEDENT>return f(*args, **kwargs)<EOL><DEDENT>return required_data_decorator<EOL><DEDENT>return decorator_fn<EOL>
Task decorator which checks if the given variables (indices) are stored
inside the task data.