<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_double(self, value, little_endian=True):
 """ Pack the value as a double and write 8 bytes to the stream. Args: value (number):
 the value to write to the stream. little_endian (bool):
 specify the endianness. (Default) Little endian. Returns: int: the number of bytes written. """

        if little_endian:
            endian = "<"
        else:
            endian = ">"
        return self.pack('%sd' % endian, value)