# Buggy code
def call_kernel(self, interrupt=False, blocking=False, callback=None, timeout=None):
    """
    Send message to Spyder kernel connected to this console.

    Parameters
    ----------
    interrupt: bool
        Interrupt the kernel while running or in Pdb to perform
        the call.
    blocking: bool
        Make a blocking call, i.e. wait on this side until the
        kernel sends its response.
    callback: callable
        Callable to process the response sent from the kernel
        on the Spyder side.
    timeout: int or None
        Maximum time (in seconds) before giving up when making a
        blocking call to the kernel. If None, a default timeout
        (defined in commbase.py, present in spyder-kernels) is
        used.
    """
    return self.spyder_kernel_comm.remote_call(
        interrupt=interrupt, blocking=blocking, callback=callback, timeout=timeout
    )


# Traceback (KeyError)
File "C:\Anaconda\lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionsdelegate.py", line 372, in setModelData
self.get_value(index),
File "C:\Anaconda\lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionseditor.py", line 1373, in get_value
return self.parent().get_value(name)
File "C:\Anaconda\lib\site-packages\spyder\plugins\variableexplorer\widgets\collectionseditor.py", line 1431, in get_value
value = self.shellwidget.get_value(name)
File "C:\Anaconda\lib\site-packages\spyder\plugins\ipythonconsole\widgets\namespacebrowser.py", line 97, in get_value
return self.call_kernel(
File "C:\Anaconda\lib\site-packages\spyder_kernels\comms\commbase.py", line 549, in __call__
return self._comms_wrapper._get_call_return_value(
File "C:\Anaconda\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 151, in _get_call_return_value
return super(KernelComm, self)._get_call_return_value(
File "C:\Anaconda\lib\contextlib.py", line 120, in __exit__
next(self.gen)
File "C:\Anaconda\lib\site-packages\spyder\plugins\ipythonconsole\comms\kernelcomm.py", line 99, in comm_channel_manager
self._comms[comm_id]['comm']._send_channel = (
KeyError: '0fb3ca1fe6a811eab88400a0c6000013'

# Fixed code
def call_kernel(
    self,
    interrupt=False,
    blocking=False,
    callback=None,
    timeout=None,
    display_error=False,
):
    """
    Send message to Spyder kernel connected to this console.

    Parameters
    ----------
    interrupt: bool
        Interrupt the kernel while running or in Pdb to perform
        the call.
    blocking: bool
        Make a blocking call, i.e. wait on this side until the
        kernel sends its response.
    callback: callable
        Callable to process the response sent from the kernel
        on the Spyder side.
    timeout: int or None
        Maximum time (in seconds) before giving up when making a
        blocking call to the kernel. If None, a default timeout
        (defined in commbase.py, present in spyder-kernels) is
        used.
    display_error: bool
        If an error occurs, should it be printed to the console.
    """
    return self.spyder_kernel_comm.remote_call(
        interrupt=interrupt,
        blocking=blocking,
        callback=callback,
        timeout=timeout,
        display_error=display_error,
    )