code: def expect_node(
      self, root=False, sequence=False, mapping=False, simple_key=False
  ):
      self.root_context = root
      self.sequence_context = sequence
      self.mapping_context = mapping
      self.simple_key_context = simple_key
      if isinstance(self.event, AliasEvent):
          self.expect_alias()
      elif isinstance(self.event, (ScalarEvent, CollectionStartEvent)):
          self.process_anchor("&")
          self.process_tag()
          if isinstance(self.event, ScalarEvent):
              self.expect_scalar()
          elif isinstance(self.event, SequenceStartEvent):
              if (
                  self.flow_level
                  or self.canonical
                  or self.event.flow_style
                  or self.check_empty_sequence()
              ):
                  self.expect_flow_sequence()
              else:
                  self.expect_block_sequence()
          elif isinstance(self.event, MappingStartEvent):
              if (
                  self.flow_level
                  or self.canonical
                  or self.event.flow_style
                  or self.check_empty_mapping()
              ):
                  self.expect_flow_mapping()
              else:
                  self.expect_block_mapping()
      else:
          raise EmitterError(
              "expected NodeEvent, but got %s" % self.event
          )
  
imports: from .error import YAMLError
  from .events import *
label_desc: Use image node_id 13 for calling the Emitter obj's underlying member method code with example usage: obj.expect_node(root, sequence, mapping, simple_key) without return types