<commit_before>var util = require('util');

var loadBalancing = require('./policies/load-balancing.js');
var reconnection = require('./policies/reconnection.js');
var retry = require('./policies/retry.js');
var types = require('./types.js');
var utils = require('./utils.js');

/**
 * @returns {ClientOptions}
 */
function defaultOptions () {
  return ({
    policies: {
      loadBalancing: new loadBalancing.TokenAwarePolicy(new loadBalancing.DCAwareRoundRobinPolicy()),
      reconnection: new reconnection.ExponentialReconnectionPolicy(1000, 10 * 60 * 1000, false),
      retry: new retry.RetryPolicy()
    },
    queryOptions: {
      consistency: types.consistencies.one,
      fetchSize: 5000,
      prepare: false
    },
    protocolOptions: {
      port: 9042
    },
    pooling: {
      coreConnectionsPerHost: {
        '0': 2,
        '1': 1,
        '2': 0
      },
      maxConnectionsPerHost: {}
    },
    socketOptions: {
      connectTimeout: 5000,
      keepAlive: true,
      keepAliveDelay: 10000
    },
    authProvider: null,
    maxPrepared: 500
  });
}

/**
 * Extends and validates the user options
 * @param {Object} [baseOptions] The source object instance that will be overridden
 * @param {Object} userOptions
 * @returns {Object}
 */
function extend(baseOptions, userOptions) {
  if (arguments.length === 1) {
    userOptions = arguments[0];
    baseOptions = {};
  }<commit_msg>[fix] change default to node default for keepAlive<commit_after>var util = require('util');

var loadBalancing = require('./policies/load-balancing.js');
var reconnection = require('./policies/reconnection.js');
var retry = require('./policies/retry.js');
var types = require('./types.js');
var utils = require('./utils.js');

/**
 * @returns {ClientOptions}
 */
function defaultOptions () {
  return ({
    policies: {
      loadBalancing: new loadBalancing.TokenAwarePolicy(new loadBalancing.DCAwareRoundRobinPolicy()),
      reconnection: new reconnection.ExponentialReconnectionPolicy(1000, 10 * 60 * 1000, false),
      retry: new retry.RetryPolicy()
    },
    queryOptions: {
      consistency: types.consistencies.one,
      fetchSize: 5000,
      prepare: false
    },
    protocolOptions: {
      port: 9042
    },
    pooling: {
      coreConnectionsPerHost: {
        '0': 2,
        '1': 1,
        '2': 0
      },
      maxConnectionsPerHost: {}
    },
    socketOptions: {
      connectTimeout: 5000,
      keepAlive: true,
      keepAliveDelay: 0
    },
    authProvider: null,
    maxPrepared: 500
  });
}

/**
 * Extends and validates the user options
 * @param {Object} [baseOptions] The source object instance that will be overridden
 * @param {Object} userOptions
 * @returns {Object}
 */
function extend(baseOptions, userOptions) {
  if (arguments.length === 1) {
    userOptions = arguments[0];
    baseOptions = {};
  }
{'fraction_non_alphanumeric': 0.13459516298633017, 'fraction_numerical': 0.02663862600771118, 'mean_word_length': 3.077142857142857, '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': '6679529', 'n_tokens_mistral': 912, 'n_tokens_neox': 861, 'n_words': 205}