def merge_and_round_reports(report_list):
    """Merges together several report structures from parse_report_file (and rounds all values)"""
    if len(report_list) == 1:
        final_report = report_list[0]
    else:
        final_report = {'language': 'python', 'fileReports': []}
        total_lines = 0
        for report in report_list:
            final_report['fileReports'] += report['fileReports']
            total_lines += report['codeLines']
        average_sum = 0
        for file_entry in final_report['fileReports']:
            average_sum += file_entry['total'] * file_entry['codeLines']
        final_report['total'] = average_sum / total_lines
        final_report['codeLines'] = total_lines
    for file_entry in final_report['fileReports']:
        file_entry['total'] = int(file_entry['total'])
    final_report['total'] = int(final_report['total'])
    return final_report
