<commit_before>
'use strict'

var bunyan = require('bunyan')
var kue = require('kue')
var async = require('async')
var assert = require('assert')
var _ = require('lodash')
var mongoose = require('mongoose')
var bluebird = require('bluebird')

var redis = require('app/config/redis')
var please = require('app/lib/please.js')
var KarmaService = require('../services/karma')
var NotificationService = require('../services/notification')
var InboxService = require('../services/inbox')
var FacebookService = require('../services/fb')

var logger = null

var Post = mongoose.model('Post')
var User = mongoose.model('User')
var Inbox = mongoose.model('Inbox')
var Follow = mongoose.model('Follow')
var Comment = mongoose.model('Comment')
// Activity = mongoose.model('Activity')

function reticentSlice (str, max) {
	if (str.length <= max) {
		return str
	}
	var last = str.match(/\s?(.+)\s*$/)[1]
	if (last.length > 20) {
		return str.slice(0, max-3)+"..."
	} else {
		words = str.slice(0, max-3).split(/\s/)
		return words.slice(0,words.length-2).join(' ')+"..."
	}
}

function _updateFollowStats(follower, followee, cb) {
	please({$model:User},{$model:User},'$fn',arguments)

	async.parallel([
		follower.updateCachedProfile.bind(follower),
		followee.updateCachedProfile.bind(followee)
	], (err, results) => {
		if (err) {
			throw err
		}
		cb()
	})
}

class Jobs {<commit_msg>Follow bugfix<commit_after>
'use strict'

var bunyan = require('bunyan')
var kue = require('kue')
var async = require('async')
var assert = require('assert')
var _ = require('lodash')
var mongoose = require('mongoose')
var bluebird = require('bluebird')

var redis = require('app/config/redis')
var please = require('app/lib/please.js')
var KarmaService = require('../services/karma')
var NotificationService = require('../services/notification')
var InboxService = require('../services/inbox')
var FacebookService = require('../services/fb')

var logger = null

var Post = mongoose.model('Post')
var User = mongoose.model('User')
var Inbox = mongoose.model('Inbox')
var Follow = mongoose.model('Follow')
var Comment = mongoose.model('Comment')

function reticentSlice (str, max) {
	if (str.length <= max) {
		return str
	}
	var last = str.match(/\s?(.+)\s*$/)[1]
	if (last.length > 20) {
		return str.slice(0, max-3)+"..."
	} else {
		words = str.slice(0, max-3).split(/\s/)
		return words.slice(0,words.length-2).join(' ')+"..."
	}
}

function _updateFollowStats(follower, followee, cb) {
	please({$model:User},{$model:User},'$fn',arguments)

	async.parallel([
		follower.updateCachedProfile.bind(follower),
		followee.updateCachedProfile.bind(followee)
	], (err, results) => {
		if (err) {
			throw err
		}
		cb()
	})
}

class Jobs {
{'fraction_non_alphanumeric': 0.1872465904902322, 'fraction_numerical': 0.006634721710283818, 'mean_word_length': 4.619047619047619, 'pattern_counts': {'":': 0, '<': 5, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7174140', 'n_tokens_mistral': 988, 'n_tokens_neox': 954, 'n_words': 203}