'Determine if the kernel is from Spyder.'

def is_spyder_kernel(self):

    code = u"getattr(get_ipython().kernel,    'set_value',    False)"
    if self._reading:
        return
    else:
        self.silent_exec_method(code)
