<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _format_signature(self, signature, doc='', parameter='',
 parameter_doc='', color=_DEFAULT_TITLE_COLOR,
 is_python=False):

 """
 Create HTML template for signature.
 
 This template will include indent after the method name, a highlight
 color for the active parameter and highlights for special chars.
 """

        active_parameter_template = (
            '<span style=\'font-family:"{font_family}";'
            'font-size:{font_size}pt;'
            'color:{color}\'>'
            '<b>{parameter}</b>'
            '</span>'
        )
        chars_template = (
            '<span style="color:{0};'.format(self._CHAR_HIGHLIGHT_COLOR) +
            'font-weight:bold">{char}'
            '</span>'
        )

        def handle_sub(matchobj):
            """
            Handle substitution of active parameter template.

            This ensures the correct highlight of the active parameter.
            """
            match = matchobj.group(0)
            new = match.replace(parameter, active_parameter_template)
            return new

        # Remove duplicate spaces
        signature = ' '.join(signature.split())

        # Replace ay initial spaces
        signature = signature.replace('( ', '(')

        # Process signature template
        pattern = r'[\*|(|\s](' + parameter + r')[,|)|\s|=]'
        formatted_lines = []
        name = signature.split('(')[0]
        indent = ' ' * (len(name) + 1)
        rows = textwrap.wrap(signature, width=60, subsequent_indent=indent)
        for row in rows:
            # Add template to highlight the active parameter
            row = re.sub(pattern, handle_sub, row)
            row = row.replace(' ', '&nbsp;')
            row = row.replace('span&nbsp;', 'span ')
            if is_python:
                for char in ['(', ')', ',', '*', '**']:
                    new_char = chars_template.format(char=char)
                    row = row.replace(char, new_char)
            formatted_lines.append(row)
        title_template = '<br>'.join(formatted_lines)

        # Get current font properties
        font = self.font()
        font_size = font.pointSize()
        font_family = font.family()

        # Format title to display active parameter
        title = title_template.format(
            font_size=font_size,
            font_family=font_family,
            color=self._PARAMETER_HIGHLIGHT_COLOR,
            parameter=parameter,
        )

        # Process documentation
        # TODO: To be included in a separate PR
        # active = active_parameter_template.format(
        #     font_size=font_size,
        #     font_family=font_family,
        #     color=self._PARAMETER_HIGHLIGHT_COLOR,
        #     parameter=parameter,
        # )
        # if doc is not None and len(doc) > 0:
        #     text_doc = doc.split('\n')[0]
        # else:
        #     text_doc = ''

        # if parameter_doc is not None and len(parameter_doc) > 0:
        #     text_prefix = text_doc + '<br><hr><br>param: ' + active
        #     text = parameter_doc
        # else:
        #     text_prefix = ''
        #     text = ''

        # formatted_lines = []
        # rows = textwrap.wrap(text, width=60)
        # for row in rows:
        #     row = row.replace(' ', '&nbsp;')

        # if text_prefix:
        #     text = text_prefix + '<br><br>' + '<br>'.join(rows)
        # else:
        #     text = '<br>'.join(rows)
        # text += '<br>'

        # Format text
        tiptext = self._format_text(title, '', color)

        return tiptext, rows