<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def serialize(self, format):
 """ Serialize provenance graph in the specified format """

        if PY3:
            return self.prov_g.serialize(format=format).decode('utf-8')
        else:
            return self.prov_g.serialize(format=format)