<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_or_edit(self, id, seq, resource):
 # pylint: disable=invalid-name,redefined-builtin """Create or edit a highlight. :param id: Result ID as an int. :param seq: TestResult sequence ID as an int. :param resource: :class:`highlights.Highlight <highlights.Highlight>` object :return: :class:`highlights.Highlight <highlights.Highlight>` object :rtype: highlights.Highlight """

        schema = HighlightSchema(exclude=('id', 'seq'))
        json = self.service.encode(schema, resource)

        schema = HighlightSchema()
        resp = self.service.edit(self._base(id, seq), resource.line, json)
        return self.service.decode(schema, resp)