<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, **kwargs):
 """Serialize a raw or translated write request and send it to the VI, following the OpenXC message format. """

        if 'id' in kwargs and 'data' in kwargs:
            result = self.write_raw(kwargs['id'], kwargs['data'],
                    bus=kwargs.get('bus', None),
                    frame_format=kwargs.get('frame_format', None))
        else:
            result = self.write_translated(kwargs['name'], kwargs['value'],
                    event=kwargs.get('event', None))
        return result