code: def UpdateNumberOfWarnings(
        self, number_of_consumed_warnings, number_of_produced_warnings):
      
      consumed_warnings_delta = 0
      if number_of_consumed_warnings is not None:
        if number_of_consumed_warnings < self.number_of_consumed_warnings:
          raise ValueError(
              'Number of consumed warnings smaller than previous update.')
  
        consumed_warnings_delta = (
            number_of_consumed_warnings - self.number_of_consumed_warnings)
  
        self.number_of_consumed_warnings = number_of_consumed_warnings
        self.number_of_consumed_warnings_delta = consumed_warnings_delta
  
      produced_warnings_delta = 0
      if number_of_produced_warnings is not None:
        if number_of_produced_warnings < self.number_of_produced_warnings:
          raise ValueError(
              'Number of produced warnings smaller than previous update.')
  
        produced_warnings_delta = (
            number_of_produced_warnings - self.number_of_produced_warnings)
  
        self.number_of_produced_warnings = number_of_produced_warnings
        self.number_of_produced_warnings_delta = produced_warnings_delta
  
      return consumed_warnings_delta > 0 or produced_warnings_delta > 0
docs: Updates the number of warnings.
  
      Args:
        number_of_consumed_warnings (int): total number of warnings consumed by
            the process.
        number_of_produced_warnings (int): total number of warnings produced by
            the process.
  
      Returns:
        bool: True if either number of warnings has increased.
  
      Raises:
        ValueError: if the consumed or produced number of warnings is smaller
            than the value of the previous update.