<commit_before>from lib.rome.utils.MemoizationDecorator import memoization_decorator
from lib.rome.conf.Configuration import get_config
from lib.rome.utils.MemoizationDecorator import MemoizationDecorator


class DatabaseDriverInterface(object):

    def add_key(self, tablename, key):
        raise NotImplementedError

    def remove_key(self, tablename, key):
        raise NotImplementedError

    def next_key(self, tablename):
        raise NotImplementedError

    def keys(self, tablename):
        raise NotImplementedError

    def put(self, tablename, key, value, secondary_indexes=[]):
        raise NotImplementedError

    def get(self, tablename, key, hint=None):
        raise NotImplementedError

    def getall(self, tablename, hints=[]):
        raise NotImplementedError


driver = None


def build_driver():
    config = get_config()

    if config.backend() == "redis":
        import lib.rome.driver.redis.driver
        if True or config.redis_cluster_enabled():
            return lib.rome.driver.redis.driver.RedisClusterDriver()
        else:
            return lib.rome.driver.redis.driver.RedisDriver()
    if config.backend() == "cassandra":
        import lib.rome.driver.cassandra.driver
        return lib.rome.driver.cassandra.driver.CassandraDriver()
    else:<commit_msg>clustered redis was always on;<commit_after>from lib.rome.utils.MemoizationDecorator import memoization_decorator
from lib.rome.conf.Configuration import get_config
from lib.rome.utils.MemoizationDecorator import MemoizationDecorator


class DatabaseDriverInterface(object):

    def add_key(self, tablename, key):
        raise NotImplementedError

    def remove_key(self, tablename, key):
        raise NotImplementedError

    def next_key(self, tablename):
        raise NotImplementedError

    def keys(self, tablename):
        raise NotImplementedError

    def put(self, tablename, key, value, secondary_indexes=[]):
        raise NotImplementedError

    def get(self, tablename, key, hint=None):
        raise NotImplementedError

    def getall(self, tablename, hints=[]):
        raise NotImplementedError


driver = None


def build_driver():
    config = get_config()

    if config.backend() == "redis":
        import lib.rome.driver.redis.driver
        if config.redis_cluster_enabled():
            return lib.rome.driver.redis.driver.RedisClusterDriver()
        else:
            return lib.rome.driver.redis.driver.RedisDriver()
    if config.backend() == "cassandra":
        import lib.rome.driver.cassandra.driver
        return lib.rome.driver.cassandra.driver.CassandraDriver()
    else:
{'fraction_non_alphanumeric': 0.08882958444529165, 'fraction_numerical': 0.0, 'mean_word_length': 3.337190082644628, 'pattern_counts': {'":': 4, '<': 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': '5376288', 'n_tokens_mistral': 789, 'n_tokens_neox': 761, 'n_words': 171}