<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def write(self, __text: str) -> None: """Write text to the debug stream. Args: __text: Text to write """

        if __text == os.linesep:
            self.handle.write(__text)
        else:
            frame = inspect.currentframe()
            if frame is None:
                filename = 'unknown'
                lineno = 0
            else:
                outer = frame.f_back
                filename = outer.f_code.co_filename.split(os.sep)[-1]
                lineno = outer.f_lineno
            self.handle.write('[{:>15s}:{:03d}] {}'.format(filename[-15:],
                                                           lineno, __text))