<commit_before>angular.module('starter.controllers', [])

.controller('AppCtrl', function($scope, $ionicModal, $ionicSideMenuDelegate, $timeout, api, $timeout, $rootScope) {
    setTimeout(function() {
        $ionicSideMenuDelegate.toggleLeft();
        $rootScope.isSideMenuOpen = false;
    }, 100);
    $scope.menuClicked = function() {
        $rootScope.isSideMenuOpen= $ionicSideMenuDelegate.isOpen();
    };
})
.controller('SectionCtrl', function($scope, $rootScope, api, $stateParams, $ionicPopup) {
    $rootScope.selected = {};
    $scope.$on('$ionicView.beforeEnter', function() {
        $scope.name = $stateParams.sectionid;
        $rootScope.toles = [];
        $rootScope.districts = [];

        var refresh = $scope.dataset?false:true;
        api.coordinates().then(function(position) {
            $rootScope.coordinates = position.coords;
            $rootScope.doRefresh(refresh);
        },
        function(err) {
            $rootScope.doRefresh(refresh);
        });
    });
    $rootScope.updateDistrict = function(){
        //$rootScope.toles = api.location.tole($scope.dataset, $scope.name, $rootScope.selected.district);
        $rootScope.items = api.filter.location.district($scope.dataset, $scope.name, $rootScope.selected.district);
    }
    $rootScope.updateTole = function(){
        $rootScope.items = api.filter.location.tole($rootScope.items, $scope.name,  $rootScope.selected.tole);
    }
    $scope.loadItem = function(item){
        $rootScope.selectedItem = item;
        api.selected.set(item);
        window.location = "#/app/item/"+item.uuid;
    }
    $rootScope.doRefresh = function(refresh){
        if (typeof refresh != 'undefined') {
            refresh = true;
        }
        api.data(refresh).then(function(data){
            console.log($scope.name);
            console.log($rootScope);
            $scope.dataset = api.filter.type(data.content, $scope.name);
            $rootScope.items = $scope.dataset;
            $rootScope.districts = api.location.districts(data.content, $scope.name);
            $scope.$broadcast('scroll.refreshComplete');<commit_msg>Remove noisy logs<commit_after>angular.module('starter.controllers', [])

.controller('AppCtrl', function($scope, $ionicModal, $ionicSideMenuDelegate, $timeout, api, $timeout, $rootScope) {
    setTimeout(function() {
        $ionicSideMenuDelegate.toggleLeft();
        $rootScope.isSideMenuOpen = false;
    }, 100);
    $scope.menuClicked = function() {
        $rootScope.isSideMenuOpen= $ionicSideMenuDelegate.isOpen();
    };
})
.controller('SectionCtrl', function($scope, $rootScope, api, $stateParams, $ionicPopup) {
    $rootScope.selected = {};
    $scope.$on('$ionicView.beforeEnter', function() {
        $scope.name = $stateParams.sectionid;
        $rootScope.toles = [];
        $rootScope.districts = [];

        var refresh = $scope.dataset?false:true;
        api.coordinates().then(function(position) {
            $rootScope.coordinates = position.coords;
            $rootScope.doRefresh(refresh);
        },
        function(err) {
            $rootScope.doRefresh(refresh);
        });
    });
    $rootScope.updateDistrict = function(){
        //$rootScope.toles = api.location.tole($scope.dataset, $scope.name, $rootScope.selected.district);
        $rootScope.items = api.filter.location.district($scope.dataset, $scope.name, $rootScope.selected.district);
    }
    $rootScope.updateTole = function(){
        $rootScope.items = api.filter.location.tole($rootScope.items, $scope.name,  $rootScope.selected.tole);
    }
    $scope.loadItem = function(item){
        $rootScope.selectedItem = item;
        api.selected.set(item);
        window.location = "#/app/item/"+item.uuid;
    }
    $rootScope.doRefresh = function(refresh){
        if (typeof refresh != 'undefined') {
            refresh = true;
        }
        api.data(refresh).then(function(data){
            $scope.dataset = api.filter.type(data.content, $scope.name);
            $rootScope.items = $scope.dataset;
            $rootScope.districts = api.location.districts(data.content, $scope.name);
            $scope.$broadcast('scroll.refreshComplete');
{'fraction_non_alphanumeric': 0.15489585827148672, 'fraction_numerical': 0.0014364376346660283, 'mean_word_length': 2.934086629001883, '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': '2726078', 'n_tokens_mistral': 1257, 'n_tokens_neox': 1223, 'n_words': 165}