<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_bool(self, flag):
 """ Writes a boolean to the underlying output file as a 1-byte value. """

        if flag:
            self.write(b"\x01")
        else:
            self.write(b"\x00")