def _process(self, data_buffer):
packet = json.loads(data_buffer.decode('<STR_LIT:utf-8>'))<EOL>if packet['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>os.write(sys.stdout.fileno(), packet['<STR_LIT:data>'].encode('<STR_LIT:utf-8>'))<EOL><DEDENT>elif packet['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>if hasattr(signal, '<STR_LIT>'):<EOL><INDENT>os.kill(os.getpid(), signal.SIGTSTP)<EOL><DEDENT><DEDENT>elif packet['<STR_LIT>'] == '<STR_LIT>':<EOL><INDENT>action = packet['<STR_LIT:data>']<EOL>if action == '<STR_LIT>':<EOL><INDENT>cm = raw_mode(sys.stdin.fileno())<EOL>cm.__enter__()<EOL>self._mode_context_managers.append(cm)<EOL><DEDENT>elif action == '<STR_LIT>':<EOL><INDENT>cm = cooked_mode(sys.stdin.fileno())<EOL>cm.__enter__()<EOL>self._mode_context_managers.append(cm)<EOL><DEDENT>elif action == '<STR_LIT>' and self._mode_context_managers:<EOL><INDENT>cm = self._mode_context_managers.pop()<EOL>cm.__exit__()<EOL><DEDENT><DEDENT>
Handle incoming packet from server.