code: def ParseRecord(self, parser_mediator, key, structure):
      
      if key not in ('header', 'logline'):
        raise errors.ParseError(
            'Unable to parse record, unknown structure: {0:s}'.format(key))
  
      if key == 'logline':
        self._ParseLine(parser_mediator, structure)
  
      elif key == 'header':
        self._ParseHeader(parser_mediator, structure)
docs: Parse each record structure and return an EventObject if applicable.
  
      Args:
        parser_mediator (ParserMediator): mediates interactions between parsers
            and other components, such as storage and dfvfs.
        key (str): identifier of the structure of tokens.
        structure (pyparsing.ParseResults): structure of tokens derived from
            a line of a text file.
  
      Raises:
        ParseError: when the structure type is unknown.