<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_action(self, value):
 """Setter for action attribute"""

        if value not in ("remove", "add"):
            log = "Sources field 'action' should be 'remove' or 'add'."
            raise MalFormattedSource(log)
        self._action = value