<commit_before>/*
 * grunt-typescript
 * Copyright 2012 <NAME>
 * Licensed under the MIT license.
 */

module.exports = function (grunt) {

    var path = require('path'),
        fs = require('fs'),
        vm = require('vm'),
        gruntIO = function (currentPath, destPath, basePath, compSetting, outputOne) {
            var createdFiles = [];
            basePath = basePath || ".";

            return {
                getCreatedFiles:function () {
                    return createdFiles;
                },

                resolvePath:path.resolve,
                readFile:function (file){
                    var content = grunt.file.read(file);
                    // strip UTF BOM
                    if(content.charCodeAt(0) === 0xFEFF){
                        content = content.slice(1);
                    }

                    return content;
                },
                dirName:path.dirname,

                createFile:function (writeFile, useUTF8) {
                    var source = "";
                    return {
                        Write:function (str) {
                            source += str;
                        },
                        WriteLine:function (str) {
                            source += str + grunt.util.linefeed;
                        },
                        Close:function () {
                            if (source.trim().length < 1) {
                                return;
                            }

                            if (!outputOne) {
                                var g = path.join(currentPath, basePath);
                                writeFile = writeFile.substr(g.length);
                                writeFile = path.join(currentPath, destPath, writeFile);
                            }

                            grunt.file.write(writeFile, source);
                            createdFiles.push(writeFile);
                        }
                    }
                },
                findFile: function (rootPath, partialFilePath) {
                    var file = path.join(rootPath, partialFilePath);
                    while(true) {
                        if(fs.existsSync(file)) {
                            try  {
                                var content = grunt.file.read(file);
                                // strip UTF BOM
                                if(content.charCodeAt(0) === 0xFEFF){
                                    content = content.slice(1);
                                }
                                return {
                                    content: content,<commit_msg>Fix to Issue #23<commit_after>/*
 * grunt-typescript
 * Copyright 2012 <NAME>
 * Licensed under the MIT license.
 */

module.exports = function (grunt) {

    var path = require('path'),
        fs = require('fs'),
        vm = require('vm'),
        gruntIO = function (currentPath, destPath, basePath, compSetting, outputOne) {
            var createdFiles = [];
            basePath = basePath || ".";

            return {
                getCreatedFiles:function () {
                    return createdFiles;
                },

                resolvePath:path.resolve,
                readFile:function (file){
                    var content = grunt.file.read(file);
                    // strip UTF BOM
                    if(content.charCodeAt(0) === 0xFEFF){
                        content = content.slice(1);
                    }

                    return content;
                },
                dirName:path.dirname,

                createFile:function (writeFile, useUTF8) {
                    var source = "";
                    return {
                        Write:function (str) {
                            source += str;
                        },
                        WriteLine:function (str) {
                            source += str + grunt.util.linefeed;
                        },
                        Close:function () {
                            if (source.trim().length < 1) {
                                return;
                            }

                            if (!outputOne) {
                                var g = path.join(currentPath, basePath);
                                writeFile = writeFile.substr(g.length);
                                writeFile = path.join(currentPath, destPath ? destPath.toString() : '', writeFile);
                            }

                            grunt.file.write(writeFile, source);
                            createdFiles.push(writeFile);
                        }
                    }
                },
                findFile: function (rootPath, partialFilePath) {
                    var file = path.join(rootPath, partialFilePath);
                    while(true) {
                        if(fs.existsSync(file)) {
                            try  {
                                var content = grunt.file.read(file);
                                // strip UTF BOM
                                if(content.charCodeAt(0) === 0xFEFF){
                                    content = content.slice(1);
                                }
                                return {
                                    content: content,
{'fraction_non_alphanumeric': 0.08843537414965986, 'fraction_numerical': 0.0049130763416477706, 'mean_word_length': 0.8220309810671257, 'pattern_counts': {'":': 0, '<': 7, '<?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': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2054931', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1095, 'n_words': 223}