def format(file_metrics, build_metrics):
metrics = {'<STR_LIT>': file_metrics}<EOL>if build_metrics:<EOL><INDENT>metrics['<STR_LIT>'] = build_metrics<EOL><DEDENT>body = json.dumps(metrics, sort_keys=True, indent=<NUM_LIT:4>) + '<STR_LIT:\n>'<EOL>return body<EOL>
compute output in JSON format.