<commit_before>function oneInstance (list,param,key) { //generates controller for team, match, etc view where you want one of a list updated
  if (!list || !param) return;
  key = key || param;
  var res = ['$stateParams','$scope',function ($stateParams,$scope) {
    $scope.id = $stateParams[param];
    function updateTeam (newList) {
      newList.forEach(function (x) {
        if (x[key] == $scope.id) $scope[param] = x;
      });
    }
    $scope.$watch(list,updateTeam);
  }];
  return res;
}
angular.module('FRCdozer',['ui.router','angularUtils.directives.dirPagination'])
  .config(['paginationTemplateProvider',function(paginationTemplateProvider) {
    paginationTemplateProvider.setPath('views/paginate.html');
  }])
  .config(['$stateProvider','$urlRouterProvider',function($stateProvider, $urlRouterProvider) {
    $stateProvider
      .state('home', {
        url: "/",
        templateUrl: 'views/home.html'
      })
      .state('me', {
        url: '/me',
        templateUrl: 'views/me.html'
      })
  	  .state('login', {
  		    url: "/login",
  		    templateUrl: 'views/login.html'
  	  })
      .state('register', {
        url: '/register',
        templateUrl: 'views/register.html'
      })
      .state('404', {
        url: '/404',
        templateUrl: 'views/404.html'
      })
      .state('401', {
        url:'/401',
        templateUrl: 'views/401.html'
      })
      .state('game', {
        url: '/game/:name?filter&reverse',
        templateUrl: 'views/game.html',
        controller: 'frcCtrl'
      })
      .state('game.edit', {
        url: '/edit',
        templateUrl: 'views/edit.html',
      })
      .state('game.submissions', {
        url: '/subs',
        templateUrl: 'views/subs.html'
      })
      .state('game.add', {
        url: '/add',
        templateUrl: 'views/add.html'
      })
      .state('game.addTeam', {
        url: '/pit',
        templateUrl: 'views/AddTeam.html'
      })
      .state('game.teams', {
        url: '/teams',
        templateUrl: 'views/teams.html'
      })
      .state('game.team', {
        url: '/team/:team',
        templateUrl: 'views/team.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.team) return $state.go('game.teams');
          $scope.TeamParam = $stateParams.team;
          $scope.team = {};
          $scope.team.team = Number($scope.TeamParam);
          $scope.$watchCollection('teams', function (teams) {
            teams.forEach(function (team) {
              if (Number(team.team) === Number($scope.TeamParam)) $scope.team = team;
            });
          });
        }]
      })
      .state('game.match', {
        url: '/match/:match',
        templateUrl: 'views/match.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.match) return $state.go('game.matches');
          $scope.MatchParam = $stateParams.match;
          $scope.$watchCollection('matches', function (matches) {
            matches.forEach(function (match) {
              if (match.match === $scope.MatchParam) $scope.match = match;
            });
          });
        }]
      })
      .state('game.sub', {
        url: '/sub/:sub',
        templateUrl: 'views/sub.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.sub) return $state.go('game.submissions');
          $scope.SubID = $stateParams.sub;<commit_msg>use id for team<commit_after>function oneInstance (list,param,key) { //generates controller for team, match, etc view where you want one of a list updated
  if (!list || !param) return;
  key = key || param;
  var res = ['$stateParams','$scope',function ($stateParams,$scope) {
    $scope.id = $stateParams[param];
    function updateTeam (newList) {
      newList.forEach(function (x) {
        if (x[key] == $scope.id) $scope[param] = x;
      });
    }
    $scope.$watch(list,updateTeam);
  }];
  return res;
}
angular.module('FRCdozer',['ui.router','angularUtils.directives.dirPagination'])
  .config(['paginationTemplateProvider',function(paginationTemplateProvider) {
    paginationTemplateProvider.setPath('views/paginate.html');
  }])
  .config(['$stateProvider','$urlRouterProvider',function($stateProvider, $urlRouterProvider) {
    $stateProvider
      .state('home', {
        url: "/",
        templateUrl: 'views/home.html'
      })
      .state('me', {
        url: '/me',
        templateUrl: 'views/me.html'
      })
  	  .state('login', {
  		    url: "/login",
  		    templateUrl: 'views/login.html'
  	  })
      .state('register', {
        url: '/register',
        templateUrl: 'views/register.html'
      })
      .state('404', {
        url: '/404',
        templateUrl: 'views/404.html'
      })
      .state('401', {
        url:'/401',
        templateUrl: 'views/401.html'
      })
      .state('game', {
        url: '/game/:name?filter&reverse',
        templateUrl: 'views/game.html',
        controller: 'frcCtrl'
      })
      .state('game.edit', {
        url: '/edit',
        templateUrl: 'views/edit.html',
      })
      .state('game.submissions', {
        url: '/subs',
        templateUrl: 'views/subs.html'
      })
      .state('game.add', {
        url: '/add',
        templateUrl: 'views/add.html'
      })
      .state('game.addTeam', {
        url: '/pit',
        templateUrl: 'views/AddTeam.html'
      })
      .state('game.teams', {
        url: '/teams',
        templateUrl: 'views/teams.html'
      })
      .state('game.team', {
        url: '/team/:team',
        templateUrl: 'views/team.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.team) return $state.go('game.teams');
          var mongodbPattern = /^[0-9a-fA-F]{24}$/;
          $scope.param = $stateParams.team;
          $scope.team = {};
          if ($scope.param.match(mongodbPattern)) {
            $scope.team._id  = $scope.param;
            $scope.$watchCollection('teams', function (teams) {
              teams.forEach(function (team) {
                if (team._id === $scope.team._id) $scope.team = team;
              });
            });
          } else {
            $scope.team.team = Number($scope.param);
            $scope.$watchCollection('teams', function (teams) {
              teams.forEach(function (team) {
                if (Number(team.team) === $scope.team.team) $scope.team = team;
              });
            });
          }
        }]
      })
      .state('game.match', {
        url: '/match/:match',
        templateUrl: 'views/match.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.match) return $state.go('game.matches');
          $scope.MatchParam = $stateParams.match;
          $scope.$watchCollection('matches', function (matches) {
            matches.forEach(function (match) {
              if (match.match === $scope.MatchParam) $scope.match = match;
            });
          });
        }]
      })
      .state('game.sub', {
        url: '/sub/:sub',
        templateUrl: 'views/sub.html',
        controller: ['$stateParams','$scope','$state',function ($stateParams,$scope,$state) {
          if (!$stateParams.sub) return $state.go('game.submissions');
          $scope.SubID = $stateParams.sub;
{'fraction_non_alphanumeric': 0.18081971604607555, 'fraction_numerical': 0.005357621216180016, 'mean_word_length': 2.193755346449957, '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': '2849848', 'n_tokens_mistral': 2311, 'n_tokens_neox': 2286, 'n_words': 370}