<commit_before>/**
 * angular-timer - v1.0.7 - 2013-11-27 1:48 PM
 * https://github.com/siddii/angular-timer
 *
 * Copyright (c) 2013 <NAME>
 * Licensed MIT <https://github.com/siddii/angular-timer/blob/master/LICENSE.txt>
 */
angular.module("timer",[]).directive("timer",["$compile",function(a){return{restrict:"E",replace:!1,scope:{interval:"=interval",startTimeAttr:"=startTime",countdownattr:"=countdown",autoStart:"&autoStart"},controller:["$scope","$element","$attrs",function(b,c,d){function e(){b.timeoutId&&clearTimeout(b.timeoutId)}function f(){b.seconds=Math.floor(b.millis/1e3%60),b.minutes=Math.floor(b.millis/6e4%60),b.hours=Math.floor(b.millis/36e5%24),b.days=Math.floor(b.millis/36e5/24)}var g;b.autoStart=d.autoStart||d.autostart,g=c.html(),0===g.trim().length&&(g="{{millis}}"),c.replaceWith(a("<span>"+g+"</span>")(b)),b.startTime=null,b.timeoutId=null,b.countdown=b.countdownattr&&parseInt(b.countdownattr,10)>=0?parseInt(b.countdownattr,10):void 0,b.isRunning=!1,b.$on("timer-start",function(){b.start()}),b.$on("timer-resume",function(){b.resume()}),b.$on("timer-stop",function(){b.stop()}),b.start=c[0].start=function(){b.startTime=b.startTimeAttr?new Date(b.startTimeAttr):new Date,b.countdown=b.countdownattr&&parseInt(b.countdownattr,10)>0?parseInt(b.countdownattr,10):void 0,e(),h()},b.resume=c[0].resume=function(){e(),b.countdownattr&&(b.countdown+=1),b.startTime=new Date-(b.stoppedTime-b.startTime),h()},b.stop=b.pause=c[0].stop=c[0].pause=function(){b.stoppedTime=new Date,e(),b.$emit("timer-stopped",{millis:b.millis,seconds:b.seconds,minutes:b.minutes,hours:b.hours,days:b.days}),b.timeoutId=null},c.bind("$destroy",function(){e()}),b.millis=b.countdownattr?1e3*b.countdownattr:0,f();var h=function(){b.millis=new Date-b.startTime;var a=b.millis%1e3;if(b.countdownattr&&(b.millis=1e3*b.countdown),f(),b.countdown>0)b.countdown--;else if(b.countdown<=0)return b.stop(),void 0;b.timeoutId=setTimeout(function(){h(),b.$digest()},b.interval-a),b.$emit("timer-tick",{timeoutId:b.timeoutId,millis:b.millis})};(void 0===b.autoStart||b.autoStart===!0)&&b.start()}]}}]);<commit_msg>use angular-time modified.<commit_after>/**
 * angular-timer - v1.0.7 - 2013-11-27 1:48 PM
 * https://github.com/siddii/angular-timer
 *
 * Copyright (c) 2013 <NAME>
 * Licensed MIT <https://github.com/siddii/angular-timer/blob/master/LICENSE.txt>
 */
angular.module("timer",[]).directive("timer",["$compile",function($compile){return{restrict:"E",replace:!1,scope:{interval:"=interval",startTimeAttr:"=startTime",endTimeAttr:"=endTime",countdownattr:"=countdown",autoStart:"&autoStart"},controller:["$scope","$element","$attrs",function($scope,$element,$attrs){function resetTimeout(){$scope.timeoutId&&clearTimeout($scope.timeoutId)}function calculateTimeUnits(){$scope.seconds=Math.floor($scope.millis/1e3%60),$scope.minutes=Math.floor($scope.millis/6e4%60),$scope.hours=Math.floor($scope.millis/36e5%24),$scope.days=Math.floor($scope.millis/36e5/24)}$scope.autoStart=$attrs.autoStart||$attrs.autostart,0===$element.html().trim().length?$element.append($compile("<span>{{millis}}</span>")($scope)):$element.append($compile($element.contents())($scope)),$scope.startTime=null,$scope.endTime=null,$scope.timeoutId=null,$scope.countdown=$scope.countdownattr&&parseInt($scope.countdownattr,10)>=0?parseInt($scope.countdownattr,10):void 0,$scope.isRunning=!1,$scope.$on("timer-start",function(e,args){var startTime=angular.isNumber(args)?args:void 0;$scope.start(startTime)}),$scope.$on("timer-resume",function(){$scope.resume()}),$scope.$on("timer-stop",function(){$scope.stop()}),$scope.start=$element[0].start=function(startTime){$scope.startTime=$scope.startTimeAttr?new Date($scope.startTimeAttr):new Date,$scope.startTime=startTime?new Date(startTime):$scope.startTime,$scope.endTime=$scope.endTimeAttr?new Date($scope.endTimeAttr):null,$scope.countdown=$scope.countdownattr&&parseInt($scope.countdownattr,10)>0?parseInt($scope.countdownattr,10):void 0,resetTimeout(),tick()},$scope.resume=$element[0].resume=function(){resetTimeout(),$scope.countdownattr&&($scope.countdown+=1),$scope.startTime=new Date-($scope.stoppedTime-$scope.startTime),tick()},$scope.stop=$scope.pause=$element[0].stop=$element[0].pause=function(){$scope.stoppedTime=new Date,resetTimeout(),$scope.$emit("timer-stopped",{millis:$scope.millis,seconds:$scope.seconds,minutes:$scope.minutes,hours:$scope.hours,days:$scope.days}),$scope.timeoutId=null},$element.bind("$destroy",function(){resetTimeout()}),$scope.millis=$scope.countdownattr?1e3*$scope.countdownattr:0,calculateTimeUnits();var tick=function(){$scope.millis=new Date-$scope.startTime;var adjustment=$scope.millis%1e3;if($scope.endTimeAttr&&($scope.millis=$scope.endTime-new Date,adjustment=$scope.interval-$scope.millis%1e3),$scope.countdownattr&&($scope.millis=1e3*$scope.countdown),$scope.millis<0)return $scope.stop(),$scope.millis=0,calculateTimeUnits(),void 0;if(calculateTimeUnits(),$scope.countdown>0)$scope.countdown--;else if($scope.countdown<=0)return $scope.stop(),void 0;$scope.timeoutId=setTimeout(function(){tick(),$scope.$digest()},$scope.interval-adjustment),$scope.$emit("timer-tick",{timeoutId:$scope.timeoutId,millis:$scope.millis})};(void 0===$scope.autoStart||$scope.autoStart===!0)&&$scope.start()}]}}]);
{'fraction_non_alphanumeric': 0.23937784522003036, 'fraction_numerical': 0.02693474962063733, 'mean_word_length': 13.023936170212766, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 17, 'https://': 4, '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': '3074963', 'n_tokens_mistral': 1949, 'n_tokens_neox': 1880, 'n_words': 69}