<commit_before>var Q = require("Q")

var redisQ = function(defer) {
	return function(err, res) {
		if(err) {
			return defer.reject(err)
		}

		return defer.resolve(res)
	}
}

module.exports = function(redis) {
	
	this.brpop = function(list, timeout) {
		var defer = Q.defer()

		redis.brpop(list, timeout, redisQ(defer))

		return defer.promise
	}

	this.hmset = function(key, vals) {
		var defer = Q.defer()

		redis.hmset(key, vals, redisQ(defer))

		return defer.promise
	}

	this.hgetall = function(key) {
		var defer = Q.defer()

		redis.hgetall(key, redisQ(defer))

		return defer.promise
	}

	this.sadd = function(key, items) {
		var defer = Q.defer()

		redis.sadd(key, items, redisQ(defer))

		return defer.promise
	}

	this.sdiff = function(a, b) {
		var defer = Q.defer()

		redis.sdiff(a, b, redisQ(defer))

		return defer.promise
	}

	this.smembers = function(set) {
		var defer = Q.defer()

		redis.smembers(set, redisQ(defer))

		return defer.promise
	}

	this.sget = function(set) {
		var defer = Q.defer()

		redis.sget(set, redisQ(defer))

		return defer.promise
	}

	return this
}
<commit_msg>Add more redis functions<commit_after>var Q = require("Q")

var redisQ = function(defer) {
	return function(err, res) {
		if(err) {
			return defer.reject(err)
		}

		return defer.resolve(res)
	}
}

module.exports = function(redis) {
	
	this.brpop = function(list, timeout) {
		var defer = Q.defer()

		redis.brpop(list, timeout, redisQ(defer))

		return defer.promise
	}

	this.hmset = function(key, vals) {
		var defer = Q.defer()

		redis.hmset(key, vals, redisQ(defer))

		return defer.promise
	}

	this.hgetall = function(key) {
		var defer = Q.defer()

		redis.hgetall(key, redisQ(defer))

		return defer.promise
	}

	this.sadd = function(key, items) {
		var defer = Q.defer()

		redis.sadd(key, items, redisQ(defer))

		return defer.promise
	}

	this.sdiff = function(a, b) {
		var defer = Q.defer()

		redis.sdiff(a, b, redisQ(defer))

		return defer.promise
	}

	this.smembers = function(set) {
		var defer = Q.defer()

		redis.smembers(set, redisQ(defer))

		return defer.promise
	}

	this.sget = function(set) {
		var defer = Q.defer()

		redis.sget(set, redisQ(defer))

		return defer.promise
	}

	this.expire = function(key, time) {
		var defer = Q.defer()

		redis.expire(key, time, redisQ(defer))

		return defer.promise
	}

	this.set = function(key, val) {
		var defer = Q.defer()

		redis.set(key, val, redisQ(defer))

		return defer.promise
	}

	this.get = function(key) {
		var defer = Q.defer()

		redis.get(key, redisQ(defer))

		return defer.promise
	}

	this.del = function(key) {
		var defer = Q.defer()

		redis.del(key, redisQ(defer))

		return defer.promise
	}

	return this
}

{'fraction_non_alphanumeric': 0.14501288185498712, 'fraction_numerical': 0.0, 'mean_word_length': 3.34185303514377, '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': '2177917', 'n_tokens_mistral': 1239, 'n_tokens_neox': 1078, 'n_words': 221}