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

  angular.module('simple-directives.tables', [])
    .directive('sTable', sTable)
    .directive('sThead', sThead)
    .directive('sTbody', sTbody)
    .directive('sRow', sRow)
    .directive('sRowRepeat', sRowRepeat)
    .directive('sColumn', sColumn)
    .directive('sCell', sCell);

    function sTable() {
      return {
        restrict: 'E',
        scope: {
          sModelList: '=',
          onSortChange: '='
        },
        replace: true,
        transclude: true,
        template: '<table class="s-table" ng-transclude></table>',
        controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
          var _this = this;
          this.sModelList = $scope.sModelList;
          this.onSortChange = $scope.onSortChange;
          this.columns = [];

          this.reOrderBy = function(field, reversed) {
            var orderTranslations = {
              false: 'asc',
              true: 'desc'
            };

            _this.sOrderBy = field;
            _this.sOrderReverse = reversed;

            _this.columns.forEach(function(column) {
              column.removeClass('ascending');
              column.removeClass('descending');
            });

            $scope.$apply();
            console.log(_this.onSortChange);
            return _this.onSortChange && _this.onSortChange(field, orderTranslations[reversed]);
          };
        }],
        require: '?sTable',
        controllerAs: 'sTableCtrl'
      };
    }

    function sThead() {
      return {
        restrict: 'E',
        scope: false,
        replace: true,
        transclude: true,
        require: '^sTable',
        controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
          $scope.sModelList = $scope.$parent.sModelList;
          $scope.sTableCtrl = $scope.$parent.sTableCtrl;
        }],
        template: '<thead class="s-thead" ng-transclude></thead>'
      };
    }
<commit_msg>crushin'<commit_after>(function() {
  'use strict';

  angular.module('simple-directives.tables', [])
    .directive('sTable', sTable)
    .directive('sThead', sThead)
    .directive('sTbody', sTbody)
    .directive('sRow', sRow)
    .directive('sRowRepeat', sRowRepeat)
    .directive('sColumn', sColumn)
    .directive('sCell', sCell);

    function sTable() {
      return {
        restrict: 'E',
        scope: {
          sModelList: '=',
          onSortChange: '='
        },
        replace: true,
        transclude: true,
        template: '<table class="s-table" ng-transclude></table>',
        controller: ['$scope', '$element', '$attrs', function ($scope, $element, $attrs) {
          var _this = this;
          _this.sModelList   = $scope.sModelList;
          _this.onSortChange = $scope.onSortChange;
          _this.columns      = [];

          _this.reOrderBy = function(field, reversed) {
            var orderTranslations = {
              false: 'asc',
              true: 'desc'
            };

            _this.sOrderBy = field;
            _this.sOrderReverse = reversed;

            _this.columns.forEach(function(column) {
              column.removeClass('ascending');
              column.removeClass('descending');
            });

            $scope.$apply();
            return (_this.onSortChange || angular.noop)(field, orderTranslations[reversed]);
          };
        }],
        require: '?sTable',
        controllerAs: 'sTableCtrl'
      };
    }

    function sThead() {
      return {
        restrict: 'E',
        scope: false,
        replace: true,
        transclude: true,
        require: '^sTable',
        controller: ['$scope', '$element', '$attrs', function($scope, $element, $attrs) {
          $scope.sModelList = $scope.$parent.sModelList;
          $scope.sTableCtrl = $scope.$parent.sTableCtrl;
        }],
        template: '<thead class="s-thead" ng-transclude></thead>'
      };
    }

{'fraction_non_alphanumeric': 0.15049404611097036, 'fraction_numerical': 0.0, 'mean_word_length': 1.979622641509434, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1646209', 'n_tokens_mistral': 1192, 'n_tokens_neox': 1172, 'n_words': 207}