<commit_before>#!/usr/bin/env python

import sys

(_, old, new) = sys.argv
assert(len(old) == len(new))

data = sys.stdin.read()
sys.stdout.write(data.replace(old, new))<commit_msg>test: make `binary_sub` python 2, 3 compatible<commit_after>#!/usr/bin/env python

import sys

(_, old, new) = sys.argv
assert(len(old) == len(new))

if sys.version_info[0] < 3:
    data = sys.stdin.read()
    sys.stdout.write(data.replace(old, new))
else:
    data = sys.stdin.buffer.read()
    sys.stdout.buffer.write(data.replace(old.encode('utf-8'), new.encode('utf-8')))
{'fraction_non_alphanumeric': 0.19244604316546762, 'fraction_numerical': 0.01079136690647482, 'mean_word_length': 4.514851485148514, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, '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': '4878414', 'n_tokens_mistral': 220, 'n_tokens_neox': 214, 'n_words': 39}