code: def marshal(self) -> str:
      with io.StringIO() as buffer:
          if self.event:
              if "\n" in self.event:
                  raise BentoMLException(
                      "SSE event name should not contain new line"
                  )
              buffer.write(f"event: {self.event}\n")
          if self.id is not None:
              buffer.write(f"id: {self.id}\n")
          if self.retry is not None:
              buffer.write(f"retry: {self.retry}\n")
          for line in self.data.split("\n"):
              buffer.write(f"data: {line}\n")
          buffer.write("\n")
          return buffer.getvalue()
  
imports: from __future__ import annotations
  import io
  import typing
  import attr
  from bentoml.exceptions import BentoMLException
label_desc: Use image node_id 1 for calling the SSE obj's underlying member method code with example usage: obj.marshal() and returns: buffer