<commit_before>angular.module('trips', ['uiGmapgoogle-maps'])

    .config(['uiGmapGoogleMapApiProvider',
        function (uiGmapGoogleMapApiProvider) {

            uiGmapGoogleMapApiProvider.configure({
                //key, hmm
                v: '3.20',
                libraries: 'weather,geometry,visualization'
            });

        }])

    .controller('TripsController', ['$scope', '$filter', 'uiGmapGoogleMapApi', 'TripsService', '$routeParams', 'TripDataShare', 'Utils',
        function ($scope, $filter, uiGmapGoogleMapApi, tripsService, $routeParams, tripDataShare, utils) {

            var tripsPreviewSize = 3;
            var tripsLoadingSize = 12;

            $scope.focusedTrip = $routeParams.id;
            tripDataShare.tripId = $routeParams.id;

            $scope.requestTrips = function () {
                tripsService.getTrips({offset: 0, limit: ($scope.public ? tripsPreviewSize + 1 : tripsPreviewSize), public: ($scope.public ? true : false)},
                    function (res) {
                        //res mocked for now
                        console.log(res);
                        //res = mockedTripsResponse;
                        $scope.preview = res.data;
                        $scope.trips = [];
                        $scope.photo = $filter('filter')(mockedPhotos, {
                            tripId: 1,//res.data[0].Id,
                            defaultBigThumbnail: true
                        }, true);
                    },
                    function (res) {
                        console.log(res);
                    }
                );
            };

            if ($scope.focusedTrip) {
                tripsService.getTrip($scope.focusedTrip,
                    function (res) {
                        $scope.trip = res;
                        if(res['RouteStatus'] == 1) {
                            utils.prepareMapForRoute($scope, res['Route']['points'], uiGmapGoogleMapApi, true);
                            uiGmapGoogleMapApi.then(function (maps) {
                                $scope.map =
                                {
                                    center: {
                                        latitude: 52,
                                        longitude: 20
                                    },
                                    zoom: 6,
                                    markers: $scope.markers
                                };
                            });
                            console.log("Trip has been loaded successfully");
                            console.log(res);
                        } else if(res['RouteStatus'] == 0) {
                            console.log("Trip routes formatting is in progress");
                            console.log(res);
                            $scope.tripFormattingStatus = "Trip routes formatting is in progress";
                        } else if(res['RouteStatus'] == 2) {
                            console.log("Trip data has invalid format, could not load");
                            console.log(res);
                            $scope.tripFormattingStatus = "Trip data has invalid format, could not load the map";
                        }
                    },
                    function (res) {
                        console.log(res);
                    }
                )
            }
            else {
                $scope.requestTrips();
            }

            $scope.public = false;

            $scope.togglePublic = function (status) {<commit_msg>Mala poprawka<commit_after>angular.module('trips', ['uiGmapgoogle-maps'])

    .config(['uiGmapGoogleMapApiProvider',
        function (uiGmapGoogleMapApiProvider) {

            uiGmapGoogleMapApiProvider.configure({
                //key, hmm
                v: '3.20',
                libraries: 'weather,geometry,visualization'
            });

        }])

    .controller('TripsController', ['$scope', '$filter', 'uiGmapGoogleMapApi', 'TripsService', '$routeParams', 'TripDataShare', 'Utils',
        function ($scope, $filter, uiGmapGoogleMapApi, tripsService, $routeParams, tripDataShare, utils) {

            var tripsPreviewSize = 3;
            var tripsLoadingSize = 12;

            $scope.focusedTrip = $routeParams.id;
            tripDataShare.tripId = $routeParams.id;

            $scope.requestTrips = function () {
                tripsService.getTrips({offset: 0, limit: ($scope.public ? tripsPreviewSize + 1 : tripsPreviewSize), public: ($scope.public ? true : false)},
                    function (res) {
                        //res mocked for now
                        console.log(res);
                        //res = mockedTripsResponse;
                        $scope.preview = res.data;
                        $scope.trips = [];
                        $scope.photo = $filter('filter')(mockedPhotos, {
                            tripId: 1,//res.data[0].Id,
                            defaultBigThumbnail: true
                        }, true);
                    },
                    function (res) {
                        console.log(res);
                    }
                );
            };

            if ($scope.focusedTrip) {
                tripsService.getTrip($scope.focusedTrip,
                    function (res) {
                        $scope.trip = res;
                        if(res['RouteStatus'] == 1) {
                            utils.prepareMapForRoute($scope, res['Route']['points'], uiGmapGoogleMapApi, true);
                            uiGmapGoogleMapApi.then(function (maps) {
                                $scope.map =
                                {
                                    center: {
                                        latitude: 52,
                                        longitude: 20
                                    },
                                    zoom: 6,
                                    markers: $scope.markers
                                };
                            });
                            console.log("Trip has been loaded successfully");
                            console.log(res);
                        } else if(res['RouteStatus'] == 0) {
                            console.log("Trip routes formatting is in progress");
                            console.log(res);
                            $scope.tripFormattingStatus = "Trip routes formatting is in progress, map cannot be loaded now.";
                        } else if(res['RouteStatus'] == 2) {
                            console.log("Trip data has invalid format, could not load");
                            console.log(res);
                            $scope.tripFormattingStatus = "Trip data has invalid format, could not load the map.";
                        }
                    },
                    function (res) {
                        console.log(res);
                    }
                )
            }
            else {
                $scope.requestTrips();
            }

            $scope.public = false;

            $scope.togglePublic = function (status) {
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.005034965034965035, 'mean_word_length': 1.0025203024362923, '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': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1148680', 'n_tokens_mistral': 1709, 'n_tokens_neox': 1562, 'n_words': 315}