<commit_before>/**
 * @fileoverview Core PHP Social functions
 * @author <NAME> <<EMAIL>>
 */

/**
 * Following section taken from Google's social media tracking documentation
 * A simple script to automatically track Facebook and Twitter
 * buttons using Google Analytics social tracking feature.
 *
 * @author <EMAIL> (<NAME>)
 * Copyright 2011 Google Inc. All Rights Reserved.
 */

/**
 * Namespace.
 * @type {Object}.
 */
var _ga = _ga || {};

/**
 * Ensure global _gaq Google Analytics queue has been initialized.
 * @type {Array}
 */
var _gaq = _gaq || [];

/**
 * Returns the normalized tracker name configuration parameter.
 * @param {string} opt_trackerName An optional name for the tracker object.
 * @return {string} If opt_trackerName is set, then the value appended with
 *     a . Otherwise an empty string.
 * @private
 */
_ga.buildTrackerName_ = function(opt_trackerName) {
  return opt_trackerName ? opt_trackerName + '.' : '';
};

/**
 * Extracts a query parameter value from a URI.
 * @param {string} uri The URI from which to extract the parameter.
 * @param {string} paramName The name of the query paramater to extract.
 * @return {string} The un-encoded value of the query paramater. underfined
 *     if there is no URI parameter.
 * @private
 */
_ga.extractParamFromUri_ = function(uri, paramName) {
    if (!uri) {
        return;
    }
    var uri = uri.split('#')[0];  // Remove anchor.
    var parts = uri.split('?');  // Check for query params.
    if (parts.length == 1) {
        return;
    }
    var query = decodeURI(parts[1]);

    // Find url param.
    paramName += '=';
    var params = query.split('&');
    for (var i = 0, param; param = params[i]; ++i) {
      if (param.indexOf(paramName) === 0) {
        return unescape(param.split('=')[1]);
      }
    }
    return;
};

/**
 * PHP Socializer functions
 */

/**
 * @type {Array} List of social objects to be loaded when the document is ready
 */
_socialQueue = [];

