<commit_before>/*
*  This boilerplate javascript sdk is a collection of methods designed to make working with
*  an Api as easy as possible.
*
*  Learn more at https://github.com/monbro/javascript-sdk-boilerplate
*
*  @author <NAME> (<EMAIL>)
*/

/**
 * The browser console
 *
 * @property console
 * @private
 * @type object
 */
window.console = window.console || {};
window.console.log = this.console.log || function() {};

/**
 * expose our sdk
 */
(function(root) {
  root.WikiSampleSDK = root.WikiSampleSDK || {};
  root.WikiSampleSDK.VERSION = "js1.0.0";
}(this));

/**
 * main sdk
 */
(function(root) {

    root.WikiSampleSDK = root.WikiSampleSDK || {};

    /**
    * Contains all WikiSampleSDK API classes and functions.
    * @name WikiSampleSDK
    * @namespace
    *
    * Contains all WikiSampleSDK API classes and functions.
    */
    var WikiSampleSDK = root.WikiSampleSDK;

    // If jQuery has been included, grab a reference to it.
    if (typeof($) !== "undefined") {
        WikiSampleSDK.$ = $;
    }

    // Set the server for WikiSampleSDK to talk to.
    WikiSampleSDK.serverURL = "https://en.wikipedia.org";

    /**
     * Call this method first to set your authentication key.
     * @param {String} API Token
     */
    WikiSampleSDK.Initialize = function(apiToken) {
        WikiSampleSDK._initialize(apiToken);
    };

    /**
     * Get data according to a wikipedia page.
     * @param {string} title of a wikipedia page like 'Cheese'
     */
    WikiSampleSDK.GetPage = function(title) {
      WikiSampleSDK._requestSample(title, function(data) {
        console.log(data);
        // console.log(WikiSampleSDK.WikiTextHelper._upperCase(data));
      });
    };

    /**
     * This method is for WikiSampleSDK's own private use.
     * @param {String} API Token
     */
    WikiSampleSDK._initialize = function(apiToken) {
        WikiSampleSDK.apiToken = apiToken;
    };

    /**
     * sample request to our api server
     * @param  {string} title
     * @param  {function} successCallback
     */
    WikiSampleSDK._requestSample = function(title, successCallback) {

        var url = WikiSampleSDK.serverURL+
                  "/w/api.php?rvprop=content&format=json&prop=revisions|categories&rvprop=content&action=query&titles="+
                  encodeURI(title)+
                  "&token="
                  +encodeURI(WikiSampleSDK.apiToken);

        var jqxhr =
          WikiSampleSDK.$.ajax({
              url: url,
              dataType: 'json',
              type: 'GET'
          })
          .success (function(result) {
              successCallback(result);
          })
          .error   (function()     {
              console.log('Http request failed');
              // throw eror here
          })
          ;
    };

}(this));

/**
 * sdk text helper
 */
(function(root) {
    root.WikiSampleSDK = root.WikiSampleSDK || {};
    var WikiSampleSDK = root.WikiSampleSDK;

    /**
     * @namespace Provides an interface to WikiSampleSDK's wiki text processing helper.
     */
    WikiSampleSDK.WikiTextHelper = WikiSampleSDK.WikiTextHelper || {};

    WikiSampleSDK.WikiTextHelper._upperCase = function(content) {
        return content.toUpperCase();<commit_msg>bugfix example<commit_after>/*
*  This boilerplate javascript sdk is a collection of methods designed to make working with
*  an Api as easy as possible.
*
*  Learn more at https://github.com/monbro/javascript-sdk-boilerplate
*
*  @author <NAME> (<EMAIL>)
*/

/**
 * The browser console
 *
 * @property console
 * @private
 * @type object
 */
window.console = window.console || {};
window.console.log = this.console.log || function() {};

/**
 * expose our sdk
 */
(function(root) {
  root.WikiSampleSDK = root.WikiSampleSDK || {};
  root.WikiSampleSDK.VERSION = "js1.0.0";
}(this));

/**
 * main sdk
 */
(function(root) {

    root.WikiSampleSDK = root.WikiSampleSDK || {};

    /**
    * Contains all WikiSampleSDK API classes and functions.
    * @name WikiSampleSDK
    * @namespace
    *
    * Contains all WikiSampleSDK API classes and functions.
    */
    var WikiSampleSDK = root.WikiSampleSDK;

    // If jQuery has been included, grab a reference to it.
    if (typeof($) !== "undefined") {
        WikiSampleSDK.$ = $;
    }

    // Set the server for WikiSampleSDK to talk to.
    WikiSampleSDK.serverURL = "https://en.wikipedia.org";

    /**
     * Call this method first to set your authentication key.
     * @param {String} API Token
     */
    WikiSampleSDK.Initialize = function(apiToken) {
        WikiSampleSDK._initialize(apiToken);
    };

    /**
     * Get data according to a wikipedia page.
     * @param {string} title of a wikipedia page like 'Cheese'
     */
    WikiSampleSDK.GetPage = function(title) {
      WikiSampleSDK._requestSample(title, function(data) {
        console.log(data);
        // console.log(WikiSampleSDK.WikiTextHelper._upperCase(data));
      });
    };

    /**
     * This method is for WikiSampleSDK's own private use.
     * @param {String} API Token
     */
    WikiSampleSDK._initialize = function(apiToken) {
        WikiSampleSDK.apiToken = apiToken;
    };

    /**
     * sample request to our api server
     * @param  {string} title
     * @param  {function} successCallback
     */
    WikiSampleSDK._requestSample = function(title, successCallback) {

        var url = WikiSampleSDK.serverURL+
                  "/w/api.php?rvprop=content&format=json&prop=revisions|categories&rvprop=content&action=query&titles="+
                  encodeURI(title)+
                  "&token="
                  +encodeURI(WikiSampleSDK.apiToken);

        var jqxhr =
          WikiSampleSDK.$.ajax({
              url: url,
              dataType: 'jsonp',
              type: 'GET'
          })
          .success (function(result) {
              successCallback(result);
          })
          .error   (function()     {
              console.log('Http request failed');
              // throw eror here
          })
          ;
    };

}(this));

/**
 * sdk text helper
 */
(function(root) {
    root.WikiSampleSDK = root.WikiSampleSDK || {};
    var WikiSampleSDK = root.WikiSampleSDK;

    /**
     * @namespace Provides an interface to WikiSampleSDK's wiki text processing helper.
     */
    WikiSampleSDK.WikiTextHelper = WikiSampleSDK.WikiTextHelper || {};

    WikiSampleSDK.WikiTextHelper._upperCase = function(content) {
        return content.toUpperCase();
{'fraction_non_alphanumeric': 0.12418705481573243, 'fraction_numerical': 0.0009290802105915144, 'mean_word_length': 2.322530864197531, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, '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': '6131573', 'n_tokens_mistral': 2032, 'n_tokens_neox': 1895, 'n_words': 442}