import gaffer ctx = gaffer.Context() ctx.set("input_data", "/path/to/input/data")
output_dir = ctx.get("output_dir", "/path/to/output/dir")
class MyTask(gaffer.Task): def run(self, ctx): input_data = ctx.get("input_data") output_dir = ctx.get("output_dir", "/path/to/output/dir") # do task processing here # use input_data and output_dir variables as neededThis creates a new task class that retrieves the values of the "input_data" and "output_dir" context variables and uses them in the task processing. The Gaffer ContextVariables library is part of the Gaffer workflow management system and is included within the gaffer package.