def reset(self, clear=False):
if self._executing:<EOL><INDENT>self._executing = False<EOL>self._request_info['<STR_LIT>'] = {}<EOL><DEDENT>self._reading = False<EOL>self._highlighter.highlighting_on = False<EOL>if self.clear_on_kernel_restart or clear:<EOL><INDENT>self._control.clear()<EOL>self._append_plain_text(self.banner)<EOL><DEDENT>else:<EOL><INDENT>self._append_plain_text("<STR_LIT>")<EOL>self._append_html("<STR_LIT>")<EOL><DEDENT>self._append_before_prompt_pos = self._get_cursor().position()<EOL>self._show_interpreter_prompt()<EOL>
Resets the widget to its initial state if ``clear`` parameter or
        ``clear_on_kernel_restart`` configuration setting is True, otherwise
        prints a visual indication of the fact that the kernel restarted, but
        does not clear the traces from previous usage of the kernel before it
        was restarted.  With ``clear=True``, it is similar to ``%clear``, but
        also re-writes the banner and aborts execution if necessary.