<commit_before>'use strict';

angular.module('app.services', [])

  .factory('MarvelAPI', ['$http', '$q', function($http, $q) {
    var apiUrl = 'http://gateway.marvel.com/v1/public/';
    var apiKey = '<KEY>';

    // limit to top 10 results
    var limit = 10;

    var getChar = function(character) {
      var def = $q.defer();
      var url = apiUrl + 'characters?limit=' + limit + '&nameStartsWith=' + character + '&apikey=' + apiKey;
      $http.get(url)
        .success(function (response) {
          if (response.data.results.length > 0) {
            def.resolve({
              characters: response.data.results
            });
          }
          else {
            def.reject({
              message: 'Unable to find that character'
            });
          }
        }).error(function () {
          def.reject({
            message: 'API error'
          });
        });

      return def.promise;
    };

    return { getChar: getChar };
  }])

  .factory('_', [function() {
    // assumes underscore has already been loaded on the page
    return window._;
  }]);<commit_msg>woops, api key<commit_after>'use strict';

angular.module('app.services', [])

  .factory('MarvelAPI', ['$http', '$q', function($http, $q) {
    var apiUrl = 'http://gateway.marvel.com/v1/public/';
    var apiKey = 'yourPublicKey';

    // limit to top 10 results
    var limit = 10;

    var getChar = function(character) {
      var def = $q.defer();
      var url = apiUrl + 'characters?limit=' + limit + '&nameStartsWith=' + character + '&apikey=' + apiKey;
      $http.get(url)
        .success(function (response) {
          if (response.data.results.length > 0) {
            def.resolve({
              characters: response.data.results
            });
          }
          else {
            def.reject({
              message: 'Unable to find that character'
            });
          }
        }).error(function () {
          def.reject({
            message: 'API error'
          });
        });

      return def.promise;
    };

    return { getChar: getChar };
  }])

  .factory('_', [function() {
    // assumes underscore has already been loaded on the page
    return window._;
  }]);
{'fraction_non_alphanumeric': 0.15478892419428053, 'fraction_numerical': 0.005447117566954153, 'mean_word_length': 1.8365508365508365, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, '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': '4476013', 'n_tokens_mistral': 667, 'n_tokens_neox': 648, 'n_words': 156}