def gather_metrics(self, runs):
for run_dirs in runs.values():<EOL><INDENT>with open(JSON_METRICS_FILE, '<STR_LIT:w>') as ostr:<EOL><INDENT>ostr.write('<STR_LIT>')<EOL>for i in range(len(run_dirs)):<EOL><INDENT>with open(osp.join(run_dirs[i], YAML_REPORT_FILE)) as istr:<EOL><INDENT>data = yaml.safe_load(istr)<EOL>data.pop('<STR_LIT>', None)<EOL>data.pop('<STR_LIT>', None)<EOL>data['<STR_LIT:id>'] = run_dirs[i]<EOL>json.dump(data, ostr, indent=<NUM_LIT:2>)<EOL><DEDENT>if i != len(run_dirs) - <NUM_LIT:1>:<EOL><INDENT>ostr.write('<STR_LIT:U+002C>')<EOL><DEDENT>ostr.write('<STR_LIT:\n>')<EOL><DEDENT>ostr.write('<STR_LIT>')<EOL><DEDENT><DEDENT>
Write a JSON file with the result of every runs