<commit_before># -*- coding: utf-8 -*-
try:
    import pylibmc as memcache
except ImportError:
    import memcache

from .base import Cache


class MemCache(Cache):
    def __init__(self, servers, **kargs):
        self.cache = memcache.Client(servers, **kargs)

    def set(self, key, value, timeout=6 * 60 * 60):
        self.cache.set(key, value, time=timeout)

    def get(self, key, default=None):
        value = self.cache.get(key)
        return default if value is None else value

    def get_stats(self):
        return self.cache.get_stats()<commit_msg>update memcached time to 48 hours<commit_after># -*- coding: utf-8 -*-
try:
    import pylibmc as memcache
except ImportError:
    import memcache

from .base import Cache


class MemCache(Cache):
    def __init__(self, servers, **kargs):
        self.cache = memcache.Client(servers, **kargs)

    def set(self, key, value, timeout=48 * 60 * 60):
        self.cache.set(key, value, time=timeout)

    def get(self, key, default=None):
        value = self.cache.get(key)
        return default if value is None else value

    def get_stats(self):
        return self.cache.get_stats()
{'fraction_non_alphanumeric': 0.11642050390964379, 'fraction_numerical': 0.013032145960034752, 'mean_word_length': 2.972413793103448, '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': '4185038', 'n_tokens_mistral': 376, 'n_tokens_neox': 356, 'n_words': 110}