<commit_before>(function () {

  var app = angular.module('AngularSailsApp', ['angularSails.base']);

  app.controller('CommentCtrl', ['$scope', '$sails', function ($scope, $sails) {

    // Get the comments from the sails server.
    $scope.comments = $sails('/comment');

    // Adds a comment.
    $scope.addComment = function (e) {
      if (e.keyCode !== 13) return;
      $scope.comments.$add({
        body: $scope.newComment
      });
      $scope.newComment = '';
    };

    // Remove a comment.
    $scope.deleteComment = function (comment) {
      $scope.comments.$remove(comment);
    };

    // Update a comment.
    $scope.updateComment = function (comment) {
      $scope.comments.$update(comment);

      // TODO: ideally I'd like to get this to a point that looked like the code below<commit_msg>example docs<commit_after>(function () {

  var app = angular.module('AngularSailsApp', ['angularSails.base']);

  app.controller('CommentCtrl', ['$scope', '$sails', function ($scope, $sails) {

    // Get the comments from the sails server.
    $scope.comments = $sails('/comment');

    // Adds a comment.
    $scope.addComment = function (e) {
      if (e.keyCode !== 13) return;
      $scope.comments.$add({
        body: $scope.newComment
      });
      $scope.newComment = '';
    };

    // Remove a comment.
    $scope.deleteComment = function (comment) {
      $scope.comments.$remove(comment);

      // TODO: ideally I'd like to get this to a point that looked like the code below
      //
      // comment.$remove();
    };

    // Update a comment.
    $scope.updateComment = function (comment) {
      $scope.comments.$update(comment);

      // TODO: ideally I'd like to get this to a point that looked like the code below
{'fraction_non_alphanumeric': 0.1523972602739726, 'fraction_numerical': 0.00228310502283105, 'mean_word_length': 2.636929460580913, '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': '4086625', 'n_tokens_mistral': 533, 'n_tokens_neox': 504, 'n_words': 145}