<commit_before>'use strict';

angular.module('lbClientApp')
.controller('AddFoodCtrl', function ($scope, $controller, AddFoodService) {
  angular.extend(this, $controller('BaseCtrl', {$scope: $scope}));

  $scope.item = {
    type: 'food'
  };

  $scope.isFood = function () {
    return $scope.item.type === 'food';
  };

  $scope.isBeverage = function () {
    return $scope.item.type === 'beverage';
  };

  $scope.selectFood = function () {
    $scope.item.type = 'food';
  };

  $scope.selectBeverage = function () {
    $scope.item.type = 'beverage';
  };

  $scope.quantityLabel = function () {
    return $scope.item.type === 'food' ? 'grams' : 'milliliters';
  };

  $scope.isInputValid = function () {
    var item = $scope.item;
    return item.name &&
             $.isNumeric(item.calories) &&
             $.isNumeric(item.fats) &&
             $.isNumeric(item.carbohydrates) &&
             $.isNumeric(item.proteins);
  };

  $scope.sendItem = function() {
    var item = $scope.item;

    function clearItem() {
      $scope.item = {
        type: item.type
      }
    }

    if ($scope.isFood()) {<commit_msg>Minor: Fixed a syntax error.<commit_after>'use strict';

angular.module('lbClientApp')
.controller('AddFoodCtrl', function ($scope, $controller, AddFoodService) {
  angular.extend(this, $controller('BaseCtrl', {$scope: $scope}));

  $scope.item = {
    type: 'food'
  };

  $scope.isFood = function () {
    return $scope.item.type === 'food';
  };

  $scope.isBeverage = function () {
    return $scope.item.type === 'beverage';
  };

  $scope.selectFood = function () {
    $scope.item.type = 'food';
  };

  $scope.selectBeverage = function () {
    $scope.item.type = 'beverage';
  };

  $scope.quantityLabel = function () {
    return $scope.item.type === 'food' ? 'grams' : 'milliliters';
  };

  $scope.isInputValid = function () {
    var item = $scope.item;
    return item.name &&
             $.isNumeric(item.calories) &&
             $.isNumeric(item.fats) &&
             $.isNumeric(item.carbohydrates) &&
             $.isNumeric(item.proteins);
  };

  $scope.sendItem = function() {
    var item = $scope.item;

    function clearItem() {
      $scope.item = {
        type: item.type
      };
    }

    if ($scope.isFood()) {
{'fraction_non_alphanumeric': 0.18161829375549693, 'fraction_numerical': 0.0, 'mean_word_length': 2.6458333333333335, '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': '910963', 'n_tokens_mistral': 794, 'n_tokens_neox': 754, 'n_words': 130}