def change_autocommit_mode(self, switch):
parsed_switch = switch.strip().lower()<EOL>if not parsed_switch in ['<STR_LIT:true>', '<STR_LIT:false>']:<EOL><INDENT>self.send_response(<EOL>self.iopub_socket, '<STR_LIT>', {<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:text>': '<STR_LIT>'<EOL>}<EOL>)<EOL><DEDENT>switch_bool = (parsed_switch == '<STR_LIT:true>')<EOL>committed = self.switch_autocommit(switch_bool)<EOL>message = (<EOL>'<STR_LIT>' if committed else '<STR_LIT>' +<EOL>'<STR_LIT>' +<EOL>str(self._autocommit)<EOL>)<EOL>self.send_response(<EOL>self.iopub_socket, '<STR_LIT>', {<EOL>'<STR_LIT:name>': '<STR_LIT>',<EOL>'<STR_LIT:text>': message,<EOL>}<EOL>)<EOL>
Strip and make a string case insensitive and ensure it is either 'true' or 'false'.

If neither, prompt user for either value.
When 'true', return True, and when 'false' return False.