<commit_before># -*- coding: utf-8 -*-

from twisted.internet import defer, protocol, reactor

from txredis.protocol import Redis

class RedisStorage(object):
    def __init__(self, host, port):
        self.host = host
        self.port = port

    @defer.inlineCallbacks
    def connect(self):
        clientCreator = protocol.ClientCreator(reactor, Redis)
        self.redis = yield clientCreator.connectTCP(self.host, self.port)

    def disconnect(self):
        self.redis.transport.loseConnection()

    @defer.inlineCallbacks
    def hset(self, table, field, value):
        r = yield self.redis.hset(table, field, value)

    @defer.inlineCallbacks
    def hsetn(self, table, items):
        for field, value in items:
            yield self.hset(table, field, value)<commit_msg>RedisStorage: small fixed broken hsetn function<commit_after># -*- coding: utf-8 -*-

from twisted.internet import defer, protocol, reactor

from txredis.protocol import Redis

class RedisStorage(object):
    def __init__(self, host, port):
        self.host = host
        self.port = port

    @defer.inlineCallbacks
    def connect(self):
        clientCreator = protocol.ClientCreator(reactor, Redis)
        self.redis = yield clientCreator.connectTCP(self.host, self.port)

    def disconnect(self):
        self.redis.transport.loseConnection()

    @defer.inlineCallbacks
    def hset(self, table, field, value):
        r = yield self.redis.hset(table, field, value)

    @defer.inlineCallbacks
    def hsetn(self, table, items):
        for field, value in items.iteritems():
            yield self.hset(table, field, value)
{'fraction_non_alphanumeric': 0.10480887792848335, 'fraction_numerical': 0.0012330456226880395, 'mean_word_length': 3.0473815461346634, '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': '4518736', 'n_tokens_mistral': 500, 'n_tokens_neox': 484, 'n_words': 126}