<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def exit(self, code=None, msg=None):
 """Playbook wrapper on TcEx exit method Playbooks do not support partial failures so we change the exit method from 3 to 1 and call it a partial success instead. Args: code (Optional [integer]):
 The exit code value for the app. """

        if code is None:
            code = self.tcex.exit_code
            if code == 3:
                self.tcex.log.info(u'Changing exit code from 3 to 0.')
                code = 0  # playbooks doesn't support partial failure
        elif code not in [0, 1]:
            code = 1
        self.tcex.exit(code, msg)