<commit_before># clustercron/cache.py
# vim: ts=4 et sw=4 sts=4 ft=python fenc=UTF-8 ai
# -*- coding: utf-8 -*-

'''
clustercron.cache
-----------------
'''

from __future__ import unicode_literals
import fcntl
import io
import json
import logging
import logging.handlers
import sys
import time
import random

from datetime import datetime
from datetime import timedelta


if sys.version_info < (3,):
    text_type = unicode
    binary_type = str
else:
    text_type = str
    binary_type = bytes

logger = logging.getLogger(__name__)


class Cache(object):
    def __init__(self):
        self.master = False
        self.dct = {
            'master': self.master,
            'isodate': datetime(1970, 1, 1)
        }

    @staticmethod
    def json_serial(obj):
        '''
        JSON serializer for objects not serializable by default json code
        '''
        if isinstance(obj, datetime):<commit_msg>fixed?<commit_after># clustercron/cache.py
# vim: ts=4 et sw=4 sts=4 ft=python fenc=UTF-8 ai
# -*- coding: utf-8 -*-

'''
clustercron.cache
-----------------
'''

from __future__ import unicode_literals
import fcntl
import io
import json
import logging
import logging.handlers
import sys
import time
import random

from datetime import datetime
from datetime import timedelta


if sys.version_info < (3,):
    try:
        text_type = unicode
        binary_type = str
    except Exception:
        pass
else:
    text_type = str
    binary_type = bytes

logger = logging.getLogger(__name__)


class Cache(object):
    def __init__(self):
        self.master = False
        self.dct = {
            'master': self.master,
            'isodate': datetime(1970, 1, 1)
        }

    @staticmethod
    def json_serial(obj):
        '''
        JSON serializer for objects not serializable by default json code
        '''
        if isinstance(obj, datetime):
{'fraction_non_alphanumeric': 0.10968432316746923, 'fraction_numerical': 0.012841091492776886, 'mean_word_length': 2.5216572504708097, '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': '2055857', 'n_tokens_mistral': 582, 'n_tokens_neox': 557, 'n_words': 171}