<commit_before>'use strict';


var redis = require('redis'),
    parse = require('url').parse;


var RedisClient = function(connectionURL) {
  var options = this.parseURL(connectionURL);
  this.hostname = options.hostname;
  this.port = options.port;
  this.username = options.username;
  this.password = options.password;
};


RedisClient.prototype.parseURL = function(url) {
  var _url = parse(url),
      auth = _url.auth.split(':');

  return {
    hostname: _url.hostname,
    port: _url.port,
    username: auth[0],
    password: <PASSWORD>[1]
  };
};


RedisClient.prototype.makeClient = function() {
  var r = redis.createClient(this.port, this.hostname);

  return r.auth(this.password, function(error) {
    if (error) console.error(error);

    r.on('error', function(error) {
      console.error('redis error: ' + error);
    }).on('connect', function() {
      console.info('redis connect: ' + this.host + ':' + this.port);
    });

    return r;

  });
};


RedisClient.prototype.createStoreClient = function() {
  var store = {
    redisPub: this.makeClient(),
    redisSub: this.makeClient(),
    redisClient: this.makeClient()
  };

  return store;
};

module.exports = RedisClient;

<commit_msg>Remove return from redis object<commit_after>'use strict';


var redis = require('redis'),
    parse = require('url').parse;


var RedisClient = function(connectionURL) {
  var options = this.parseURL(connectionURL);
  this.hostname = options.hostname;
  this.port = options.port;
  this.username = options.username;
  this.password = options.password;
};


RedisClient.prototype.parseURL = function(url) {
  var _url = parse(url),
      auth = _url.auth.split(':');

  return {
    hostname: _url.hostname,
    port: _url.port,
    username: auth[0],
    password: <PASSWORD>[1]
  };
};


RedisClient.prototype.makeClient = function() {
  var r = redis.createClient(this.port, this.hostname);

  r.auth(this.password, function(error) {
    if (error) console.error(error);

    r.on('error', function(error) {
      console.error('redis error: ' + error);
    }).on('connect', function() {
      console.info('redis connect: ' + this.host + ':' + this.port);
    });

    return r;

  });
};


RedisClient.prototype.createStoreClient = function() {
  var store = {
    redisPub: this.makeClient(),
    redisSub: this.makeClient(),
    redisClient: this.makeClient()
  };

  return store;
};

module.exports = RedisClient;


{'fraction_non_alphanumeric': 0.15757078375051292, 'fraction_numerical': 0.0016413623307345096, 'mean_word_length': 3.5148148148148146, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2595508', 'n_tokens_mistral': 819, 'n_tokens_neox': 801, 'n_words': 155}