<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def canonicalize(parsed_op):
 """ Get the "canonical form" of this operation, putting it into a form where it can be serialized to form a consensus hash. This method is meant to preserve compatibility across blockstackd releases. For NAME_TRANSFER, this means: * add 'keep_data' flag """

    assert 'op' in parsed_op
    assert len(parsed_op['op']) == 2

    if parsed_op['op'][1] == TRANSFER_KEEP_DATA:
        parsed_op['keep_data'] = True
    elif parsed_op['op'][1] == TRANSFER_REMOVE_DATA:
        parsed_op['keep_data'] = False
    else:
        raise ValueError("Invalid op '{}'".format(parsed_op['op']))

    return parsed_op