<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_event(self, event):
 """Writes an ``Event`` object to Splunk. :param event: An ``Event`` object. """


        if not self.header_written:
            self._out.write("<stream>")
            self.header_written = True

        event.write_to(self._out)