<commit_before>import image_module = require("image/image");
import promises = require("promises/promises");
import http = require("http/http_request");

// merge request
declare var exports;
require("Utils/module_merge").merge(http, exports);

/**
  * Gets string from url.
  */
export function getString(url: string): promises.Promise<string> {
    var d = promises.defer<string>();

    http.request({ url: url, method: "GET" })
        .then(r => d.resolve(r.content.toString()))
        .fail(e => d.reject(e));

    return d.promise();
}

/**
  * Gets JSON from url.
  */
export function getJSON<T>(url: string): promises.Promise<T> {
    var d = promises.defer<T>();

    http.request({ url: url, method: "GET" })
        .then(r => d.resolve(r.content.toJSON()))
        .fail(e => d.reject(e));

    return d.promise();
}<commit_msg>http require Utils fixed :(<commit_after>import image_module = require("image/image");
import promises = require("promises/promises");
import http = require("http/http_request");

// merge request
declare var exports;
require("utils/module_merge").merge(http, exports);

/**
  * Gets string from url.
  */
export function getString(url: string): promises.Promise<string> {
    var d = promises.defer<string>();

    http.request({ url: url, method: "GET" })
        .then(r => d.resolve(r.content.toString()))
        .fail(e => d.reject(e));

    return d.promise();
}

/**
  * Gets JSON from url.
  */
export function getJSON<T>(url: string): promises.Promise<T> {
    var d = promises.defer<T>();

    http.request({ url: url, method: "GET" })
        .then(r => d.resolve(r.content.toJSON()))
        .fail(e => d.reject(e));

    return d.promise();
}
{'fraction_non_alphanumeric': 0.18374558303886926, 'fraction_numerical': 0.0, 'mean_word_length': 3.4828496042216357, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 21, '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': '1488026', 'n_tokens_mistral': 551, 'n_tokens_neox': 538, 'n_words': 128}