code: def process_data(self):
          
  
          further_processing = False
  
          if self.state == self.WaitingForReportType and len(self.raw_data) > 0:
              self.current_type = self.raw_data[0]
  
              try:
                  self.current_header_size = self.calculate_header_size(self.current_type)
                  self.state = self.WaitingForReportHeader
                  further_processing = True
              except Exception as exc:
                  self.state = self.ErrorState
  
                  if self.error_callback:
                      self.error_callback(self.ErrorFindingReportType, str(exc), self.context)
                  else:
                      raise
  
          if self.state == self.WaitingForReportHeader and len(self.raw_data) >= self.current_header_size:
              try:
                  self.current_report_size = self.calculate_report_size(self.current_type,
                                                                        self.raw_data[:self.current_header_size])
                  self.state = self.WaitingForCompleteReport
                  further_processing = True
              except Exception as exc:
                  self.state = self.ErrorState
  
                  if self.error_callback:
                      self.error_callback(self.ErrorParsingReportHeader, str(exc), self.context)
                  else:
                      raise
  
          if self.state == self.WaitingForCompleteReport and len(self.raw_data) >= self.current_report_size:
              try:
                  report_data = self.raw_data[:self.current_report_size]
                  self.raw_data = self.raw_data[self.current_report_size:]
  
                  report = self.parse_report(self.current_type, report_data)
                  self._handle_report(report)
                  self.state = self.WaitingForReportType
                  further_processing = True
              except Exception as exc:
                  self.state = self.ErrorState
  
                  if self.error_callback:
                      self.error_callback(self.ErrorParsingCompleteReport, str(exc), self.context)
                  else:
                      raise
  
          return further_processing
docs: Attempt to extract a report from the current data stream contents
  
          Returns:
              bool: True if further processing is required and process_data should be
                  called again.