Handle internal spyder messages

def _handle_spyder_msg(self, msg):
        """
        Handle internal spyder messages
        """
        spyder_msg_type = msg['content'].get('spyder_msg_type')
        if spyder_msg_type == 'data':
            # Deserialize data
            try:
                if PY2:
                    value = cloudpickle.loads(msg['buffers'][0])
                else:
                    value = cloudpickle.loads(bytes(msg['buffers'][0]))
            except Exception as msg:
                self._kernel_value = None
                self._kernel_reply = repr(msg)
            else:
                self._kernel_value = value
            self.sig_got_reply.emit()
            return
        elif spyder_msg_type == 'pdb_state':
            pdb_state = msg['content']['pdb_state']
            if pdb_state is not None and isinstance(pdb_state, dict):
                self.refresh_from_pdb(pdb_state)
        elif spyder_msg_type == 'pdb_continue':
            # Run Pdb continue to get to the first breakpoint
            # Fixes 2034
            self.write_to_stdin('continue')
        elif spyder_msg_type == 'set_breakpoints':
            self.set_spyder_breakpoints(force=True)
        else:
            logger.debug("No such spyder message type: %s" % spyder_msg_type)