<commit_before>/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

var JSONApiRequest = require('./json_api_request').JSONApiRequest;
var util = require('util');

exports.DeleteContextsRequest = module.exports.DeleteContextsRequest = DeleteContextsRequest;

util.inherits(DeleteContextsRequest, JSONApiRequest);

function DeleteContextsRequest(application, options, context) {
    var self = this;

    if (context) {
      self.context = context;
    }
    self.sessionId = options.sessionId;

    DeleteContextsRequest.super_.apply(this, [application, options]);
}

DeleteContextsRequest.prototype._headers = function() {
    var headers = DeleteContextsRequest.super_.prototype._headers.apply(this, arguments);

    headers['Content-Type'] = 'application/json; charset=utf-8';

    return headers;
};

DeleteContextsRequest.prototype._requestOptions = function() {
    var request_options = DeleteContextsRequest.super_.prototype._requestOptions.apply(this, arguments);
    var contextPath = this.context ? '/' + context : '';

    request_options.path = this.endpoint + 'contexts' + contextPath + '?sessionId=' + this.sessionId;
    request_options.method = 'DELETE';

    return request_options;
};<commit_msg>fixed issue where context variable was used out of scope<commit_after>/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

var JSONApiRequest = require('./json_api_request').JSONApiRequest;
var util = require('util');

exports.DeleteContextsRequest = module.exports.DeleteContextsRequest = DeleteContextsRequest;

util.inherits(DeleteContextsRequest, JSONApiRequest);

function DeleteContextsRequest(application, options, context) {
    var self = this;

    if (context) {
      self.context = context;
    }
    self.sessionId = options.sessionId;

    DeleteContextsRequest.super_.apply(this, [application, options]);
}

DeleteContextsRequest.prototype._headers = function() {
    var headers = DeleteContextsRequest.super_.prototype._headers.apply(this, arguments);

    headers['Content-Type'] = 'application/json; charset=utf-8';

    return headers;
};

DeleteContextsRequest.prototype._requestOptions = function() {
    var request_options = DeleteContextsRequest.super_.prototype._requestOptions.apply(this, arguments);
    var contextPath = this.context ? '/' + this.context : '';

    request_options.path = this.endpoint + 'contexts' + contextPath + '?sessionId=' + this.sessionId;
    request_options.method = 'DELETE';

    return request_options;
};
{'fraction_non_alphanumeric': 0.12236121970289289, 'fraction_numerical': 0.00547302580140735, 'mean_word_length': 4.724832214765101, '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': '3608256', 'n_tokens_mistral': 736, 'n_tokens_neox': 711, 'n_words': 145}