<commit_before>/**
* @require
*/
var Feed                  = require('./feed.js'),
    request               = require('./http.js').request,
    makeDataStreamOptions = require('./utils.js').makeDataStreamOptions,
    defaultDataFormat     = require('../include/meta.js').defaultDataFormat;


/**
* Create an instance of DataStream
*
* @constructor {DataStream}
* @this        {dataStream}
* @param       {string}     apiKey Your pachube api key.
*/
function DataStream(apiKey, feedID) {
  /** @private */this.API_KEY = apiKey;
  /** @private */this.feedID  = feedID.toString();
}


/**
* @inheritance Feed
*/
Data.prototype = Feed.prototype;


/**
* Create new datastream: POST /v2/feeds/<feed_id>/datastreams
*
* @this  {DataStream}
* @param {number}   feedID             The feed ID.
* @param {string}   dataFile           The path to data file.
* @param {function} callback           The callbak function.
* @param {string}   optionalDataFormat Optional data format parameter, json or xml, default to json.
*/
DataStream.prototype.create = function(dataFile, callback, optionalDataFormat) {
  var options               = makeDataStreamOptions('POST', this.feedID);
  var dataFormat            = optionalDataFormat || defaultDataFormat;
  request(this.API_KEY, options, callback, dataFormat, dataFile);
};


/**
* Read datastream - GET /v2/feeds/<feed_id>/datastreams/<datastream_id>
*
* @this  {DataStream}
* @param {number}   feedID             The feed id.
* @param {string}   streamID           The data stream id.
* @param {function} callback           The callback function.
* @param {string}   optionalDataFormat optional data format parameter, json or xml, default to json.
*/<commit_msg>fixed typo<commit_after>/**
* @require
*/
var Feed                  = require('./feed.js'),
    request               = require('./http.js').request,
    makeDataStreamOptions = require('./utils.js').makeDataStreamOptions,
    defaultDataFormat     = require('../include/meta.js').defaultDataFormat;


/**
* Create an instance of DataStream
*
* @constructor {DataStream}
* @this        {dataStream}
* @param       {string}     apiKey Your pachube api key.
*/
function DataStream(apiKey, feedID) {
  /** @private */this.API_KEY = apiKey;
  /** @private */this.feedID  = feedID.toString();
}


/**
* @inheritance Feed
*/
DataStream.prototype = Feed.prototype;


/**
* Create new datastream: POST /v2/feeds/<feed_id>/datastreams
*
* @this  {DataStream}
* @param {number}   feedID             The feed ID.
* @param {string}   dataFile           The path to data file.
* @param {function} callback           The callbak function.
* @param {string}   optionalDataFormat Optional data format parameter, json or xml, default to json.
*/
DataStream.prototype.create = function(dataFile, callback, optionalDataFormat) {
  var options               = makeDataStreamOptions('POST', this.feedID);
  var dataFormat            = optionalDataFormat || defaultDataFormat;
  request(this.API_KEY, options, callback, dataFormat, dataFile);
};


/**
* Read datastream - GET /v2/feeds/<feed_id>/datastreams/<datastream_id>
*
* @this  {DataStream}
* @param {number}   feedID             The feed id.
* @param {string}   streamID           The data stream id.
* @param {function} callback           The callback function.
* @param {string}   optionalDataFormat optional data format parameter, json or xml, default to json.
*/
{'fraction_non_alphanumeric': 0.1299617759482505, 'fraction_numerical': 0.0011761246692149367, 'mean_word_length': 2.9742990654205608, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '2082143', 'n_tokens_mistral': 1014, 'n_tokens_neox': 991, 'n_words': 271}