task could be "call double with argument another task would be "call double with argument using jugswe can build these tasks as followsfrom jug import task task(double task(double save this to file called jugfile py (which is just regular python filenowwe can run jug execute to run the tasks this is something you run on the command linenot at the python promptinstead of python' jugfile py file (which should do nothing)you run jug execute you will also get some feedback on the tasks (jug will say that two tasks named "doublewere runrun jug execute again and it will tell you that it did nothingit does not need to in this casewe gained littlebut if the tasks took long time to computeit would be very useful you may notice that new directory named jugfile jugdata also appeared on your hard drivewith few other weirdly named files this is the memoization cache if you remove itjug execute will run all your tasks (both of themagain often it is good to distinguish between pure functionswhich simply take their inputs and return resultfrom more general functions that can perform actions such as reading from fileswriting to filesaccessing global variablesmodifying their argumentsor anything that the language allows some programming languagessuch as haskelleven have syntactic ways in which to distinguish pure from impure functions with jugyour tasks do not need to be perfectly pure it is even recommended that you use tasks to read your data or write your results howeveraccessing and modifying global variables will not work wellthe tasks may be run in any order in different processors the exceptions are global constantsbut even this may confuse the memoization system (if the value is changed between runssimilarlyyou should not modify the input values jug has debug mode (use jug execute--debug)which slows down your computationbut would give you useful error messages if you make this sort of mistake the preceding code works but it is bit cumbersomeyou are always repeating the task(functionargumentconstruct using bit of python magicwe can make the code even more naturalfrom jug import taskgenerator from time import sleep @taskgenerator def double( )