<commit_before>import os
import numpy


def hash_key(i, key):
    return hash(str(i) + str(key))

algorithm_basic = 0
algorithm_conservative = 1
algorithm_logcounter = 2

class CountMinSketch(object):
    def __init__(self, width=16, depth=8, algorithm = None):
        self.logshift = 0
        array_type = numpy.uint32
        self.algorithm = algorithm_basic<commit_msg>Replace pyhton hash() with a stable function (hash() is re-seeded for each run of python)<commit_after>import os
import numpy
import xxhash


def hash_key(i, key):
    return xxhash.xxh64(str(key), seed=i).intdigest()

algorithm_basic = 0
algorithm_conservative = 1
algorithm_logcounter = 2

class CountMinSketch(object):
    def __init__(self, width=16, depth=8, algorithm = None):
        self.logshift = 0
        array_type = numpy.uint32
        self.algorithm = algorithm_basic
{'fraction_non_alphanumeric': 0.09334889148191365, 'fraction_numerical': 0.023337222870478413, 'mean_word_length': 4.017543859649122, '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': '7539070', 'n_tokens_mistral': 287, 'n_tokens_neox': 264, 'n_words': 75}