def METHOD_NAME(self):
    if self.closed is None:
        self.emit(StreamStartEvent(encoding=self.use_encoding))
        self.closed = False
    elif self.closed:
        raise SerializerError("serializer is closed")
    else:
        raise SerializerError("serializer is already opened")