<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def graft(func=None, *, namespace=None):
 """Decorator for marking a function as a graft. Parameters: namespace (str):
 namespace of data, same format as targeting. Returns: Graft For example, these grafts:: @graft def foo_data: return {'foo', True} @graft(namespace='bar') def bar_data: return False will be redered has:: { 'foo': True, 'bar': False } """


    if not func:
        return functools.partial(graft, namespace=namespace)

    if isinstance(func, Graft):
        return func

    return Graft(func, namespace=namespace)