<commit_before>'use strict';
var _ = require('lodash');
var async = require('async');
var moment = require('moment');
var pg = require('pg');

var config = require('../config/config.js')();

var seneca = require('seneca')();

seneca.log.info('using config', JSON.stringify(config, null, 4));
seneca.options(config);

seneca.use('postgresql-store', config["postgresql-store"]);
seneca.use(require('../lib/cd-events'));

seneca.ready(function() {

  function addEventsEndTime(cb) {
    var eventsEntity = seneca.make$('cd/events');
    var applicationsEntity = seneca.make$('cd/events');
    var attendanceEntity = seneca.make$('cd/events');
    async.waterfall([
      function(done) {
        eventsEntity.list$({limit$:'NULL'}, done);
      },
      function(events, done) {
        //remove all events from DB
        var ids = _.pluck(events, 'id');
        async.each(ids, function(id, done){
          eventsEntity.remove$({id: id}, done);
        }, done(null, events));
      },
      function(events, done){
        //use native PG to alter table data type from timestamp with time zone[] to json[]
        var localPgOptions = _.defaults({}, config["postgresql-store"]);
        localPgOptions.database = _.get(config, 'postgresql-store.name');
        localPgOptions.user = _.get(config, 'postgresql-store.username');

        pg.connect(localPgOptions, function (err, client) {<commit_msg>typos<commit_after>'use strict';
var _ = require('lodash');
var async = require('async');
var moment = require('moment');
var pg = require('pg');

var config = require('../config/config.js')();

var seneca = require('seneca')();

seneca.log.info('using config', JSON.stringify(config, null, 4));
seneca.options(config);

seneca.use('postgresql-store', config["postgresql-store"]);
seneca.use(require('../lib/cd-events'));

seneca.ready(function() {

  function addEventsEndTime(cb) {
    var eventsEntity = seneca.make$('cd/events');
    var applicationsEntity = seneca.make$('cd/applications');
    var attendanceEntity = seneca.make$('cd/attendance');
    async.waterfall([
      function(done) {
        eventsEntity.list$({limit$:'NULL'}, done);
      },
      function(events, done) {
        //remove all events from DB
        var ids = _.pluck(events, 'id');
        async.each(ids, function(id, done){
          eventsEntity.remove$({id: id}, done);
        }, done(null, events));
      },
      function(events, done){
        //use native PG to alter table data type from timestamp with time zone[] to json[]
        var localPgOptions = _.defaults({}, config["postgresql-store"]);
        localPgOptions.database = _.get(config, 'postgresql-store.name');
        localPgOptions.user = _.get(config, 'postgresql-store.username');

        pg.connect(localPgOptions, function (err, client) {
{'fraction_non_alphanumeric': 0.17130620985010706, 'fraction_numerical': 0.0007137758743754461, 'mean_word_length': 3.5875613747954174, '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': '3847691', 'n_tokens_mistral': 858, 'n_tokens_neox': 850, 'n_words': 188}