sleep( return * @taskgenerator def add(ab)return @taskgenerator def print_final_result(onamevalue)with open(oname' 'as outputprint >>output"final result:"value double( double(yy double( double( print_final_result('output txt'add( , )except for the use of taskgeneratorthe preceding code could have been standard python file howeverusing taskgeneratorit actually creates series of tasksand it is now possible to run it in way that takes advantage of multiple processors behind the scenesthe decorator transforms your functions so that they do not actually execute but create task we also take advantage of the fact that we can pass tasks to other tasks and this results in dependency being generated you may have noticed that we added few sleep( calls in the preceding code this simulates running long computation otherwisethis code is so fast that there is no point in using multiple processors we start by running jug statusnow we start two processes simultaneously (in the background)jug execute jug execute