<commit_before>iD.Map = function() {
    var connection, history,
        dimensions = [],
        dispatch = d3.dispatch('move'),
        inspector = iD.Inspector(),
        selection = null,
        translateStart,
        keybinding,
        apiTilesLoaded = {},
        projection = d3.geo.mercator(),
        zoom = d3.behavior.zoom()
            .translate(projection.translate())
            .scale(projection.scale())
            .scaleExtent([1024, 256 * Math.pow(2, 24)])
            .on('zoom', zoomPan),
        dblclickEnabled = true,
        dragEnabled = true,
        dragging,
        dragbehavior = d3.behavior.drag()
            .origin(function(entity) {
                if (!dragEnabled) return { x: 0, y: 0 };
                if (entity.accuracy) {
                    var index = entity.index, wayid = entity.way;
                    entity = iD.Node(entity);
                    var connectedWay = history.graph().entity(wayid);
                    connectedWay.nodes.splice(index, 0, entity.id);
                    map.perform(iD.actions.addWayNode(connectedWay, entity));
                }
                var p = projection(ll2a(entity));
                return { x: p[0], y: p[1] };
            })
            .on('drag', function(entity) {
                d3.event.sourceEvent.stopPropagation();

                if (!dragging) {
                    dragging = iD.util.trueObj([entity.id].concat(
                        _.pluck(history.graph().parents(entity.id), 'id')));
                    history.perform(iD.actions.noop());
                }

                var to = projection.invert([d3.event.x, d3.event.y]);
                history.replace(iD.actions.move(entity, to));

                redraw();
            })
            .on('dragend', function () {
                if (!dragEnabled || !dragging) return;
                dragging = undefined;
                redraw();
            }),
        waydragbehavior = d3.behavior.drag()
            .origin(function(entity) {
                var p = projection(ll2a(entity.nodes[0]));
                return { x: p[0], y: p[1] };
            })
            .on('drag', function(entity) {
                console.log(dragEnabled);
                if (!dragEnabled) return;<commit_msg>Don't change graph in origin()<commit_after>iD.Map = function() {
    var connection, history,
        dimensions = [],
        dispatch = d3.dispatch('move'),
        inspector = iD.Inspector(),
        selection = null,
        translateStart,
        keybinding,
        apiTilesLoaded = {},
        projection = d3.geo.mercator(),
        zoom = d3.behavior.zoom()
            .translate(projection.translate())
            .scale(projection.scale())
            .scaleExtent([1024, 256 * Math.pow(2, 24)])
            .on('zoom', zoomPan),
        dblclickEnabled = true,
        dragEnabled = true,
        dragging,
        dragbehavior = d3.behavior.drag()
            .origin(function(entity) {
                if (!dragEnabled) return { x: 0, y: 0 };
                var p = projection(ll2a(entity));
                return { x: p[0], y: p[1] };
            })
            .on('drag', function(entity) {
                d3.event.sourceEvent.stopPropagation();

                if (!dragging) {
                    if (entity.accuracy) {
                        var index = entity.index, wayid = entity.way;
                        entity = iD.Node(entity);
                        var connectedWay = history.graph().entity(wayid);
                        connectedWay.nodes.splice(index, 0, entity.id);
                        history.perform(iD.actions.addWayNode(connectedWay, entity));
                    }

                    dragging = iD.util.trueObj([entity.id].concat(
                        _.pluck(history.graph().parents(entity.id), 'id')));
                    history.perform(iD.actions.noop());
                }

                var to = projection.invert([d3.event.x, d3.event.y]);
                history.replace(iD.actions.move(entity, to));

                redraw();
            })
            .on('dragend', function () {
                if (!dragEnabled || !dragging) return;
                dragging = undefined;
                redraw();
            }),
        waydragbehavior = d3.behavior.drag()
            .origin(function(entity) {
                var p = projection(ll2a(entity.nodes[0]));
                return { x: p[0], y: p[1] };
            })
            .on('drag', function(entity) {
                console.log(dragEnabled);
                if (!dragEnabled) return;
{'fraction_non_alphanumeric': 0.13398692810457516, 'fraction_numerical': 0.012200435729847494, 'mean_word_length': 1.3961377870563674, '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': '6679469', 'n_tokens_mistral': 1311, 'n_tokens_neox': 1213, 'n_words': 223}