<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_line_str(self, line_str):
 """ Set line_str. Line_str is only writeable if LogEvent was created from a string, not from a system.profile documents. """

        if not self.from_string:
            raise ValueError("can't set line_str for LogEvent created from "
                             "system.profile documents.")

        if line_str != self._line_str:
            self._line_str = line_str.rstrip()
            self._reset()