<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def isample(self, *args, **kwds):
 """ Samples in interactive mode. Main thread of control stays in this function. """

        self._exc_info = None
        out = kwds.pop('out', sys.stdout)
        kwds['progress_bar'] = False

        def samp_targ(*args, **kwds):
            try:
                self.sample(*args, **kwds)
            except:
                self._exc_info = sys.exc_info()

        self._sampling_thread = Thread(
            target=samp_targ,
            args=args,
            kwargs=kwds)
        self.status = 'running'
        self._sampling_thread.start()
        self.iprompt(out=out)