<commit_before>var app = angular.module('myApp', ["ngRoute", "ngStorage", 'ng-sweet-alert',
  'easypiechart'
]);
var selected;

app.controller('MainCtrl', function($scope) {

  $scope.tasks = [];
  $scope.selectedRow = 0;
  $scope.labels = [];
  window.location.href = '#remaining';

  $scope.sweet = {};
  $scope.sweet.option = {
    title: "Are you sure?",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, delete it!",
    cancelButtonText: "No, cancel!",
    closeOnConfirm: false,
    closeOnCancel: true
  }
  $scope.sweet.confirm = {
    title: 'Deleted!',
    showConfirmButton: false,
    timer: 1000,
    type: 'success',
  };

});

app.controller('chartCtrl', function($scope) {
  $scope.allTasks = $scope.tasks.length;
  $scope.percent = 100 / $scope.allTasks;
  $scope.remainingTasksPercent = $scope.remainingTasks() * $scope.percent;
  $scope.completedTasksPercent = 100 - $scope.remainingTasksPercent;
  $scope.anotherOptions = {
    animate: {
      duration: 1000,
      enabled: true
    },
    barColor: '#63A58B',
    scaleColor: false,
    lineWidth: 55,
    trackColor: '#E26C75',
    lineCap: 'circle'
  };
});

app.directive('focus', function($timeout) {
  return {
    scope: {
      trigger: '@focus'
    },
    link: function(scope, element) {
      scope.$watch('trigger', function(value) {
        if (value === "true") {
          $timeout(function() {
            element[0].focus();
          });
        }
      });
    }
  };
});

app.directive('trash', function() {
  return {
    templateUrl: "trash.html",
    link: function(scope, element, attrs) {
      scope.iconClass = attrs['class'] || 'defaultIcon';
      scope.action = attrs.action || '';
    }
  }
});

app.controller('TasksCtrl', function($scope, $routeParams, $localStorage,
  $document) {

  angular.element(document).ready(function() {
    jQuery(".timeago").timeago();
  });

  $scope.tasksId = $routeParams.ID;
  $scope.tasks = $localStorage.tasks ? $localStorage.tasks : [];
  $scope.labels = $localStorage.labels;

  // $localStorage.$reset();

  $scope.add = function() {

    $scope.tasks.push({
      title: $scope.task,
      completed: false,
      dueDate: null,
      comments: [],
      priority: "Medium",
      createdOn: moment().format(),
      assignee: "Me",
      reporter: "Me",
      selectedRow: $scope.selectedRow,
      labels: []
    });

    $scope.task = '';

    $localStorage.tasks = $scope.tasks;

    angular.element(document).ready(function() {
      jQuery(".timeago").timeago();
    });

  }

  $scope.exportTasks = function() {
    return JSON.stringify($scope.tasks);
  }

  $scope.importTasks = function() {
    $scope.importedTasks = JSON.parse($scope.import);
<commit_msg>Removed "$$hashKey" property from the exported JSON object.<commit_after>var app = angular.module('myApp', ["ngRoute", "ngStorage", 'ng-sweet-alert',
  'easypiechart'
]);
var selected;

app.controller('MainCtrl', function($scope) {

  $scope.tasks = [];
  $scope.selectedRow = 0;
  $scope.labels = [];
  window.location.href = '#remaining';

  $scope.sweet = {};
  $scope.sweet.option = {
    title: "Are you sure?",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, delete it!",
    cancelButtonText: "No, cancel!",
    closeOnConfirm: false,
    closeOnCancel: true
  }
  $scope.sweet.confirm = {
    title: 'Deleted!',
    showConfirmButton: false,
    timer: 1000,
    type: 'success',
  };

});

app.controller('chartCtrl', function($scope) {
  $scope.allTasks = $scope.tasks.length;
  $scope.percent = 100 / $scope.allTasks;
  $scope.remainingTasksPercent = $scope.remainingTasks() * $scope.percent;
  $scope.completedTasksPercent = 100 - $scope.remainingTasksPercent;
  $scope.anotherOptions = {
    animate: {
      duration: 1000,
      enabled: true
    },
    barColor: '#63A58B',
    scaleColor: false,
    lineWidth: 55,
    trackColor: '#E26C75',
    lineCap: 'circle'
  };
});

app.directive('focus', function($timeout) {
  return {
    scope: {
      trigger: '@focus'
    },
    link: function(scope, element) {
      scope.$watch('trigger', function(value) {
        if (value === "true") {
          $timeout(function() {
            element[0].focus();
          });
        }
      });
    }
  };
});

app.directive('trash', function() {
  return {
    templateUrl: "trash.html",
    link: function(scope, element, attrs) {
      scope.iconClass = attrs['class'] || 'defaultIcon';
      scope.action = attrs.action || '';
    }
  }
});

app.controller('TasksCtrl', function($scope, $routeParams, $localStorage,
  $document) {

  angular.element(document).ready(function() {
    jQuery(".timeago").timeago();
  });

  $scope.tasksId = $routeParams.ID;
  $scope.tasks = $localStorage.tasks ? $localStorage.tasks : [];
  $scope.labels = $localStorage.labels;

  // $localStorage.$reset();

  $scope.add = function() {

    $scope.tasks.push({
      title: $scope.task,
      completed: false,
      dueDate: null,
      comments: [],
      priority: "Medium",
      createdOn: moment().format(),
      assignee: "Me",
      reporter: "Me",
      selectedRow: $scope.selectedRow,
      labels: []
    });

    $scope.task = '';

    $localStorage.tasks = $scope.tasks;

    angular.element(document).ready(function() {
      jQuery(".timeago").timeago();
    });

  }

  $scope.exportTasks = function() {
    return angular.toJson($scope.tasks);
  }

  $scope.importTasks = function() {
    $scope.importedTasks = JSON.parse($scope.import);

{'fraction_non_alphanumeric': 0.17494639027877054, 'fraction_numerical': 0.010364546104360257, 'mean_word_length': 3.0179468772433595, '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': '6447348', 'n_tokens_mistral': 1885, 'n_tokens_neox': 1801, 'n_words': 321}