code: def get_xml_event_start(event_buffer):
      
  
      result_pattern = "<result offset='"
      time_key_pattern = "<field k='_time'>"
      time_start_pattern = "<value><text>"
      time_end_pattern = "<"
      event_end_pattern = "</result>"
  
      event_start = event_buffer.find(result_pattern)
      event_end = event_buffer.find(event_end_pattern, event_start) + \
                  len(event_end_pattern)
      if event_end < 0:
          return (-1, -1, "")
      time_key_start = event_buffer.find(time_key_pattern, event_start)
      time_start = event_buffer.find(time_start_pattern, time_key_start) + \
                   len(time_start_pattern)
      time_end = event_buffer.find(time_end_pattern, time_start + 1)
      last_time = event_buffer[time_start:time_end]
  
      # wallk through events until time changes
      event_start = event_end
      while event_end > 0:
          event_start = event_buffer.find(result_pattern, event_start + 1)
          event_end = event_buffer.find(event_end_pattern, event_start) + \
                      len(event_end_pattern)
          if event_end < 0:
              return (-1, -1, "")
          time_key_start = event_buffer.find(time_key_pattern, event_start)
          time_start = event_buffer.find(time_start_pattern, time_key_start)
          time_end = event_buffer.find(time_end_pattern, time_start)
          this_time = event_buffer[time_start:time_end]
          if this_time != last_time:
              return (event_start, event_end, last_time)
          event_start = event_end
  
      return (-1, -1, "")
docs: get the event start of an event that is different (in time)from the
          adjoining event, in XML format