code: def _process(self, data_buffer):
          
          packet = json.loads(data_buffer)
  
          if packet['cmd'] == 'out':
              # Call os.write manually. In Python2.6, sys.stdout.write doesn't use UTF-8.
              original_mode = DWORD(0)
              windll.kernel32.GetConsoleMode(self._hconsole, byref(original_mode))
  
              windll.kernel32.SetConsoleMode(self._hconsole, DWORD(
                  ENABLE_PROCESSED_INPUT | ENABLE_VIRTUAL_TERMINAL_PROCESSING))
  
              try:
                  os.write(sys.stdout.fileno(), packet['data'].encode('utf-8'))
              finally:
                  windll.kernel32.SetConsoleMode(self._hconsole, original_mode)
  
          elif packet['cmd'] == 'suspend':
              # Suspend client process to background.
              pass
  
          elif packet['cmd'] == 'mode':
              pass
docs: Handle incoming packet from server.