<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, zenpy_object):
 """ Serialize a Zenpy object to JSON """

        # If it's a dict this object has already been serialized.
        if not type(zenpy_object) == dict:
            log.debug("Setting dirty object: {}".format(zenpy_object))
            self._dirty_object = zenpy_object
        return json.loads(json.dumps(zenpy_object, default=json_encode_for_zendesk))