<commit_before>import uuid
from big_cheese import BigCheese
from collections import defaultdict
from .exceptions import GCounterException

class GCounter(BigCheese):
    def __init__(self):
        self.e = defaultdict(int)

    @classmethod
    def from_dict(cls, counter_dict):
        obj = cls()
        if 'e' in counter_dict:
            obj.e = counter_dict['e']
        return obj

    def increment(self, delta, node=None):
        if delta < 0:
            raise GCounterException('Attempted to decrement g-counter value.')
        if not node:
            node = BigCheese.node()
        self.e[node] += int(delta)

    def value(self):
        return sum(v for v in self.e.itervalues())

    def merge(self, other):
        if not isinstance(other, self.__class__):<commit_msg>Default delta to 1 and fix value method in GCounter.<commit_after>from big_cheese import BigCheese
from collections import defaultdict
from .exceptions import GCounterException

class GCounter(BigCheese):
    def __init__(self):
        self.e = defaultdict(int)

    @classmethod
    def from_dict(cls, counter_dict):
        obj = cls()
        if 'e' in counter_dict:
            obj.e = counter_dict['e']
        return obj

    def increment(self, delta=1, node=None):
        if delta < 0:
            raise GCounterException('Attempted to decrement g-counter value.')
        if not node:
            node = BigCheese.node()
        self.e[node] += int(delta)

    def value(self):
        return sum(self.e.itervalues())

    def merge(self, other):
        if not isinstance(other, self.__class__):
{'fraction_non_alphanumeric': 0.09523809523809523, 'fraction_numerical': 0.002506265664160401, 'mean_word_length': 2.5727069351230427, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6390869', 'n_tokens_mistral': 477, 'n_tokens_neox': 466, 'n_words': 140}