<commit_before>// @see https://devcenter.heroku.com/articles/nodejs#write-your-app

var express = require('express')
  , fs      = require('fs') // node
  , path    = require('path') //node
  , gm      = require('gm')
  , http    = require('http') // node
  , https   = require('https') // node
  , mime    = require('mime') // express
  , url     = require('url') // node
  , md5     = require('MD5')
  , glob    = require('glob')
  // @see http://aaronheckmann.posterous.com/graphicsmagick-on-heroku-with-nodejs
  , imageMagick = gm.subClass({imageMagick: true})
  , app = express.createServer(express.logger())
  , mimeTypes = [
    'image/jpeg',
    'image/png',
    'image/gif',
    'image/jpg'
  ];

app.get('/crossdomain.xml', function(req, res, next){
    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
    res.setHeader("Content-Type", "text/xml");
    var filePath = path.join(__dirname, "crossdomain.xml");
    var stream = fs.createReadStream(filePath);
    stream.pipe(res);
});

// Set default file extension for image/jpg
mime.define({
  'image/jpeg': ['jpg'],
  'image/jpg': ['jpg']
});

app.get('/:url/:width/:height/:justCrop?', function (req, res, next) {

    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
    res.setHeader("Cache-Control", "max-age=300");
  var width = req.params.width
    , height = req.params.height
    , retrieve = function (remote) {
      // @see http://nodejs.org/api/url.html#url_url
      var parts = url.parse(remote);<commit_msg>Assume http: for scheme-less URIs<commit_after>// @see https://devcenter.heroku.com/articles/nodejs#write-your-app

var express = require('express')
  , fs      = require('fs') // node
  , path    = require('path') //node
  , gm      = require('gm')
  , http    = require('http') // node
  , https   = require('https') // node
  , mime    = require('mime') // express
  , url     = require('url') // node
  , md5     = require('MD5')
  , glob    = require('glob')
  // @see http://aaronheckmann.posterous.com/graphicsmagick-on-heroku-with-nodejs
  , imageMagick = gm.subClass({imageMagick: true})
  , app = express.createServer(express.logger())
  , mimeTypes = [
    'image/jpeg',
    'image/png',
    'image/gif',
    'image/jpg'
  ];

app.get('/crossdomain.xml', function(req, res, next){
    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
    res.setHeader("Content-Type", "text/xml");
    var filePath = path.join(__dirname, "crossdomain.xml");
    var stream = fs.createReadStream(filePath);
    stream.pipe(res);
});

// Set default file extension for image/jpg
mime.define({
  'image/jpeg': ['jpg'],
  'image/jpg': ['jpg']
});

app.get('/:url/:width/:height/:justCrop?', function (req, res, next) {

    res.setHeader("Access-Control-Allow-Origin", "*");
    res.setHeader("Access-Control-Allow-Headers", "X-Requested-With");
    res.setHeader("Cache-Control", "max-age=300");
  var width = req.params.width
    , height = req.params.height
    , retrieve = function (remote) {
      // @see http://nodejs.org/api/url.html#url_url
      if (remote.substring(0, 2) === '//') {
        remote = 'http:' + remote;
      }

      var parts = url.parse(remote);
{'fraction_non_alphanumeric': 0.19620065301276343, 'fraction_numerical': 0.003561887800534283, 'mean_word_length': 3.191542288557214, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '1473525', 'n_tokens_mistral': 1163, 'n_tokens_neox': 1148, 'n_words': 195}