code: def write(self, data):
          
  
          if not data:
              return None
  
          self.buffer += data
          self.do_write()
  
          return len(data)
docs: Write `data` to the Stream. Not all data may be written right away.
          Use select to find when the stream is writeable, and call do_write()
          to flush the internal buffer.