'Print a summary of failed tasks or checks.'

def _print_failure_details(self, failures):

    self._display.display(u'\nFailure    summary:\n')
    width = len(str(len(failures)))
    initial_indent_format = u'        {{:>{width}}}.    '.format(width=width)
    initial_indent_len = len(initial_indent_format.format(0))
    subsequent_indent = (u'    ' * initial_indent_len)
    subsequent_extra_indent = (u'    ' * (initial_indent_len + 10))
    for (i, failure) in enumerate(failures, 1):
        entries = _format_failure(failure)
        self._display.display(u'\n{}{}'.format(initial_indent_format.format(i), entries[0]))
        for entry in entries[1:]:
            entry = entry.replace(u'\n', (u'\n' + subsequent_extra_indent))
            indented = u'{}{}'.format(subsequent_indent, entry)
            self._display.display(indented)
    failed_checks = set()
    playbook_context = None
    for failure in failures:
        playbook_context = (playbook_context or failure['result']._result.get('playbook_context'))
        failed_checks.update((name for (name, result) in failure['result']._result.get('checks', {}).items() if result.get('failed')))
    if failed_checks:
        self._print_check_failure_summary(failed_checks, playbook_context)
