code: def expect_stream_start(self):
      if isinstance(self.event, StreamStartEvent):
          if self.event.encoding and not hasattr(
              self.stream, "encoding"
          ):
              self.encoding = self.event.encoding
          self.write_stream_start()
          self.state = self.expect_first_document_start
      else:
          raise EmitterError(
              "expected StreamStartEvent, but got %s" % self.event
          )
  
imports: from .error import YAMLError
  from .events import *
label_desc: Use image node_id 7 for calling the Emitter obj's underlying member method code with example usage: obj.expect_stream_start() without return types