<commit_before>SENTINEL = object()


class TreeCache(object):
    def __init__(self):
        self.root = {}

    def __setitem__(self, key, value):
        return self.set(key, value)

    def set(self, key, value):
        node = self.root
        for k in key[:-1]:
            node = node.setdefault(k, {})
        node[key[-1]] = value

    def get(self, key, default=None):
        node = self.root
        for k in key[:-1]:
            node = node.get(k, None)
            if node is None:
                return default
        return node.get(key[-1], default)

    def clear(self):
        self.root = {}

    def pop(self, key, default=None):
        nodes = []

        node = self.root<commit_msg>Docs for treecache<commit_after>SENTINEL = object()


class TreeCache(object):
    """
    Tree-based backing store for LruCache. Allows subtrees of data to be deleted
    efficiently.
    Keys must be tuples.
    """
    def __init__(self):
        self.root = {}

    def __setitem__(self, key, value):
        return self.set(key, value)

    def set(self, key, value):
        node = self.root
        for k in key[:-1]:
            node = node.setdefault(k, {})
        node[key[-1]] = value

    def get(self, key, default=None):
        node = self.root
        for k in key[:-1]:
            node = node.get(k, None)
            if node is None:
                return default
        return node.get(key[-1], default)

    def clear(self):
        self.root = {}

    def pop(self, key, default=None):
        nodes = []

        node = self.root
{'fraction_non_alphanumeric': 0.12643678160919541, 'fraction_numerical': 0.005108556832694764, 'mean_word_length': 1.7882562277580072, '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': '5915791', 'n_tokens_mistral': 496, 'n_tokens_neox': 480, 'n_words': 138}