def set_spyder_breakpoints(self, force=False):
        """Set Spyder breakpoints into a debugging session"""
        if self._reading or force:
            breakpoints_dict = CONF.get('run', 'breakpoints', {})

            # We need to enclose pickled values in a list to be able to
            # send them to the kernel in Python 2
            serialiazed_breakpoints = [pickle.dumps(breakpoints_dict,
                                                    protocol=PICKLE_PROTOCOL)]
            breakpoints = to_text_string(serialiazed_breakpoints)

            cmd = u"!get_ipython().kernel._set_spyder_breakpoints({})"
            self.kernel_client.input(cmd.format(breakpoints))
Set Spyder breakpoints into a debugging session