<commit_before>define(['ol'],

    function (ol) {
        var olu_source = new ol.source.Vector();
        var $scope;
        var $compile;
        var greenery = ["27", "19"];
        var last_position_loaded = null;
        var last_map_calculated = 0;
        var map;
        var utils;
        var direction_changed = false;
        var character;
        var view_sector = null;

        function entityClicked(entity) {
            $scope.showInfo(entity);
            if ($('#zone-info-dialog').length > 0) {
                angular.element('#zone-info-dialog').parent().remove();
            }
            var el = angular.element('<div hs.foodiezones.info-directive></div>');
            $("#hs-dialog-area").append(el);
            $compile(el)($scope);
        }

        olu_source.cesiumStyler = function (dataSource) {
            var entities = dataSource.entities.values;
            for (var i = 0; i < entities.length; i++) {
                var entity = entities[i];
                if (entity.styled) continue;
                var name = entity.properties.label;
                var s = entity.properties.use.getValue();
                entity.polygon.outline = false;
                if (greenery.indexOf(s) > -1)
                    entity.polygon.material = Cesium.Color.GREEN.withAlpha(0.4);
                else
                    switch (s) {
                        case "17":
                            entity.polygon.material = Cesium.Color.WHITE.withAlpha(0.2);
                            break;
                        case "10":
                            entity.polygon.material = Cesium.Color.BLUE.withAlpha(0.4);
                            break;
                        case "13":
                            entity.polygon.material = new Cesium.Color(1, 162 / 255, 140 / 255, 1);
                            var cbp = new Cesium.CallbackProperty(function () {
                                return this.entity.properties.height || 0
                            }, false);
                            var cbpex = new Cesium.CallbackProperty(function () {
                                return (this.entity.properties.height || 0) + 5.0
                            }, false);
                            entity.polygon.extrudedHeight = cbpex;
                            cbp.entity = entity;
                            cbpex.entity = entity;
                            entity.polygon.height = cbp;
                            var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions;
                            var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center;
                            polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter);
                            entity.position = polyCenter;
                            var cartoPos = Cesium.Cartographic.fromCartesian(polyCenter);
                            cartoPos.entity = entity;
                            var promise = Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [
                                cartoPos
                            ]);
                            Cesium.when(promise, function (updatedPositions) {
                                updatedPositions[0].entity.properties.height = updatedPositions[0].height;
                            });
                            break;
                        default:
                            entity.polygon.material = new Cesium.Color(1, 1, 1, 0.09);

                    }
                entity.styled = true;
                //entity.onclick = entityClicked
            }
        }

        function createViewSector(pnts) {
            if (view_sector != null)
                viewer.scene.primitives.remove(view_sector);
            var rectangleInstance = new Cesium.GeometryInstance({
                geometry: new Cesium.PolygonGeometry({
                    polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(pnts))
                }),
                attributes: {
                    color: new Cesium.ColorGeometryInstanceAttribute(0.0, .6, .8, 0.3)
                }
            });
            view_sector = viewer.scene.primitives.add(new Cesium.GroundPrimitive({<commit_msg>Rogaining game. Use isConstant flag in olu polygon callback properties<commit_after>define(['ol'],

    function (ol) {
        var olu_source = new ol.source.Vector();
        var $scope;
        var $compile;
        var greenery = ["27", "19"];
        var last_position_loaded = null;
        var last_map_calculated = 0;
        var map;
        var utils;
        var direction_changed = false;
        var character;
        var view_sector = null;

        function entityClicked(entity) {
            $scope.showInfo(entity);
            if ($('#zone-info-dialog').length > 0) {
                angular.element('#zone-info-dialog').parent().remove();
            }
            var el = angular.element('<div hs.foodiezones.info-directive></div>');
            $("#hs-dialog-area").append(el);
            $compile(el)($scope);
        }

        olu_source.cesiumStyler = function (dataSource) {
            var entities = dataSource.entities.values;
            for (var i = 0; i < entities.length; i++) {
                var entity = entities[i];
                if (entity.styled) continue;
                var name = entity.properties.label;
                var s = entity.properties.use.getValue();
                entity.polygon.outline = false;
                if (greenery.indexOf(s) > -1)
                    entity.polygon.material = Cesium.Color.GREEN.withAlpha(0.4);
                else
                    switch (s) {
                        case "17":
                            entity.polygon.material = Cesium.Color.WHITE.withAlpha(0.2);
                            break;
                        case "10":
                            entity.polygon.material = Cesium.Color.BLUE.withAlpha(0.4);
                            break;
                        case "13":
                            entity.polygon.material = new Cesium.Color(1, 162 / 255, 140 / 255, 1);
                            function fillHeight() {
                                return this.entity.properties.height || 0
                            }
                            var cbp = new Cesium.CallbackProperty(fillHeight, false);
                            function fillExtrudedHeight() {
                                return (this.entity.properties.height || 0) + 5.0
                            }
                            var cbpex = new Cesium.CallbackProperty(fillExtrudedHeight, false);
                            entity.polygon.extrudedHeight = cbpex;
                            cbp.entity = entity;
                            cbpex.entity = entity;
                            entity.polygon.height = cbp;
                            var polyPositions = entity.polygon.hierarchy.getValue(Cesium.JulianDate.now()).positions;
                            var polyCenter = Cesium.BoundingSphere.fromPoints(polyPositions).center;
                            polyCenter = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(polyCenter);
                            entity.position = polyCenter;
                            var cartoPos = Cesium.Cartographic.fromCartesian(polyCenter);
                            cartoPos.entity = entity;
                            var promise = Cesium.sampleTerrainMostDetailed(viewer.terrainProvider, [
                                cartoPos
                            ]);
                            Cesium.when(promise, function (updatedPositions) {
                                updatedPositions[0].entity.properties.height = updatedPositions[0].height;
                                updatedPositions[0].entity.polygon.extrudedHeight.setCallback(fillExtrudedHeight, true);
                                updatedPositions[0].entity.polygon.height.setCallback(fillHeight, true);
                            });
                            break;
                        default:
                            entity.polygon.material = new Cesium.Color(1, 1, 1, 0.09);

                    }
                entity.styled = true;
                //entity.onclick = entityClicked
            }
        }

        function createViewSector(pnts) {
            if (view_sector != null)
                viewer.scene.primitives.remove(view_sector);
            var rectangleInstance = new Cesium.GeometryInstance({
                geometry: new Cesium.PolygonGeometry({
                    polygonHierarchy: new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(pnts))
                }),
                attributes: {
                    color: new Cesium.ColorGeometryInstanceAttribute(0.0, .6, .8, 0.3)
                }
            });
            view_sector = viewer.scene.primitives.add(new Cesium.GroundPrimitive({
{'fraction_non_alphanumeric': 0.09452070081464123, 'fraction_numerical': 0.012498605066398839, 'mean_word_length': 1.2321295143212951, 'pattern_counts': {'":': 6, '<': 9, '<?xml version=': 0, '>': 11, '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': '6316732', 'n_tokens_mistral': 2333, 'n_tokens_neox': 2161, 'n_words': 392}