<commit_before>"""
Purpose: to compute the chi_heap recursion equation of Harte 2007 
and to export the results as a .csv file
"""

import mete
import numpy as np
import csv
import sys

if len(sys.argv) > 1:
    A = int(sys.argv[1]) 
    A0 = int(sys.argv[2])
    shape = sys.argv[3]
    abu_filename = sys.argv[4]
    out_filename = sys.argv[5]
    if len(sys.argv) == 7:
        unit_distance = sys.argv[6]
    else:
        unit_distance = 1
else:
    print 'Error: Specify A, A0, shape, and abu file at the command line'

if abu_filename  != 'None':
    datafile = open(abu_filename, 'r')
    datareader = csv.reader(datafile)
    data = []
    for row in datareader:
        data.append(row)
    abu = [int(x) for x in data[0]]<commit_msg>specified unit_distance as an integer<commit_after>"""
Purpose: to compute the chi_heap recursion equation of Harte 2007 
and to export the results as a .csv file
"""

import mete
import numpy as np
import csv
import sys

if len(sys.argv) > 1:
    A = int(sys.argv[1]) 
    A0 = int(sys.argv[2])
    shape = sys.argv[3]
    abu_filename = sys.argv[4]
    out_filename = sys.argv[5]
    if len(sys.argv) == 7:
        unit_distance = int(sys.argv[6])
    else:
        unit_distance = 1
else:
    print 'Error: Specify A, A0, shape, and abu file at the command line'

if abu_filename  != 'None':
    datafile = open(abu_filename, 'r')
    datareader = csv.reader(datafile)
    data = []
    for row in datareader:
        data.append(row)
    abu = [int(x) for x in data[0]]
{'fraction_non_alphanumeric': 0.11733684904416612, 'fraction_numerical': 0.02109426499670402, 'mean_word_length': 2.8823529411764706, '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': '85410', 'n_tokens_mistral': 570, 'n_tokens_neox': 544, 'n_words': 173}