def _summarize_result(result, summary):
if "<STR_LIT>" not in summary:<EOL><INDENT>summary["<STR_LIT>"] = [<NUM_LIT:0>, <NUM_LIT:0>]<EOL><DEDENT>if "<STR_LIT>" not in summary:<EOL><INDENT>summary["<STR_LIT>"] = [<NUM_LIT:0>, <NUM_LIT:0>]<EOL><DEDENT>if "<STR_LIT>" not in summary:<EOL><INDENT>summary["<STR_LIT>"] = <NUM_LIT:0><EOL><DEDENT>total_count = <NUM_LIT:0><EOL>failure_count = <NUM_LIT:0><EOL>summary_data = None<EOL>for elem in result:<EOL><INDENT>if elem["<STR_LIT>"] == "<STR_LIT>" and "<STR_LIT>" in elem:<EOL><INDENT>elem_data = elem["<STR_LIT>"]<EOL>summary_data = summary["<STR_LIT>"]<EOL>total_count += <NUM_LIT:1><EOL>for var in six.iterkeys(elem_data):<EOL><INDENT>if elem_data[var]["<STR_LIT>"] != <NUM_LIT:0>:<EOL><INDENT>failure_count += <NUM_LIT:1><EOL>break<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if summary_data is not None:<EOL><INDENT>summary_data = np.add(summary_data, [total_count-failure_count, total_count]).tolist()<EOL>summary["<STR_LIT>"] = summary_data<EOL><DEDENT>summary_data = None<EOL>total_count = <NUM_LIT:0><EOL>failure_count = <NUM_LIT:0><EOL>for elem in result:<EOL><INDENT>if elem["<STR_LIT>"] == "<STR_LIT>" and elem["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>elem_data = elem["<STR_LIT>"]<EOL>summary_data = summary["<STR_LIT>"]<EOL>total_count += <NUM_LIT:1><EOL>failed = False<EOL>for section_name, varlist in elem_data.items():<EOL><INDENT>for var, val in varlist.items():<EOL><INDENT>if not val[<NUM_LIT:0>]:<EOL><INDENT>failed = True<EOL><DEDENT><DEDENT><DEDENT>if failed:<EOL><INDENT>failure_count += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>if summary_data is not None:<EOL><INDENT>success_count = total_count - failure_count<EOL>summary_data = np.add(summary_data, [success_count, total_count]).tolist()<EOL>summary["<STR_LIT>"] = summary_data<EOL><DEDENT>for elem in result:<EOL><INDENT>if elem["<STR_LIT>"] == "<STR_LIT>" and elem["<STR_LIT>"] == "<STR_LIT>":<EOL><INDENT>summary["<STR_LIT>"] += <NUM_LIT:1><EOL>break<EOL><DEDENT><DEDENT>return summary<EOL>
Trim out some data to return for the index page