<commit_before>var waterfall = require('async-waterfall'), jsdom = require("jsdom").jsdom, serializeDocument = require("jsdom").serializeDocument; 
module.exports = {

    convertEquation: function(options, equation, host, done) {
        ConversionService.convert(options, function(data) {
            if (typeof(data.errors) == 'undefined') {
                //clean up any old components.
                Component.destroy({equation:equation.id}).exec(function(err, components) {
                    if (err) return done(err);
                    //Save all components.
                    if (options.mml) EquationService.createComponent("mml", data.mml, equation.id);
                    if (options.svg) EquationService.createComponent("svg", data.svg, equation.id);
                    if (options.png) {
                        var pngSource = "<img src=\"" + data.png + "\" alt=\"" + data.speakText + "\" />";
                        EquationService.createComponent("png", pngSource, equation.id);
                    } 
                    if (options.speakText) EquationService.createComponent("description", data.speakText, equation.id);
                    //Look up equation so that we have all created info.
                    Equation.findOne(equation.id).populate('components').exec(function(err, newEquation) {
                        newEquation.cloudUrl = "http://" + host + "/equation/" + equation.id;
                        return done(null, newEquation);
                    });
                });
                
            } else {
                console.log(data.errors);
                return done(data.errors);
            }
        });
    },<commit_msg>All of our calls are https now.<commit_after>var waterfall = require('async-waterfall'), jsdom = require("jsdom").jsdom, serializeDocument = require("jsdom").serializeDocument; 
module.exports = {

    convertEquation: function(options, equation, host, done) {
        ConversionService.convert(options, function(data) {
            if (typeof(data.errors) == 'undefined') {
                //clean up any old components.
                Component.destroy({equation:equation.id}).exec(function(err, components) {
                    if (err) return done(err);
                    //Save all components.
                    if (options.mml) EquationService.createComponent("mml", data.mml, equation.id);
                    if (options.svg) EquationService.createComponent("svg", data.svg, equation.id);
                    if (options.png) {
                        var pngSource = "<img src=\"" + data.png + "\" alt=\"" + data.speakText + "\" />";
                        EquationService.createComponent("png", pngSource, equation.id);
                    } 
                    if (options.speakText) EquationService.createComponent("description", data.speakText, equation.id);
                    //Look up equation so that we have all created info.
                    Equation.findOne(equation.id).populate('components').exec(function(err, newEquation) {
                        newEquation.cloudUrl = "https://" + host + "/equation/" + equation.id;
                        return done(null, newEquation);
                    });
                });
                
            } else {
                console.log(data.errors);
                return done(data.errors);
            }
        });
    },
{'fraction_non_alphanumeric': 0.12680200058840835, 'fraction_numerical': 0.0, 'mean_word_length': 1.711323763955343, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '4647979', 'n_tokens_mistral': 865, 'n_tokens_neox': 800, 'n_words': 172}