code: def UpdateNumberOfEventReports(
        self, number_of_consumed_reports, number_of_produced_reports):
      
      consumed_reports_delta = 0
      if number_of_consumed_reports is not None:
        if number_of_consumed_reports < self.number_of_consumed_reports:
          raise ValueError(
              'Number of consumed reports smaller than previous update.')
  
        consumed_reports_delta = (
            number_of_consumed_reports - self.number_of_consumed_reports)
  
        self.number_of_consumed_reports = number_of_consumed_reports
        self.number_of_consumed_reports_delta = consumed_reports_delta
  
      produced_reports_delta = 0
      if number_of_produced_reports is not None:
        if number_of_produced_reports < self.number_of_produced_reports:
          raise ValueError(
              'Number of produced reports smaller than previous update.')
  
        produced_reports_delta = (
            number_of_produced_reports - self.number_of_produced_reports)
  
        self.number_of_produced_reports = number_of_produced_reports
        self.number_of_produced_reports_delta = produced_reports_delta
  
      return consumed_reports_delta > 0 or produced_reports_delta > 0
docs: Updates the number of event reports.
  
      Args:
        number_of_consumed_reports (int): total number of event reports consumed
            by the process.
        number_of_produced_reports (int): total number of event reports produced
            by the process.
  
      Returns:
        bool: True if either number of event reports has increased.
  
      Raises:
        ValueError: if the consumed or produced number of event reports is
            smaller than the value of the previous update.