code: def ParseMessage(self, parser_mediator, key, date_time, tokens):
      
      if key != 'task_run':
        raise ValueError('Unknown grammar key: {0:s}'.format(key))
  
      event_data = CronTaskRunEventData()
      event_data.body = tokens.get('body', None)
      event_data.command = tokens.get('command', None)
      event_data.hostname = tokens.get('hostname', None)
      # TODO: pass line number to offset or remove.
      event_data.offset = 0
      event_data.pid = tokens.get('pid', None)
      event_data.reporter = tokens.get('reporter', None)
      event_data.severity = tokens.get('severity', None)
      event_data.username = tokens.get('username', None)
  
      event = time_events.DateTimeValuesEvent(
          date_time, definitions.TIME_DESCRIPTION_WRITTEN)
      parser_mediator.ProduceEventWithEventData(event, event_data)
docs: Parses a syslog body that matched one of defined grammars.
  
      Args:
        parser_mediator (ParserMediator): mediates interactions between parsers
            and other components, such as storage and dfvfs.
        key (str): name of the matching grammar.
        date_time (dfdatetime.DateTimeValues): date and time values.
        tokens (dict[str, str]): tokens derived from a syslog message based on
            the defined grammar.
  
      Raises:
        ValueError: If an unknown key is provided.