<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 About
https
Step1:  Instantiate a workflow engine
Step4:  Create tasks
Step5:  Create a workflow definition
Step6:  Define tokens
Step7:  Run the engine
Step8:  Resuing the engine
<ASSISTANT_TASK:>
Python Code:
from workflow.engine import GenericWorkflowEngine
Explanation: About
https://github.com/inveniosoftware/workflow
https://github.com/satishgoda/workflow
http://workflow.readthedocs.io
The Workflow library provides a method of running Finite State Machines with memory. It can be used to execute a set of methods, complete with conditions and patterns.
Workflow allows for a number of independent pieces of data to be processed by the same logic, while allowing for the entire process to be forwarded, backwarded, paused, inspected, re-executed, modified and stored.
Basic workflow usage
End of explanation
my_engine = GenericWorkflowEngine()
Explanation: Instantiate a workflow engine
End of explanation
from functools import wraps
def print_data(obj, eng):
    Print the data found in the token.
    print(obj.data)
    
def add_data(number_to_add):
    Add number_to_add to obj.data.
    @wraps(add_data)
    def _add_data(obj, eng):
        obj.data += number_to_add
    return _add_data
Explanation: Create tasks
End of explanation
my_workflow_definition = [
    add_data(1),
    print_data
]
Explanation: Create a workflow definition
End of explanation
class MyObject:
    def __init__(self, data):
        self._data = data
    
    @property
    def data(self):
        return self._data
    
    @data.setter
    def data(self, value):
        print(self)
        self._data = value
    
    def __repr__(self):
        return "{0} : {1}".format(hex(id(self)), self._data)
my_object0 = MyObject(0)
my_object1 = MyObject(1)
Explanation: Define tokens
End of explanation
my_engine.callbacks.replace(my_workflow_definition)
my_engine.process([my_object0, my_object1])
Explanation: Run the engine
End of explanation
my_engine.process([my_object0, my_object1])
Explanation: Resuing the engine
End of explanation
<END_TASK>