# Buggy code
def process_signatures(self, params):
    # self.hide_completion_widget()
    signature = params["params"]
    if signature is not None and "activeParameter" in signature:
        self.sig_signature_invoked.emit()
        line, _ = self.get_cursor_line_column()
        active_parameter_idx = signature["activeParameter"]
        signature = signature["signatures"]
        func_doc = signature["documentation"]
        func_signature = signature["label"]
        parameters = signature["parameters"]
        parameter = parameters[active_parameter_idx]

        font = self.font()
        size = font.pointSize()
        family = font.family()

        parameter_str = ""
        color_change_str = (
            "<span style='font-family: \"{0}\"; font-size: {1}pt; color: {2}'>"
        )
        if (
            parameter["documentation"] is not None
            and len(parameter["documentation"]) > 0
        ):
            parameter_fmt = "{0}<b>{1}</b></span>: {2}\n"
            parameter_str = parameter_fmt.format(
                color_change_str.format(family, size, "#daa520"),
                parameter["label"],
                parameter["documentation"],
            )

        title = func_signature.replace(
            parameter["label"],
            "{0}{1}</span>".format(
                color_change_str.format(family, size, "#daa520"), parameter["label"]
            ),
        )
        tooltip_text = "{0}{1}".format(parameter_str, func_doc)
        self.show_calltip(title, tooltip_text, color="#999999")


# Traceback (TypeError)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\console\widgets\internalshell.py", line 353, in keyPressEvent
self.postprocess_keyevent(event)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\console\widgets\shell.py", line 713, in postprocess_keyevent
ShellBaseWidget.postprocess_keyevent(self, event)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\console\widgets\shell.py", line 362, in postprocess_keyevent
self._key_tab()
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\console\widgets\shell.py", line 745, in _key_tab
self.show_code_completion(automatic=False)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\console\widgets\shell.py", line 893, in show_code_completion
automatic=automatic)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\base.py", line 1131, in show_completion_list
self.show_completion_widget(completions, automatic=automatic)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\base.py", line 1107, in show_completion_widget
self.completion_widget.show_list(textlist, automatic=automatic)
File "C:\Users\C. A. M. Gerlach\Documents\dev\SpyderDev\spyder\spyder\plugins\editor\widgets\base.py", line 112, in show_list
icon = icons_map.get(completion['kind'], 'no_match')
TypeError: tuple indices must be integers or slices, not str

# Fixed code
def process_signatures(self, params):
    signature = params["params"]
    if signature is not None and "activeParameter" in signature:
        self.sig_signature_invoked.emit()
        line, _ = self.get_cursor_line_column()
        active_parameter_idx = signature["activeParameter"]
        signature = signature["signatures"]
        func_doc = signature["documentation"]
        func_signature = signature["label"]
        parameters = signature["parameters"]
        parameter = parameters[active_parameter_idx]

        font = self.font()
        size = font.pointSize()
        family = font.family()

        parameter_str = ""
        color_change_str = (
            "<span style='font-family: \"{0}\"; font-size: {1}pt; color: {2}'>"
        )
        if (
            parameter["documentation"] is not None
            and len(parameter["documentation"]) > 0
        ):
            parameter_fmt = "{0}<b>{1}</b></span>: {2}\n"
            parameter_str = parameter_fmt.format(
                color_change_str.format(family, size, "#daa520"),
                parameter["label"],
                parameter["documentation"],
            )

        title = func_signature.replace(
            parameter["label"],
            "{0}{1}</span>".format(
                color_change_str.format(family, size, "#daa520"), parameter["label"]
            ),
        )
        tooltip_text = "{0}{1}".format(parameter_str, func_doc)
        self.show_calltip(title, tooltip_text, color="#999999")