<commit_before>import json, numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import sys

if len(sys.argv) != 2:
    print("USAGE: %s field")
    exit(1)
field = sys.argv[1]

pkl_file = open('data.pkl', 'r')
datas = {}
for line in pkl_file:
    timestamp = line.split('\t')[0]
    data = json.loads(line.split('\t')[1])
    datas[timestamp] = data

time_list = [one[0] for one in datas.items()]
data_list = np.array([one[1][field] for one in datas.items()])

N = len(time_list)


def format_date(x, pos=None):
    if not x % 1:
        thisind = np.clip(int(x), 0, N - 1)
        return time_list[thisind]
    else:
        return ''<commit_msg>fix usage<commit_after>import json, numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as ticker
import sys

if len(sys.argv) != 2:
    print("USAGE: %s field" % sys.argv[0])
    exit(1)
field = sys.argv[1]

pkl_file = open('data.pkl', 'r')
datas = {}
for line in pkl_file:
    timestamp = line.split('\t')[0]
    data = json.loads(line.split('\t')[1])
    datas[timestamp] = data

time_list = [one[0] for one in datas.items()]
data_list = np.array([one[1][field] for one in datas.items()])

N = len(time_list)


def format_date(x, pos=None):
    if not x % 1:
        thisind = np.clip(int(x), 0, N - 1)
        return time_list[thisind]
    else:
        return ''
{'fraction_non_alphanumeric': 0.15905743740795286, 'fraction_numerical': 0.015463917525773196, 'mean_word_length': 3.3142857142857145, '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': '5341018', 'n_tokens_mistral': 533, 'n_tokens_neox': 524, 'n_words': 138}