<commit_before>"use strict";

var React = require('react');

var Gist = React.createClass({
    propTypes: {
        id: React.PropTypes.string.isRequired
    },

    shouldComponentUpdate: function(nextProps) {
        return this.props.id !== nextProps.id;
    },

    componentDidMount: function() {
        this._updateIframeContent();
    },
    componentDidUpdate: function(prevProps, prevState) {
        this._updateIframeContent();
    },

    _updateIframeContent: function() {
        var iframe = this.refs.iframe.getDOMNode();

        var doc = iframe.document;
        if (iframe.contentDocument) doc = iframe.contentDocument;
        else if (iframe.contentWindow) doc = iframe.contentWindow.document;

        var gistScript = '<script type="text/javascript" src="https://gist.github.com/' + this.props.id + '.js"></script>';
        var styles = '<style>*{font-size:12px;}</style>';
        var resizeScript = 'onload="parent.document.getElementById(\'gist-' + this.props.id + '\').style.height=document.body.scrollHeight + \'px\'"';
        var iframeHtml = '<html><head><base target="_parent">'+styles+'</head><body '+resizeScript+'>'+gistScript+'</body></html>';

        doc.open();
        doc.writeln(iframeHtml);
        doc.close();
    },

    render: function() {
        return React.DOM.iframe({
            ref: 'iframe',
            width: '100%',
            frameBorder: 0,
            id: "gist-" + this.props.id
        });
    }
});

module.exports = Gist;<commit_msg>replaced react.dom by react.createElement<commit_after>"use strict";

var React = require('react');

var Gist = React.createClass({
    propTypes: {
        id: React.PropTypes.string.isRequired
    },

    shouldComponentUpdate: function(nextProps) {
        return this.props.id !== nextProps.id;
    },

    componentDidMount: function() {
        this._updateIframeContent();
    },
    componentDidUpdate: function(prevProps, prevState) {
        this._updateIframeContent();
    },

    _updateIframeContent: function() {
        var iframe = this.refs.iframe.getDOMNode();

        var doc = iframe.document;
        if (iframe.contentDocument) doc = iframe.contentDocument;
        else if (iframe.contentWindow) doc = iframe.contentWindow.document;

        var gistScript = '<script type="text/javascript" src="https://gist.github.com/' + this.props.id + '.js"></script>';
        var styles = '<style>*{font-size:12px;}</style>';
        var resizeScript = 'onload="parent.document.getElementById(\'gist-' + this.props.id + '\').style.height=document.body.scrollHeight + \'px\'"';
        var iframeHtml = '<html><head><base target="_parent">'+styles+'</head><body '+resizeScript+'>'+gistScript+'</body></html>';

        doc.open();
        doc.writeln(iframeHtml);
        doc.close();
    },

    render: function() {
        return React.createElement('iframe', {
            ref: 'iframe',
            width: '100%',
            frameBorder: 0,
            id: "gist-" + this.props.id
        });
    }
});

module.exports = Gist;
{'fraction_non_alphanumeric': 0.16322517207472959, 'fraction_numerical': 0.003933136676499509, 'mean_word_length': 2.7219512195121953, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, 'https://': 2, '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': '6751515', 'n_tokens_mistral': 945, 'n_tokens_neox': 892, 'n_words': 160}