def translate_summary(data):
headers = sorted(data.get("<STR_LIT>", []))<EOL>summary = '<STR_LIT>'.replace('<STR_LIT>', data.get("<STR_LIT>", "<STR_LIT>"))<EOL>summary += '<STR_LIT>'<EOL>n_cols = len(headers)<EOL>col_str = "<STR_LIT:l>" + "<STR_LIT:c>" * n_cols<EOL>summary += '<STR_LIT>'.replace("<STR_LIT>", col_str)<EOL>spacer = '<STR_LIT>' * n_cols + r'<STR_LIT>'<EOL>for header in headers:<EOL><INDENT>summary += '<STR_LIT>'.replace('<STR_LIT>', header).replace('<STR_LIT:%>', '<STR_LIT>')<EOL><DEDENT>summary += '<STR_LIT>'<EOL>names = sorted(six.iterkeys(data.get("<STR_LIT>", [])))<EOL>for name in names:<EOL><INDENT>summary += '<STR_LIT>'.format(name, spacer)<EOL>cases = data.get("<STR_LIT>", []).get(name, {})<EOL>for case, c_data in cases.items():<EOL><INDENT>summary += '<STR_LIT>'.replace('<STR_LIT>', str(case))<EOL>for header in headers:<EOL><INDENT>h_data = c_data.get(header, "<STR_LIT>")<EOL>if list is type(h_data) and len(h_data) == <NUM_LIT:2>:<EOL><INDENT>summary += ('<STR_LIT>'<EOL>.replace('<STR_LIT>', str(h_data[<NUM_LIT:0>]))<EOL>.replace('<STR_LIT>', str(h_data[<NUM_LIT:1>]))<EOL>.replace('<STR_LIT:%>', '<STR_LIT>'))<EOL><DEDENT>else:<EOL><INDENT>summary += '<STR_LIT>'.replace('<STR_LIT>', str(h_data)).replace('<STR_LIT:%>', '<STR_LIT>')<EOL><DEDENT><DEDENT>summary = summary[:-<NUM_LIT:1>] + r'<STR_LIT>'<EOL><DEDENT><DEDENT>summary += '<STR_LIT>'<EOL>return summary<EOL>
Translates data where data["Type"]=="Summary