@staticmethod
    def format_errors(errors):
        """
        Args:

            errors: results of `AxeCoreAudit.get_errors()`.

        Returns: The errors as a formatted string.
        """

        def _get_message(node):
            """
            Get the message to display in the error output.
            """
            messages = set()

            try:
                messages.update([node['message']])
            except __HOLE__:
                pass

            for check_group in ['any', 'all', 'none']:
                try:
                    for check in node[check_group]:
                        messages.update([check.get('message')])
                except KeyError:
                    pass

            messages = messages.difference([''])
            return '; '.join(messages)

        lines = []
        for error_type in errors:
            lines.append("Rule ID: {}".format(error_type.get("id")))
            lines.append("Help URL: {}\n".format(error_type.get('helpUrl')))

            for node in error_type['nodes']:
                msg = "Message: {}".format(_get_message(node))
                html = "Html: {}".format(node.get('html').encode('utf-8'))
                target = "Target: {}".format(node.get('target'))
                fill_opts = {
                    'width': 100,
                    'initial_indent': '\t',
                    'subsequent_indent': '\t\t',
                }
                lines.append(fill(msg, **fill_opts))
                lines.append(fill(html, **fill_opts))
                lines.append(fill(target, **fill_opts))
                lines.append('\n')

        return '\n'.join(lines)
dataset/ETHPy150Open edx/bok-choy/bok_choy/a11y/axe_core_ruleset.py/AxeCoreAudit.format_errors