<commit_before>#!/usr/bin/python
# -*- coding: utf-8 -*-

import random
import subprocess

with open('run7/notBlocked.txt', 'r') as notBlocked, \
     open('run7/blocked.txt', 'r') as blocked, \
     open('notBlocked_randomlyBalanced.txt', 'a') as output:
  length = sum(1 for line in blocked)
  lines = notBlocked.readlines() # make sure you have the available memory
  print('Randomly sampling %i lines' % length)
  sample = random.sample(lines, length)

  for post in sample:
    output.write(post)
<commit_msg>/ change balance script's path to . instead of run7/.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-

import random
import subprocess

with open('notBlocked.txt', 'r') as notBlocked, \
     open('blocked.txt', 'r') as blocked, \
     open('notBlocked_randomlyBalanced.txt', 'a') as output:
  length = sum(1 for line in blocked)
  lines = notBlocked.readlines() # make sure you have the available memory
  print('Randomly sampling %i lines' % length)
  sample = random.sample(lines, length)

  for post in sample:
    output.write(post)

{'fraction_non_alphanumeric': 0.13705103969754254, 'fraction_numerical': 0.006616257088846881, 'mean_word_length': 3.8577981651376145, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2947396', 'n_tokens_mistral': 347, 'n_tokens_neox': 341, 'n_words': 104}