<commit_before>import RBush from 'rbush';

import { dispatch as d3_dispatch } from 'd3-dispatch';
import { json as d3_json } from 'd3-fetch';

import { geoExtent, geoVecAdd, geoVecScale } from '../geo';
import { qaError } from '../osm';
import { serviceOsm } from './index';
import { t } from '../util/locale';
import { utilRebind, utilTiler, utilQsString } from '../util';


var tiler = utilTiler();
var dispatch = d3_dispatch('loaded');

var _erCache;
var _erZoom = 14;

var _impOsmUrls = {
    ow: 'https://directionofflow.skobbler.net/directionOfFlowService',
    mr: 'https://missingroads.skobbler.net/missingGeoService',
    tr: 'https://turnrestrictionservice.skobbler.net/turnRestrictionService'
};

function abortRequest(i) {
    Object.values(i).forEach(function(controller) {
        if (controller) {
            controller.abort();
        }
    });
}

function abortUnwantedRequests(cache, tiles) {
    Object.keys(cache.inflightTile).forEach(function(k) {
        var wanted = tiles.find(function(tile) { return k === tile.id; });
        if (!wanted) {
            abortRequest(cache.inflightTile[k]);
            delete cache.inflightTile[k];
        }
    });
}


function encodeErrorRtree(d) {<commit_msg>Update ImproveOSM overlay endpoints for transition to Grab (close #7110)<commit_after>import RBush from 'rbush';

import { dispatch as d3_dispatch } from 'd3-dispatch';
import { json as d3_json } from 'd3-fetch';

import { geoExtent, geoVecAdd, geoVecScale } from '../geo';
import { qaError } from '../osm';
import { serviceOsm } from './index';
import { t } from '../util/locale';
import { utilRebind, utilTiler, utilQsString } from '../util';


var tiler = utilTiler();
var dispatch = d3_dispatch('loaded');

var _erCache;
var _erZoom = 14;

var _impOsmUrls = {
    ow: 'https://grab.community.improve-osm.org/directionOfFlowService',
    mr: 'https://grab.community.improve-osm.org/missingGeoService',
    tr: 'https://grab.community.improve-osm.org/turnRestrictionService'
};

function abortRequest(i) {
    Object.values(i).forEach(function(controller) {
        if (controller) {
            controller.abort();
        }
    });
}

function abortUnwantedRequests(cache, tiles) {
    Object.keys(cache.inflightTile).forEach(function(k) {
        var wanted = tiles.find(function(tile) { return k === tile.id; });
        if (!wanted) {
            abortRequest(cache.inflightTile[k]);
            delete cache.inflightTile[k];
        }
    });
}


function encodeErrorRtree(d) {
{'fraction_non_alphanumeric': 0.1470705460342766, 'fraction_numerical': 0.007174172977281785, 'mean_word_length': 3.450354609929078, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '1982298', 'n_tokens_mistral': 842, 'n_tokens_neox': 805, 'n_words': 173}