code: def set_action(self, value):
          
          if value not in ("remove", "add"):
              log = "Sources field 'action' should be 'remove' or 'add'."
              raise MalFormattedSource(log)
          self._action = value
docs: Setter for action attribute