<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def AddWarning(self, warning):
 """Adds a warnings. Args: warning (ExtractionWarning):
 warning. Raises: IOError: when the storage writer is closed. OSError: when the storage writer is closed. """

    self._RaiseIfNotWritable()

    warning = self._PrepareAttributeContainer(warning)

    self._warnings.append(warning)
    self.number_of_warnings += 1