<commit_before>define(['eventmanager'], function (eventmanager) {
    function s4() {
        return Math.floor((1 + Math.random()) * 0x10000)
            .toString(16)
            .substring(1);
    };

    function guid() {
        return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
            s4() + '-' + s4() + s4() + s4();
    }

    function isoToTwoD(posX, posY) {
        var newCoordinates = {};
        newCoordinates.x = (posY + posX);
        newCoordinates.y = (posY - posX);
        return newCoordinates;
    };

    function twoDToIso(posX, posY) {
        var newCoordinates = {};
        newCoordinates.x = (posX - posY) / 2;
        newCoordinates.y = (posX + posY) / 2;
        return newCoordinates;
    }

    function worldPosToGridPos(config) {
        config = _.cloneDeep(config);
        config.x = config.x - (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        // Add correction for the centering of the map
        var x = (config.x/ (app.config.actor.tile.width / 2) + config.y / (app.config.actor.tile.height / 2)) / 2;
        var y = (config.y/ (app.config.actor.tile.height / 2) - (config.x / (app.config.actor.tile.width / 2))) / 2;
        x = Math.floor(x);
        y = Math.floor(y);
        return ({x:x,y:y});
    }

    function worldPosToIsoPos(config){
        var gridCoordinates = worldPosToGridPos(config);
        return twoDToIso(gridCoordinates.x, gridCoordinates.y);
    }
    function gridPosToWorldPos(config){
        var iso = twoDToIso(config.x, config.y);
        var y = iso.y * app.config.actor.tile.height;
        var x = iso.x * app.config.actor.tile.width + (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        return{
            x:x,
            y:y
        }
    }
    function checkWait(conditionFunction, resultFunction) {
        var tev = setInterval(function () {
            if (conditionFunction()) {
                resultFunction
                clearInterval(tev);
            }
        }, 1000);
    };
    function roundHalf(num) {
        num = Math.round(num * 2) / 2;
        return num;
    }

    return {
        guid: guid,
        isoToTwoD: isoToTwoD,
        twoDToIso: twoDToIso,
        worldPosToGridPos: worldPosToGridPos,
        worldPosToIsoPos: worldPosToIsoPos,
        gridPosToWorldPos: gridPosToWorldPos,
        checkWait: checkWait
    };
});<commit_msg>fix standard lib<commit_after>define(['eventmanager'], function (eventmanager) {
    function s4() {
        return Math.floor((1 + Math.random()) * 0x10000)
            .toString(16)
            .substring(1);
    }

    function guid() {
        return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
            s4() + '-' + s4() + s4() + s4();
    }

    function isoToTwoD(config) {
        var x = (config.x + config.y) / 2;
        var y = (config.y - (config.x)) / 2;
        return ({x:x,y:y});
    }

    function twoDToIso(config) {
        var newCoordinates = {};
        newCoordinates.x = (config.x - config.y) / 2;
        newCoordinates.y = (config.x + config.y) / 2;
        return newCoordinates;
    }

    function worldPosToGridPos(config) {
        config = _.cloneDeep(config);
        // Add correction for the centering of the map
        config.x = config.x - (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        var coords = isoToTwoD(config);
        coords.x = coords.x/(app.config.actor.car.width/2);
        coords.y = coords.y/(app.config.actor.car.height/2);
        coords.x = Math.floor(coords.x);
        coords.y = Math.floor(coords.y);
        return (coords);
    }
    function worldPosToIsoPos(config){
        var gridCoordinates = worldPosToGridPos(config);
        return twoDToIso({x: gridCoordinates.x, y:gridCoordinates.y});
    }
    function isoWorldPosToCarWorldPos(config){
        config = _.cloneDeep(config);
        config.x = config.x - (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        // Add correction for the centering of the map
        var coords = isoToTwoD(config);
        return (coords);
    }
    function carWorldPosToIsoWorldPos(config){
        config = _.cloneDeep(config);
        // Add correction for the centering of the map
        var x = config.y + config.x;
        var y = config.y - config.x;
        x = x + (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        return ({x:x,y:y});
    }

    function gridPosToWorldPos(config){
        var iso = twoDToIso({x: config.x, y:config.y});
        var y = iso.y * app.config.actor.tile.height;
        var x = iso.x * app.config.actor.tile.width + (app.config.actor.grid.width/2 * app.config.actor.tile.width);
        return{
            x:x,
            y:y
        }
    }
    function checkWait(conditionFunction, resultFunction) {
        var tev = setInterval(function () {
            if (conditionFunction()) {
                resultFunction
                clearInterval(tev);
            }
        }, 1000);
    }


    return {
        guid: guid,
        isoToTwoD: isoToTwoD,
        twoDToIso: twoDToIso,
        worldPosToGridPos: worldPosToGridPos,
        worldPosToIsoPos: worldPosToIsoPos,
        gridPosToWorldPos: gridPosToWorldPos,
        isoWorldPosToCarWorldPos: isoWorldPosToCarWorldPos,
        carWorldPosToIsoWorldPos: carWorldPosToIsoWorldPos,
        checkWait: checkWait
    };
});
{'fraction_non_alphanumeric': 0.13610235490450584, 'fraction_numerical': 0.012608937511589096, 'mean_word_length': 2.0, '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': '5621190', 'n_tokens_mistral': 1830, 'n_tokens_neox': 1760, 'n_words': 338}