def set_debug(self, new):
if type(new) is not bool:<EOL><INDENT>raise pyhsm.exception.YHSM_WrongInputType(<EOL>'<STR_LIT>', bool, type(new))<EOL><DEDENT>old = self.debug<EOL>self.debug = new<EOL>self.stick.set_debug(new)<EOL>return old<EOL>
Set debug mode.

@param new: new value
@type new: bool

@return: old value
@rtype: bool