<commit_before>;(function() {  // IIFE
  'use strict';

  angular
    .module('brewKeeper')
    .directive('starRating', starRating);

  function starRating() {
    var directive = {
      restrict: 'A',
      template: '<ul class="rating">' +
          '<li ng-repeat="star in stars" ng-class="star.show" ng-click="toggle($index)">' +
          '\u2605' +
          '</li>' +
          '</ul>',
      scope: {
          ratingValue: '=',
          max: '=',
      },
      link: linkFunc
    };

    return directive;

    /**
     * The action to take when a star is clicked.
     */
    function linkFunc(scope, elem, attrs) {
      scope.toggle = function (index) {
          scope.ratingValue = index + 1;
      };

      scope.$watch('ratingValue', function (oldVal, newVal) {
          if (newVal >=0 ) {
              displayStars();
          }
      });

      /**
       * Display stars with ratingValue stars filled.
       */
      function displayStars() {
        scope.stars = [];
        for (var i = 0; i < scope.max; i++) {
            scope.stars.push({
              show: {
                filled: i < scope.ratingValue
              }
            });
        }
      }

    }
  }
})();<commit_msg>Remove extra line<commit_after>;(function() {  // IIFE
  'use strict';

  angular
    .module('brewKeeper')
    .directive('starRating', starRating);

  function starRating() {
    var directive = {
      restrict: 'A',
      template: '<ul class="rating">' +
          '<li ng-repeat="star in stars" ng-class="star.show" ng-click="toggle($index)">' +
          '\u2605' +
          '</li>' +
          '</ul>',
      scope: {
          ratingValue: '=',
          max: '=',
      },
      link: linkFunc
    };

    return directive;

    /**
     * The action to take when a star is clicked.
     */
    function linkFunc(scope, elem, attrs) {
      scope.toggle = function (index) {
          scope.ratingValue = index + 1;
      };

      scope.$watch('ratingValue', function (oldVal, newVal) {
          if (newVal >=0 ) {
              displayStars();
          }
      });

      /**
       * Display stars with ratingValue stars filled.
       */
      function displayStars() {
        scope.stars = [];
        for (var i = 0; i < scope.max; i++) {
            scope.stars.push({
              show: {
                filled: i < scope.ratingValue
              }
            });
        }
      }
    }
  }
})();
{'fraction_non_alphanumeric': 0.15554645927138763, 'fraction_numerical': 0.0057306590257879654, 'mean_word_length': 1.483739837398374, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 13, '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': '6334895', 'n_tokens_mistral': 754, 'n_tokens_neox': 724, 'n_words': 164}