<commit_before>var delta = require('delta')
var cadence = require('cadence')

var PROTOCOL = {
    http: require('http'),
    https: require('https')
}

exports.connect = cadence(function (async, options) {
    options = {
        port: options.port,
        host: options.host || 'localhost',
        secure: options.secure == null ? false : options.secure,
        hashKey: options.hashKey == null ? '' : options.hashKey,
        headers: options.headers || {}
    }
    var protocol = options.secure ? PROTOCOL.https : PROTOCOL.http
    var headers = {
        connection: 'Upgrade',
        upgrade: 'Conduit',
        host: options.host + ':' + options.port,
        'sec-conduit-protocol-id': 'c2845f0d55220303d62fc68e4c145877',
        'sec-conduit-version': 1,
        'sec-conduit-hash-key': options.hashKey == null ? '' : options.hashKey
    }
    for (var name in options.headers) {
        headers[name] = options.headers[name]
    }
    var request = protocol.request({
        port: options.port,
        host: options.host,
        headers: headers
    })
    request.on('response', function () {
        console.log('called')
    })
    async(function () {<commit_msg>Assert no response.<commit_after>var delta = require('delta')
var cadence = require('cadence')
var assert = require('assert')

var PROTOCOL = {
    http: require('http'),
    https: require('https')
}

exports.connect = cadence(function (async, options) {
    options = {
        port: options.port,
        host: options.host || 'localhost',
        secure: options.secure == null ? false : options.secure,
        hashKey: options.hashKey == null ? '' : options.hashKey,
        headers: options.headers || {}
    }
    var protocol = options.secure ? PROTOCOL.https : PROTOCOL.http
    var headers = {
        connection: 'Upgrade',
        upgrade: 'Conduit',
        host: options.host + ':' + options.port,
        'sec-conduit-protocol-id': 'c2845f0d55220303d62fc68e4c145877',
        'sec-conduit-version': 1,
        'sec-conduit-hash-key': options.hashKey == null ? '' : options.hashKey
    }
    for (var name in options.headers) {
        headers[name] = options.headers[name]
    }
    var request = protocol.request({
        port: options.port,
        host: options.host,
        headers: headers
    })
    request.on('response', assert.bind(null, false, 'should be no response'))
    async(function () {
{'fraction_non_alphanumeric': 0.1422037422037422, 'fraction_numerical': 0.02079002079002079, 'mean_word_length': 2.6289592760180995, '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': '1025559', 'n_tokens_mistral': 763, 'n_tokens_neox': 740, 'n_words': 159}