<commit_before>"""Thread-safe in-memory cache backend."""

import time

from six.moves import cPickle as pickle

from .base import BaseCache, DEFAULT_TIMEOUT
from dache.utils.synch import RWLock


# Global in-memory store of cache data. Keyed by name, to provide
# multiple named local memory caches.
_caches = {}
_expire_info = {}
_locks = {}


class LocMemCache(BaseCache):

    def __init__(self, url, **options):
        super(LocMemCache, self).__init__(**options)

        # locmem://abcd:1234/efg -> abcd:1234/eft
        name = url.geturl()[len(url.scheme) + 3:]

        self._cache = _caches.setdefault(name, {})
        self._expire_info = _expire_info.setdefault(name, {})<commit_msg>Fix a typo in comment<commit_after>"""Thread-safe in-memory cache backend."""

import time

from six.moves import cPickle as pickle

from .base import BaseCache, DEFAULT_TIMEOUT
from dache.utils.synch import RWLock


# Global in-memory store of cache data. Keyed by name, to provide
# multiple named local memory caches.
_caches = {}
_expire_info = {}
_locks = {}


class LocMemCache(BaseCache):

    def __init__(self, url, **options):
        super(LocMemCache, self).__init__(**options)

        # locmem://abcd:1234/efg -> abcd:1234/efg
        name = url.geturl()[len(url.scheme) + 3:]

        self._cache = _caches.setdefault(name, {})
        self._expire_info = _expire_info.setdefault(name, {})
{'fraction_non_alphanumeric': 0.12428571428571429, 'fraction_numerical': 0.012857142857142857, 'mean_word_length': 3.654485049833887, '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': '3793937', 'n_tokens_mistral': 481, 'n_tokens_neox': 456, 'n_words': 118}