<commit_before>var Promise = require("bluebird");
var chalksay = require('chalksay');
var jdbc = require('jdbc');
var jinst = require('jdbc/lib/jinst');

var DEFAULT_FETCH_SIZE = 100;
var DEFAUT_OPTIONS = {
    teradataJarPath: "./jars/",
    verbose: false
};
var teradataInstance;
var teradataConfig = {properties: {}};
var tdConn;
var verboseLoggingOn = DEFAUT_OPTIONS.verbose;
function createPromisedStatement(query) {
    return tdConn.conn.createStatementAsync()
        .then(function (statement) {
            queryStatement = Promise.promisifyAll(statement);
            return queryStatement;
        })
}
function createPromisedPreparedStatement(query) {
    return tdConn.conn.prepareStatementAsync(query)
        .then(function (statement) {
            queryStatement = Promise.promisifyAll(statement);
            return queryStatement;
        })
}
Teradata = {
    connect: function (url, user, password, options) {
        //config using user settings
        teradataConfig.url = url;
        teradataConfig.properties.user = user;
        teradataConfig.properties.password = password;
        var teradataJarPath = options.teradataJarPath || DEFAUT_OPTIONS.teradataJarPath;
        verboseLoggingOn = options.verbose === true ? true : false;

        //add jars to classpath
        if (!jinst.isJvmCreated()) {
            jinst.addOption("-Xrs");
            jinst.setupClasspath([
                teradataJarPath + 'terajdbc4.jar',
                // './jars/terajdbc4.jar',
                teradataJarPath + 'tdgssconfig.jar'
                // './jars/tdgssconfig.jar'
            ]);
        }

        //init jvm and reserve teradata connection
        teradataInstance = Promise.promisifyAll(new jdbc(teradataConfig));

        return teradataInstance.initializeAsync()
            .then(function () {
                if (verboseLoggingOn===true) {
                    chalksay.green("Succesfully initialized Teradata connection to %s ", teradataConfig.url);
                }<commit_msg>fix null options case<commit_after>var Promise = require("bluebird");
var chalksay = require('chalksay');
var jdbc = require('jdbc');
var jinst = require('jdbc/lib/jinst');

var DEFAULT_FETCH_SIZE = 100;
var DEFAUT_OPTIONS = {
    teradataJarPath: "./jars/",
    verbose: false
};
var teradataInstance;
var teradataConfig = {properties: {}};
var tdConn;
var verboseLoggingOn = DEFAUT_OPTIONS.verbose;
function createPromisedStatement(query) {
    return tdConn.conn.createStatementAsync()
        .then(function (statement) {
            queryStatement = Promise.promisifyAll(statement);
            return queryStatement;
        })
}
function createPromisedPreparedStatement(query) {
    return tdConn.conn.prepareStatementAsync(query)
        .then(function (statement) {
            queryStatement = Promise.promisifyAll(statement);
            return queryStatement;
        })
}
Teradata = {
    connect: function (url, user, password, options) {
        //config using user settings
        teradataConfig.url = url;
        teradataConfig.properties.user = user;
        teradataConfig.properties.password = password;
        var teradataJarPath = options && options.teradataJarPath ? options.teradataJarPath : DEFAUT_OPTIONS.teradataJarPath;
        verboseLoggingOn = options && options.verbose === true ? true : false;

        //add jars to classpath
        if (!jinst.isJvmCreated()) {
            jinst.addOption("-Xrs");
            jinst.setupClasspath([
                teradataJarPath + 'terajdbc4.jar',
                // './jars/terajdbc4.jar',
                teradataJarPath + 'tdgssconfig.jar'
                // './jars/tdgssconfig.jar'
            ]);
        }

        //init jvm and reserve teradata connection
        teradataInstance = Promise.promisifyAll(new jdbc(teradataConfig));

        return teradataInstance.initializeAsync()
            .then(function () {
                if (verboseLoggingOn===true) {
                    chalksay.green("Succesfully initialized Teradata connection to %s ", teradataConfig.url);
                }
{'fraction_non_alphanumeric': 0.10638297872340426, 'fraction_numerical': 0.002445585717779408, 'mean_word_length': 2.5411255411255413, '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': '714042', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1130, 'n_words': 230}