(function(w, d) {

    /**
     * Begin loading social assets
     */
    var go = function() {

        var f = {
            /**
             * Simple fade in effect
             * @param  {Array} elements An array of elements to fade in
             * @param  {Integer} time Total animation time
             */
            fadeIn: function(elements, time) {
                var startOpacity = 0, steps = 1 / 0.02;
                var step = function step(element) {
                    element.style.opacity = +(element.style.opacity) + 0.02;

                    // for IE
                    element.style.filter = 'alpha(opacity=' + element.style.opacity * 100 + ')';

                    if(element.style.opacity < 1) {
                        window.setTimeout(function() { step(element); }, time / steps);
                    }
                };
                for (var i = 0; i < elements.length; i++) {
                    step(elements[i]);
                }
            },
            iframeOnload: function(fr, b, d) {
                fr.onload = function() {
                    f.fadeIn([b], d);
                };
                var src = fr.src;
                fr.src = '';
                fr.src = src;
            },
            awaitRenderButton: function(b, r, d, m) {
                if (!r(b)) { // Button not rendered yet, wait
                    window.setTimeout(function() {
                        f.awaitRenderButton(b, r, d, m);
                    }, 100);
                    return;
                }
                // Button rendered
                if (typeof m !== 'undefined') { // An alternative rendered function was provided
                    m(b, d);
                } else { // Fade in
                    f.fadeIn([b], d);
                }<commit_msg>Updated fadeIn function to use CSS3 transitions instead of javascript animations if available.<commit_after>/**
 * @fileoverview Core PHP Social functions
 * @author <NAME> <<EMAIL>>
 */

/**
 * Following section taken from Google's social media tracking documentation
 * A simple script to automatically track Facebook and Twitter
 * buttons using Google Analytics social tracking feature.
 *
 * @author <EMAIL> (<NAME>)
 * Copyright 2011 Google Inc. All Rights Reserved.
 */

/**
 * Namespace.
 * @type {Object}.
 */
var _ga = _ga || {};

/**
 * Ensure global _gaq Google Analytics queue has been initialized.
 * @type {Array}
 */
var _gaq = _gaq || [];

/**
 * Returns the normalized tracker name configuration parameter.
 * @param {string} opt_trackerName An optional name for the tracker object.
 * @return {string} If opt_trackerName is set, then the value appended with
 *     a . Otherwise an empty string.
 * @private
 */
_ga.buildTrackerName_ = function(opt_trackerName) {
  return opt_trackerName ? opt_trackerName + '.' : '';
};

/**
 * Extracts a query parameter value from a URI.
 * @param {string} uri The URI from which to extract the parameter.
 * @param {string} paramName The name of the query paramater to extract.
 * @return {string} The un-encoded value of the query paramater. underfined
 *     if there is no URI parameter.
 * @private
 */
_ga.extractParamFromUri_ = function(uri, paramName) {
    if (!uri) {
        return;
    }
    var uri = uri.split('#')[0];  // Remove anchor.
    var parts = uri.split('?');  // Check for query params.
    if (parts.length == 1) {
        return;
    }
    var query = decodeURI(parts[1]);

    // Find url param.
    paramName += '=';
    var params = query.split('&');
    for (var i = 0, param; param = params[i]; ++i) {
      if (param.indexOf(paramName) === 0) {
        return unescape(param.split('=')[1]);
      }
    }
    return;
};

/**
 * PHP Socializer functions
 */

/**
 * @type {Array} List of social objects to be loaded when the document is ready
 */
_socialQueue = [];

(function(w, d) {

    /**
     * Begin loading social assets
     */
    var go = function() {

        var f = {
            /**
             * Simple fade in effect
             * @param  {Array} elements An array of elements to fade in
             * @param  {Integer} time Total animation time
             */
            fadeIn: function(elements, time) {
                // If the browser supports CSS transitions, use them
                var transition = false,
                    transitionNames = ['MozTransition', 'webkitTransition', 'OTransition'];
                for (var i = 0; i < transitionNames.length; i++) {
                    if (typeof elements[0].style[transitionNames[i]] !== 'undefined') {
                        transition = transitionNames[i];
                        break;
                    }
                }

                for (i = 0; i < elements.length; i++) {
                    if (transition) {
                        elements[i].style[transition] = 'opacity ' + time + 'ms ease-in-out';
                        elements[i].style.opacity = 1;
                    } else {
                        var startOpacity = 0, steps = 1 / 0.02;
                        (function step(element) {
                            element.style.opacity = +(element.style.opacity) + 0.02;

                            // for IE
                            element.style.filter = 'alpha(opacity=' + element.style.opacity * 100 + ')';

                            if(element.style.opacity < 1) {
                                window.setTimeout(function() { step(element); }, time / steps);
                            }
                        })(elements[i]);
                    }
                }
            },
            iframeOnload: function(fr, b, d) {
                fr.onload = function() {
                    f.fadeIn([b], d);
                };
                var src = fr.src;
                fr.src = '';
                fr.src = src;
            },
            awaitRenderButton: function(b, r, d, m) {
                if (!r(b)) { // Button not rendered yet, wait
                    window.setTimeout(function() {
                        f.awaitRenderButton(b, r, d, m);
                    }, 100);
                    return;
                }
                // Button rendered
                if (typeof m !== 'undefined') { // An alternative rendered function was provided
                    m(b, d);
                } else { // Fade in
                    f.fadeIn([b], d);
                }
{'fraction_non_alphanumeric': 0.12220762155059132, 'fraction_numerical': 0.006689762274519173, 'mean_word_length': 1.6, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2087929', 'n_tokens_mistral': 2340, 'n_tokens_neox': 2190, 'n_words': 714}