<commit_before>var debug = require('debug')('WebSSH2')
var colors = require('colors')
var Auth = require('basic-auth')

console.warn = makeColorConsole(console.warn, 'yellow')
console.error = makeColorConsole(console.error, 'red')

function makeColorConsole (fct, color) {
  return function () {
    for (var i in arguments) {
      if (arguments[i] instanceof Object) { arguments[i] = sys.inspect(arguments[i]) }
    }
    fct(Array.prototype.join.call(arguments, ' ')[color])
  }
}

exports.basicAuth = function (req, res, next) {
  var myAuth = Auth(req)
  if (myAuth) {
    req.session.username = myAuth.name
    req.session.userpassword = <PASSWORD><commit_msg>move from sys. to util. for utility functions<commit_after>var debug = require('debug')('WebSSH2')
var colors = require('colors')
var Auth = require('basic-auth')

console.warn = makeColorConsole(console.warn, 'yellow')
console.error = makeColorConsole(console.error, 'red')

function makeColorConsole (fct, color) {
  return function () {
    for (var i in arguments) {
      if (arguments[i] instanceof Object) { arguments[i] = util.inspect(arguments[i]) }
    }
    fct(Array.prototype.join.call(arguments, ' ')[color])
  }
}

exports.basicAuth = function (req, res, next) {
  var myAuth = Auth(req)
  if (myAuth) {
    req.session.username = myAuth.name
    req.session.userpassword = <PASSWORD>
{'fraction_non_alphanumeric': 0.147985347985348, 'fraction_numerical': 0.0014652014652014652, 'mean_word_length': 4.420634920634921, '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': '6560462', 'n_tokens_mistral': 441, 'n_tokens_neox': 438, 'n_words': 102}