<commit_before>'use strict';
var net = require('net');
var multilevel = require('multilevel');

var db = multilevel.client();
db._separator = '~';
db._rangeLowerLimit = '!';
db._rangeUpperLimit = '~';
db._makeKey = makeKey;


var conn = net.connect({
  port: parseInt(process.env.DB_PORT_3001_TCP_PORT),
  host: process.env.DB_PORT_3001_TCP_ADDR
});

console.log('Connect to multilevel through ' + process.env.DB_PORT_3001_TCP_ADDR + ':' + process.env.DB_PORT_3001_TCP_PORT);
conn.pipe(db.createRpcStream()).pipe(conn);

module.exports = exports = db;

/**
 * makeKey -- Create a key prefix to be used by a given constructor.
 *
 * @param constructor{String} -- constructor function.
 * @return {String} -- prefix key.
 */
function makeKey(constructor) {
  return constructor.name.toLowerCase() + db._separator;
}<commit_msg>[update] Use environment variables defined by user.<commit_after>'use strict';
var net = require('net');
var multilevel = require('multilevel');

var db = multilevel.client();
db._separator = '~';
db._rangeLowerLimit = '!';
db._rangeUpperLimit = '~';
db._makeKey = makeKey;


var conn = net.connect({
  port: parseInt(process.env.LVLDB_PORT),
  host: process.env.LVLDB_HOST
});

console.log('Connect to multilevel through ' + process.env.LVLDB_HOST + ':' + process.env.LVLDB_PORT);
conn.pipe(db.createRpcStream()).pipe(conn);

module.exports = exports = db;

/**
 * makeKey -- Create a key prefix to be used by a given constructor.
 *
 * @param constructor{String} -- constructor function.
 * @return {String} -- prefix key.
 */
function makeKey(constructor) {
  return constructor.name.toLowerCase() + db._separator;
}
{'fraction_non_alphanumeric': 0.15389294403892945, 'fraction_numerical': 0.009732360097323601, 'mean_word_length': 4.792253521126761, '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': '7509420', 'n_tokens_mistral': 549, 'n_tokens_neox': 530, 'n_words': 122}