<commit_before>/*
 *  Copyright 2011 Rackspace
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

/** node.js driver for Cassandra-CQL. */

var util = require('util');
var constants = require('constants');
var EventEmitter = require('events').EventEmitter;

var thrift = require('thrift');
var async = require('async');
var Cassandra = require('./gen-nodejs/Cassandra');
var ttypes = require('./gen-nodejs/cassandra_types');

var Decoder = require('./decoder').Decoder;

var bufferToString = module.exports.bufferToString = require('./decoder').bufferToString;


// used to parse the CF name out of a select statement.
var selectRe = /\s*SELECT\s+.+\s+FROM\s+[\']?(\w+)/im;
var selectCountRe = /\s*SELECT\s+.*COUNT\(.+\)\s+FROM\s+[\']?(\w+)/im;

var appExceptions = ['InvalidRequestException', 'UnavailableException', 'SchemaDisagreementException'];

var nullBindError = {
  message: 'null/undefined query parameter'
};

//  how long we wait for a connection to time out.
var DEFAULT_CONNECTION_TIMEOUT = 4000;

// how long we wait for a query to finish.
var DEFAULT_MAX_QUERY = 100000;<commit_msg>Decrease query execution timeout from 100s to more sane 5s.<commit_after>/*
 *  Copyright 2011 Rackspace
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 */

/** node.js driver for Cassandra-CQL. */

var util = require('util');
var constants = require('constants');
var EventEmitter = require('events').EventEmitter;

var thrift = require('thrift');
var async = require('async');
var Cassandra = require('./gen-nodejs/Cassandra');
var ttypes = require('./gen-nodejs/cassandra_types');

var Decoder = require('./decoder').Decoder;

var bufferToString = module.exports.bufferToString = require('./decoder').bufferToString;


// used to parse the CF name out of a select statement.
var selectRe = /\s*SELECT\s+.+\s+FROM\s+[\']?(\w+)/im;
var selectCountRe = /\s*SELECT\s+.*COUNT\(.+\)\s+FROM\s+[\']?(\w+)/im;

var appExceptions = ['InvalidRequestException', 'UnavailableException', 'SchemaDisagreementException'];

var nullBindError = {
  message: 'null/undefined query parameter'
};

//  how long we wait for a connection to time out.
var DEFAULT_CONNECTION_TIMEOUT = 4000;

// how long we wait for a query to finish.
var DEFAULT_MAX_QUERY = 5000;
{'fraction_non_alphanumeric': 0.12804136253041362, 'fraction_numerical': 0.011557177615571776, 'mean_word_length': 4.147104851330203, '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': '4065723', 'n_tokens_mistral': 981, 'n_tokens_neox': 948, 'n_words': 342}