<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _unbuffered(self, proc, stream='stdout'):
 """ Unbuffered output handler. :type proc: subprocess.Popen :type stream: six.text_types :return: """

        if self.working_handler is not None:
            t = Thread(target=self._handle_process, args=(proc, stream))
            t.start()
        out = getattr(proc, stream)
        try:
            for line in iter(out.readline, ""):
                yield line.rstrip()
        finally:
            out.close()