<commit_before>import abc
import os
import binascii

from cif.constants import TOKEN_LENGTH


class Store(object):
    __metaclass__ = abc.ABCMeta

    name = 'base'

    @abc.abstractmethod
    def __init__(self):
        raise NotImplementedError

    @abc.abstractmethod
    def ping(self, token):
        return True

    def _token_generate(self):
        return binascii.b2a_hex(os.urandom(TOKEN_LENGTH))

    @abc.abstractmethod
    def tokens_admin_exists(self):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_create(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_delete(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_search(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def token_admin(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_read(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_write(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_edit(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def token_last_activity_at(self, token, timestamp=None):
        raise NotImplementedError

    @abc.abstractmethod
    def indicators_search(self, token, data):
        raise NotImplementedError

    @abc.abstractmethod
    def indicators_create(self, token, data):
        raise NotImplementedError

    @abc.abstractclassmethod
    def indicators_upsert(self, token, data):
        raise NotImplementedError
<commit_msg>bugfix<commit_after>import abc
import os
import binascii

from cif.constants import TOKEN_LENGTH


class Store(object):
    __metaclass__ = abc.ABCMeta

    name = 'base'

    @abc.abstractmethod
    def __init__(self):
        raise NotImplementedError

    @abc.abstractmethod
    def ping(self, token):
        return True

    def _token_generate(self):
        return binascii.b2a_hex(os.urandom(TOKEN_LENGTH))

    @abc.abstractmethod
    def tokens_admin_exists(self):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_create(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_delete(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def tokens_search(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def token_admin(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_read(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_write(self, token):
        raise NotImplementedError

    @abc.abstractmethod
    def token_edit(self, data):
        raise NotImplementedError

    @abc.abstractmethod
    def token_last_activity_at(self, token, timestamp=None):
        raise NotImplementedError

    @abc.abstractmethod
    def indicators_search(self, token, data):
        raise NotImplementedError

    @abc.abstractmethod
    def indicators_create(self, token, data):
        raise NotImplementedError

    @abc.abstractmethod
    def indicators_upsert(self, token, data):
        raise NotImplementedError

{'fraction_non_alphanumeric': 0.06741573033707865, 'fraction_numerical': 0.0006242197253433209, 'mean_word_length': 3.1142490372272142, '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': '2053368', 'n_tokens_mistral': 941, 'n_tokens_neox': 900, 'n_words': 212}