<commit_before>define(['jquery', 'underscore', 'queue'], function($, _, queue) {

    $.fn.canvid = function(_opts) {
        var el = $(this),
            images = {},
            firstPlay = true,
            control = {
                play: function() { console.log('cannot play before images are loaded'); }
            };

        _opts = $.extend(el.data(), _opts || {});

        if (hasCanvas()) {  
            // preload videos images
            var q = queue(4);

            _.each(_opts.videos, function(video, key) {
                q.defer(loadImage, key, video.src);
            });

            q.awaitAll(function(err) {
                if (err) return console.warn('error while loading video sources', err);
                
                var ctx = initCanvas(),
                    requestAnimationFrame = reqAnimFrame();

                control.play = function(key, reverse) {
                    if (control.pause) control.pause(); // pause current vid

                    var img = images[key],
                        opts = _opts.videos[key];

                    var curFrame = reverse ? opts.frames-1 : 0,
                        wait = 0,
                        playing = true,
                        loops = 0,
                        delay = 4;

                    requestAnimationFrame(frame);

                    control.resume = function() {
                        playing = true;<commit_msg>drop underscore dependency<commit_after>define(['jquery', 'queue'], function($, queue) {

    $.fn.canvid = function(_opts) {
        var el = $(this),
            images = {},
            firstPlay = true,
            control = {
                play: function() { console.log('cannot play before images are loaded'); }
            };

        _opts = $.extend(el.data(), _opts || {});

        if (hasCanvas()) {  
            // preload videos images
            var q = queue(4);
            
            for(var key in _opts.videos){
                var video = _opts.videos[key];
                q.defer(loadImage, key, video.src);
            });

            q.awaitAll(function(err) {
                if (err) return console.warn('error while loading video sources', err);
                
                var ctx = initCanvas(),
                    requestAnimationFrame = reqAnimFrame();

                control.play = function(key, reverse) {
                    if (control.pause) control.pause(); // pause current vid

                    var img = images[key],
                        opts = _opts.videos[key];

                    var curFrame = reverse ? opts.frames-1 : 0,
                        wait = 0,
                        playing = true,
                        loops = 0,
                        delay = 4;

                    requestAnimationFrame(frame);

                    control.resume = function() {
                        playing = true;
{'fraction_non_alphanumeric': 0.11362856162032269, 'fraction_numerical': 0.004119464469618949, 'mean_word_length': 1.1697691734921818, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1480661', 'n_tokens_mistral': 734, 'n_tokens_neox': 668, 'n_words': 176}