<commit_before>#!/usr/bin/python

import os
import sys
import json

def main():
	f = open(sys.argv[1], 'rb')
	known = {}
	for o in json.loads(f.read()):
		known[o['test']] = o['reason']
	f.close()

	skipstrings = [
		'passed in strict mode',
		'passed in non-strict mode',
		'failed in strict mode as expected',
		'failed in non-strict mode as expected'
	]

	in_failed_tests = False

	for line in sys.stdin:
		if len(line) > 1 and line[-1] == '\n':
			line = line[:-1]

		# Skip success cases

		skip = False
		for sk in skipstrings:
			if sk in line:
				skip = True
		if skip:
			continue

		# Augment error list with "known bugs"

		if line == 'Failed tests':
			in_failed_tests = True
			print(line)
			continue

		if in_failed_tests and line == '':
			in_failed_tests = False
			print(line)
			continue

		if in_failed_tests:
			# "  intl402/ch12/12.2/12.2.3_c in non-strict mode"
			tmp = line.strip().split(' ')
			test = tmp[0]
			if known.has_key(test):
				print(line + '   // KNOWN: ' + known[test])
			else:
				print(line)
			continue

		# Otherwise print normally<commit_msg>print 'diagnosed' test262 tests too<commit_after>#!/usr/bin/python

import os
import sys
import json

def main():
	f = open(sys.argv[1], 'rb')
	known = {}
	diagnosed = {}
	for o in json.loads(f.read()):
		if o.has_key('test') and o.has_key('known'):
			known[o['test']] = o['known']
		if o.has_key('test') and o.has_key('diagnosed'):
			diagnosed[o['test']] = o['diagnosed']
	f.close()

	skipstrings = [
		'passed in strict mode',
		'passed in non-strict mode',
		'failed in strict mode as expected',
		'failed in non-strict mode as expected'
	]

	in_failed_tests = False

	for line in sys.stdin:
		if len(line) > 1 and line[-1] == '\n':
			line = line[:-1]

		# Skip success cases

		skip = False
		for sk in skipstrings:
			if sk in line:
				skip = True
		if skip:
			continue

		# Augment error list with "known bugs"

		if line == 'Failed tests':
			in_failed_tests = True
			print(line)
			continue

		if in_failed_tests and line == '':
			in_failed_tests = False
			print(line)
			continue

		if in_failed_tests:
			# "  intl402/ch12/12.2/12.2.3_c in non-strict mode"
			tmp = line.strip().split(' ')
			test = tmp[0]
			if known.has_key(test):
				print(line + '   // KNOWN: ' + known[test])
			elif diagnosed.has_key(test):
				print(line + '   // diagnosed: ' + diagnosed[test])
			else:
				print(line)
			continue

		# Otherwise print normally
{'fraction_non_alphanumeric': 0.14198036006546644, 'fraction_numerical': 0.015139116202945991, 'mean_word_length': 2.969155844155844, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2433084', 'n_tokens_mistral': 1049, 'n_tokens_neox': 889, 'n_words': 251}