code: def send_spyder_msg(self, spyder_msg_type, content=None, data=None):
          
          import cloudpickle
  
          if content is None:
              content = {}
          content['spyder_msg_type'] = spyder_msg_type
          msg = self.session.send(
              self.iopub_socket,
              'spyder_msg',
              content=content,
              buffers=[cloudpickle.dumps(data, protocol=PICKLE_PROTOCOL)],
              parent=self._parent_header,
          )
          self.log.debug(msg)
docs: Publish custom messages to the Spyder frontend.
  
          Parameters
          ----------
  
          spyder_msg_type: str
              The spyder message type
          content: dict
              The (JSONable) content of the message
          data: any
              Any object that is serializable by cloudpickle (should be most
              things). Will arrive as cloudpickled bytes in `.buffers[0]`.