<commit_before>if (!glower) throw new Error('glower base library required');

(function(lib) {
    function glower(map, tj, options) {

        options = options || {};

        var MM = com.modestmaps,
            waxGM = wax.GridManager(tj),
            eventoffset = wax.util.eventoffset,
            addEvent = MM.addEvent,
            removeEvent = MM.removeEvent,
            g = {},
            hovertiles = map.parent.appendChild(document.createElement('div')),
            _af, // active feature
            to_antialias, // anti-alias timeout
            to_fulltiles, // anti-alias timeout
            _cssText,
            fillStyle,
            aliasStyle,
            _downLock = false,
            tileGrid, c, ctx;

        hovertiles.style.cssText = 'position:absolute;top:0;left:0;';

        function getTileGrid() {
            var zoomLayer = map.createOrGetLayer(Math.round(map.getZoom()));
            var mo = wax.util.offset(map.parent);
            return tileGrid || (tileGrid =
                (function(t) {
                    var o = [];
                    for (var key in t) {
                        if (t[key].parentNode === zoomLayer) {
                            var offset = wax.util.offset(t[key]);
                            var mapoffset = {
                                left: offset.left - mo.left,
                                top: offset.top - mo.top
                            };
                            o.push([offset.top, offset.left, t[key], mapoffset]);
                        }
                    }
                    return o;
                })(map.tiles));
        }

        // When the map moves, the tile grid is no longer valid.
        function clearTileGrid(map, e) {
            tileGrid = null;
            _af = null;
            hovertiles.innerHTML = '';
        }

        function getTile(e) {
            for (var i = 0, grid = getTileGrid(); i < grid.length; i++) {
                if ((grid[i][0] < e.y) &&
                   ((grid[i][0] + 256) > e.y) &&
                    (grid[i][1] < e.x) &&
                   ((grid[i][1] + 256) > e.x)) {
                    return grid[i];
                }
            }
            return false;
        }

        function drawFullTiles(key, drawnTile) {
            hovertiles.innerHTML = '';
            for (var i = 0, tiles = getTileGrid(); i < tiles.length; i++) {
                waxGM.getGrid(tiles[i][2].src, (function(tile) {
                    return function(err, g) {
                        if (err || !g.grid_tile()) return;
                        var keyIndex = wax.util.indexOf(g.grid_tile().keys, key);
                        if (keyIndex !== -1) {
                            var ch = String.fromCharCode(lib.indexToChar(keyIndex));

                            lib.drawTile({
                                tile: tile,
                                ch: ch,
                                grid: g,
                                container: hovertiles,
                                fillStyle: fillStyle
                            });
                        }
                    };
                })(tiles[i]));
            }
        }

        function onDown() {
            _downLock = true;
        }

        function onUp() {
            _downLock = false;
        }

        function onMove(e) {
            if (_downLock) return;<commit_msg>IE I hate you<commit_after>if (!glower) throw new Error('glower base library required');

(function(lib) {
    function glower(map, tj, options) {

        options = options || {};

        var MM = com.modestmaps,
            waxGM = wax.GridManager(tj),
            eventoffset = wax.util.eventoffset,
            addEvent = MM.addEvent,
            removeEvent = MM.removeEvent,
            g = {},
            hovertiles = map.parent.appendChild(document.createElement('div')),
            _af, // active feature
            to_antialias, // anti-alias timeout
            to_fulltiles, // anti-alias timeout
            _cssText,
            fillStyle,
            aliasStyle,
            _downLock = false,
            tileGrid, c, ctx;

        hovertiles.style.cssText = 'position:absolute;top:0;left:0;';

        function getTileGrid() {
            var zoomLayer = map.createOrGetLayer(Math.round(map.getZoom()));
            var mo = wax.util.offset(map.parent);
            return tileGrid || (tileGrid =
                (function(t) {
                    var o = [];
                    for (var key in t) {
                        if (t[key].parentNode === zoomLayer) {
                            var offset = wax.util.offset(t[key]);
                            var mapoffset = {
                                left: offset.left - mo.left,
                                top: offset.top - mo.top
                            };
                            o.push([offset.top, offset.left, t[key], mapoffset]);
                        }
                    }
                    return o;
                })(map.tiles));
        }

        // When the map moves, the tile grid is no longer valid.
        function clearTileGrid(map, e) {
            tileGrid = null;
            _af = null;
            hovertiles.innerHTML = '';
        }

        function getTile(e) {
            for (var i = 0, grid = getTileGrid(); i < grid.length; i++) {
                if ((grid[i][0] < e.y) &&
                   ((grid[i][0] + 256) > e.y) &&
                    (grid[i][1] < e.x) &&
                   ((grid[i][1] + 256) > e.x)) {
                    return grid[i];
                }
            }
            return false;
        }

        function drawFullTiles(key, drawnTile) {
            hovertiles.innerHTML = '';
            for (var i = 0, tiles = getTileGrid(); i < tiles.length; i++) {
                waxGM.getGrid(tiles[i][2].src, (function(tile) {
                    return function(err, g) {
                        if (err || !g.grid_tile()) {
                          alert('early exit');
                          return;
                        }
                        var keyIndex = wax.util.indexOf(g.grid_tile().keys, key);
                        if (keyIndex !== -1) {
                            var ch = String.fromCharCode(lib.indexToChar(keyIndex));

                            lib.drawTile({
                                tile: tile,
                                ch: ch,
                                grid: g,
                                container: hovertiles,
                                fillStyle: fillStyle
                            });
                        }
                    };
                })(tiles[i]));
            }
        }

        function onDown() {
            _downLock = true;
        }

        function onUp() {
            _downLock = false;
        }

        function onMove(e) {
            if (_downLock) return;
{'fraction_non_alphanumeric': 0.11339014877943088, 'fraction_numerical': 0.004622273580817565, 'mean_word_length': 0.9919447640966629, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 7, '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': '3575892', 'n_tokens_mistral': 1851, 'n_tokens_neox': 1747, 'n_words': 384}