<commit_before>var app = angular.module('App', [])

app.controller('ItemListController', function ItemListController($scope, $http) {
  $http.get('data.json')
       .then(function(res){
          $scope.items = res.data;
          $scope.reset();
        });

  $scope.addItem = function addItem(item, type) {
    if (type == "small") {
      $scope.totalPrice += item.smallPrice;
      item.orderedSmall += 1;
    } else {
      $scope.totalPrice += item.price;
      item.ordered += 1;
    }
    $scope.regenerateTextOrder();
  };

  $scope.removeItem = function removeItem(item, type) {
    if (type == "small") {
      $scope.totalPrice -= item.smallPrice;
      item.orderedSmall -= 1;
    } else {
      $scope.totalPrice -= item.price;
      item.ordered -= 1;
    }
    $scope.regenerateTextOrder();
  };

  $scope.regenerateTextOrder = function regenerateTextOrder() {
    $scope.order = "";
    angular.forEach($scope.items, function(item, key) {
      if (item.ordered > 0) {
        $scope.order = $scope.order + "Velka " + item.name + " " + item.ordered + " ks\n";
      }
      if (item.orderedSmall > 0) {
        $scope.order = $scope.order + "Mala " + item.name + " " + item.orderedSmall + " ks\n";<commit_msg>Recalculate money after item add or remove to/from order.<commit_after>var app = angular.module('App', [])

app.controller('ItemListController', function ItemListController($scope, $http) {
  $http.get('data.json')
       .then(function(res){
          $scope.items = res.data;
          $scope.reset();
        });

  $scope.addItem = function addItem(item, type) {
    if (type == "small") {
      $scope.totalPrice += item.smallPrice;
      item.orderedSmall += 1;
    } else {
      $scope.totalPrice += item.price;
      item.ordered += 1;
    }
    $scope.regenerateTextOrder();
    $scope.countMoney(0);
  };

  $scope.removeItem = function removeItem(item, type) {
    if (type == "small") {
      $scope.totalPrice -= item.smallPrice;
      item.orderedSmall -= 1;
    } else {
      $scope.totalPrice -= item.price;
      item.ordered -= 1;
    }
    $scope.regenerateTextOrder();
    $scope.countMoney(0);
  };

  $scope.regenerateTextOrder = function regenerateTextOrder() {
    $scope.order = "";
    angular.forEach($scope.items, function(item, key) {
      if (item.ordered > 0) {
        $scope.order = $scope.order + "Velka " + item.name + " " + item.ordered + " ks\n";
      }
      if (item.orderedSmall > 0) {
        $scope.order = $scope.order + "Mala " + item.name + " " + item.orderedSmall + " ks\n";
{'fraction_non_alphanumeric': 0.1677115987460815, 'fraction_numerical': 0.0054858934169279, 'mean_word_length': 2.5706293706293706, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '1096476', 'n_tokens_mistral': 855, 'n_tokens_neox': 828, 'n_words': 151}