<commit_before>var gulp = require('gulp');
var del = require('del');
var preprocess = require('gulp-preprocess');
var less = require('gulp-less');
var rename = require("gulp-rename");
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var runSequence = require('run-sequence').use(gulp);
var eventStream = require('event-stream');
var ngTemplates = require('gulp-ng-templates');
var htmlmin = require('gulp-htmlmin');

var fs = require('fs-extra');
var path = require('path');
var server = require('server-root');
var _ = require('underscore');

_.str = require('underscore.string');

var TARGET_FOLDER = 'www';

var app = require('./src/app/index.js').create();
var appMode = 'DEVELOPMENT';

var modulePaths = [];
var moduleNames = [];

var getModuleFolderPath = function (installedPath) {
    var modulePath = installedPath.split('/');
    modulePath.pop();
    modulePath.pop();
    modulePath = modulePath.join('/');
    return modulePath;
}

gulp.task('setCurrentDirectory', function () {
    process.chdir(server.getPath(''));
});

gulp.task('copyLocalBowerComponents', function () {
    gulp.src('./bower/**')
        .pipe(gulp.dest('./bower_components'));
});

gulp.task('copyLocalNodeModules', function () {
    var gulps = [];

    var modules = undefined;
    if (fs.existsSync(server.getPath('npm/modules'))) {
        modules = _.filter(fs.readFileSync(server.getPath('npm/modules'), { encoding: 'utf8' }).split('\r\n'), function (x) {
            return x !== undefined && x !== '';
        });
    }
    
    if (fs.existsSync(server.getPath('npm'))) {
        var packages = fs.readdirSync(server.getPath('npm'));
        _.each(packages, function (packageItem) {
            if (fs.lstatSync(server.getPath('npm/' + packageItem)).isDirectory()) {
                var found = true;
                if (modules !== undefined) {
                    if (modules.indexOf(packageItem) !== -1) {
                        gulps.push(gulp.src('./npm/' + packageItem + '/**')
                            .pipe(gulp.dest('./node_modules/' + packageItem)));
                    }
                    else {
                        del.sync('./node_modules/' + packageItem);
                    }
                }
                else {
                    gulps.push(gulp.src('./npm/' + packageItem + '/**')
                        .pipe(gulp.dest('./node_modules/' + packageItem)));<commit_msg>gulp fix<commit_after>var gulp = require('gulp');
var del = require('del');
var preprocess = require('gulp-preprocess');
var less = require('gulp-less');
var rename = require("gulp-rename");
var minifyCSS = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var gutil = require('gulp-util');
var concat = require('gulp-concat');
var runSequence = require('run-sequence').use(gulp);
var eventStream = require('event-stream');
var ngTemplates = require('gulp-ng-templates');
var htmlmin = require('gulp-htmlmin');

var fs = require('fs-extra');
var path = require('path');
var server = require('server-root');
var _ = require('underscore');

_.str = require('underscore.string');

var TARGET_FOLDER = 'www';

var app = require('./src/app/index.js').create();
var appMode = 'DEVELOPMENT';

var modulePaths = [];
var moduleNames = [];

var getModuleFolderPath = function (installedPath) {
    var modulePath = installedPath.split('/');
    modulePath.pop();
    modulePath.pop();
    modulePath = modulePath.join('/');
    return modulePath;
}

gulp.task('setCurrentDirectory', function () {
    process.chdir(server.getPath(''));
});

gulp.task('copyLocalBowerComponents', function () {
    gulp.src('./bower/**')
        .pipe(gulp.dest('./bower_components'));
});

gulp.task('copyLocalNodeModules', function () {
    var gulps = [];

    var modules = undefined;
    if (fs.existsSync(server.getPath('npm/modules'))) {
        modules = _.filter(fs.readFileSync(server.getPath('npm/modules'), { encoding: 'utf8' }).split('\r\n'), function (x) {
            return x !== undefined && x !== '';
        });
    }
    
    if (fs.existsSync(server.getPath('npm'))) {
        var packages = fs.readdirSync(server.getPath('npm'));
        _.each(packages, function (packageItem) {
            if (fs.lstatSync(server.getPath('npm/' + packageItem)).isDirectory()) {
                del.sync('./node_modules/' + packageItem);

                if (modules !== undefined) {
                    if (modules.indexOf(packageItem) !== -1) {
                        gulps.push(gulp.src('./npm/' + packageItem + '/**')
                            .pipe(gulp.dest('./node_modules/' + packageItem)));
                    }
                }
                else {
                    gulps.push(gulp.src('./npm/' + packageItem + '/**')
                        .pipe(gulp.dest('./node_modules/' + packageItem)));
{'fraction_non_alphanumeric': 0.18292931350580566, 'fraction_numerical': 0.0008148299042574863, 'mean_word_length': 2.725341426403642, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3565665', 'n_tokens_mistral': 1503, 'n_tokens_neox': 1458, 'n_words': 270}