<commit_before>#!/usr/bin/env node

var neo4j = require("node-neo4j");
var utils = require("./utils");

utils.validateEnvironment("node db-admin.js");

var connectionString = utils.createConnectionString();
console.log("=> Connecting to " + process.env.DATABASE_URL);

var db = new neo4j(connectionString);
var stdin = process.openStdin();

stdin.addListener("data", function (d) {
  console.log("=> Running: " + d.toString().trim());
  db.cypherQuery(d.toString().trim(), function (err, result) {
    if (err) {
      console.log(err);
      return;
    }

    console.log(result.data);
    console.log(result.columns);
  });
});<commit_msg>db: Move runAdminInterface into IIFE<commit_after>#!/usr/bin/env node

var neo4j = require("node-neo4j");
var utils = require("./utils");

var stdin = process.openStdin();

utils.validateEnvironment("node db-admin.js");
console.log("=> Connecting to " + process.env.DATABASE_URL);

(function runAdminInterface() {
  var connectionString = utils.createConnectionString();
  var db = new neo4j(connectionString);
  stdin.addListener("data", function (d) {
    console.log("=> Running: " + d.toString().trim());
    db.cypherQuery(d.toString().trim(), function (err, result) {
      if (err) {
        console.log(err);
        return;
      }

      console.log(result.data);
      console.log(result.columns);
    });
  });
}());
{'fraction_non_alphanumeric': 0.17956204379562044, 'fraction_numerical': 0.004379562043795621, 'mean_word_length': 4.0036496350364965, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3656611', 'n_tokens_mistral': 455, 'n_tokens_neox': 448, 'n_words': 86}