<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def warn(self, msg):
 """Add a warning message. :param msg: The warning message to add. :type msg: str """

        self.warnings.append(
            self.state.document.reporter.warning(msg, line=self.lineno)
        )