from typing import List
from typing import Dict
from typing import Any


def build_error_report(results: List[Dict[str, Any]]) -> str:
    """Build an user-friendly error report for a failed job.

    Args:
        results: result section of the job response.

    Returns:
        the error report.
    """
    error_list = []
    for index, result in enumerate(results):
        if not result['success']:
            error_list.append('Experiment {}: {}'.format(index, result['status']))

    error_report = 'The following experiments failed:\n{}'.format('\n'.join(error_list))
    return error_report