<commit_before>'use strict';

/**
 * @ngdoc function
 * @name <%= ngModulName %>.serive:ExampleService
 * @description
 * # ExampleService
 */
angular.module('<%= ngModulName %>')
  // use factory for services
  .factory('ExampleService', function($http, $timeout, $q) {

    var kindOfPrivateVariable = 42;

    var doSomethingAsync = function() {
      var deferred = $q.defer();
      $timeout(deferred.resolve.bind(null, kindOfPrivateVariable), 1000);
      return deferred.promise;
    };

    var fetchSomethingFromServer = function() {
      return $http({
          url: 'http://hipsterjesus.com/api',
          params: {
              paras: 2
          },
          method: 'GET'
        })
        .success(function(data) {
          console.log('fetched this stuff from server:', data);
        })
        .error(function(error) {
          console.log('an error occured', error);
        });
    };

    // public api
    return {
      doSomethingAsync: doSomethingAsync,
      fetchSomethingFromServer: fetchSomethingFromServer
    };

  });<commit_msg>Updating ExampleService<commit_after>(function () {
  'use strict';

/**
 * @ngdoc function
 * @name <%= ngModulName %>.service:ExampleService
 * @description
 * # ExampleService
 */
angular.module('<%= ngModulName %>')
  // use factory for services
  .factory('ExampleService', function($http, $timeout, $q) {

    // var kindOfPrivateVariable = 42;
    //
    // var doSomethingAsync = function() {
    //   var deferred = $q.defer();
    //   $timeout(deferred.resolve.bind(null, kindOfPrivateVariable), 1000);
    //   return deferred.promise;
    // };
    //
    // var fetchSomethingFromServer = function() {
    //   return $http({
    //       url: 'http://hipsterjesus.com/api',
    //       params: {
    //           paras: 2
    //       },
    //       method: 'GET'
    //     })
    //     .success(function(data) {
    //       console.log('fetched this stuff from server:', data);
    //     })
    //     .error(function(error) {
    //       console.log('an error occured', error);
    //     });
    // };
    //
    // // public api
    // return {
    //   doSomethingAsync: doSomethingAsync,
    //   fetchSomethingFromServer: fetchSomethingFromServer
    // };

    var endPointUrl = 'http://jsonstub.com/api';
    var kindOfPrivateVariable = 42;

    var doSomethingAsync = function() {
      var deferred = $q.defer();
      $timeout(deferred.resolve.bind(null, kindOfPrivateVariable), 1000);
      return deferred.promise;
    };

    var fetchSomethingFromServer = function() {
      var deferred = $q.defer();
      return $http({
          url: endPointUrl,
          method: 'GET',
          dataType: 'json',
          data: '',
          headers: {
              'Access-Control-Allow-Origin': 'http://jsonstub.com',
              'Access-Control-Allow-Headers': 'Cache-Control, Pragma, Origin, Authorization, Content-Type, X-Requested-With',
              'Access-Control-Allow-Methods': 'GET',
              'Content-Type': 'application/json',
              'JsonStub-User-Key': '0d69f758-3b93-4e27-89ea-959709deb4ba',
              'JsonStub-Project-Key': '<KEY>'
          }
      }).success(function(data, status, headers, config) {
            console.log('SUCCESS DATA: '+ JSON.stringify(data));
            console.log('SUCCESS STATUS: '+ JSON.stringify(status));
            console.log('SUCCESS CONFIG :'+ JSON.stringify(config));

          })
          .error(function(data, status, headers, config) {
            console.log('ERROR DATA: '+ JSON.stringify(data));
            console.log('ERROR STATUS: '+ JSON.stringify(status));
            console.log('ERROR CONFIG :'+ JSON.stringify(config));
            return deferred.reject('There was an error fetching objects');
          });
    };

    // public api
    return {
      doSomethingAsync: doSomethingAsync,
      fetchSomethingFromServer: fetchSomethingFromServer
    };

  });
})();
{'fraction_non_alphanumeric': 0.15104824450618842, 'fraction_numerical': 0.01035615054306643, 'mean_word_length': 2.180722891566265, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6264097', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1120, 'n_words': 220}