<commit_before>angular.module('marvelUs', [
      'home',
      'comics',
      'ui.router',
      'ui.bootstrap'
      // 'ngAnimate', 
      // 'fx.animations'
])

.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  $locationProvider.html5Mode(true);
  $urlRouterProvider.otherwise("/");
})

.controller( 'MainController', function AppCtrl ( $scope, $location ) {
  $scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams){
    if ( angular.isDefined( toState.data.pageTitle ) ) {
      $scope.pageTitle = toState.data.pageTitle  ;
    }
  });
})

.constant('ApiKey', '353d4637ab79ee4a2aa59db0cce149ca')

.factory( 'MarvelService', function MarvelService($http, ApiKey){
  var entryPoint = 'http://gateway.marvel.com/v1/public/';
  var marvelService = {};

  marvelService.get = function(type, id, subclass){
    var requestString = entryPoint;
    for(var i = 0; i < arguments.length; i++){
      requestString += arguments.length > 1 ? arguments[i] + '/' : arguments[i]
    }

    var requestOptions = { 
        params: { 'apikey': ApiKey },
        cache: true
      }
    return $http.get(requestString, requestOptions);
  };

  return marvelService;
})
;<commit_msg>Refactors MarvelService to accept a config object instead of multiple params<commit_after>angular.module('marvelUs', [
      'home',
      'comics',
      'ui.router',
      'ui.bootstrap'
      // 'ngAnimate', 
      // 'fx.animations'
])

.config(function($stateProvider, $urlRouterProvider, $locationProvider) {
  $locationProvider.html5Mode(true);
  $urlRouterProvider.otherwise("/");
})

.controller( 'MainController', function AppCtrl ( $scope, $location ) {
  $scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams){
    if ( angular.isDefined( toState.data.pageTitle ) ) {
      $scope.navIsCollapsed = true;
      $scope.pageTitle = toState.data.pageTitle  ;
    }
  });
  $scope.navIsCollapsed = true;
})

.constant('ApiKey', '353d4637ab79ee4a2aa59db0cce149ca')

.factory( 'MarvelService', function MarvelService($http, ApiKey){
  var entryPoint = 'http://gateway.marvel.com/v1/public/';
  var marvelService = {};
  //Example requestConfig
  // var requestConfig = {
  //   path:[ null, null, null]
  //   },
  //   queryParams: {
  //     param: value
  //   }
  // }
  marvelService.get = function(requestConfig){
    var requestString = entryPoint;
    var pathExtension = requestConfig.path;
    var queryParams = requestConfig.queryParams ? requestConfig.queryParams : {} ;
    queryParams['apikey'] = ApiKey;

    for(var i = 0; i < pathExtension.length; i++){
      requestString += pathExtension.length > 1 ? pathExtension[i] + '/' : pathExtension[i]
    }

    var requestOptions = { 
        params: queryParams,
        cache: true
      }
    return $http.get(requestString, requestOptions);
  };

  return marvelService;
})
;
{'fraction_non_alphanumeric': 0.15083990401097017, 'fraction_numerical': 0.014398354473774426, 'mean_word_length': 3.4145234493192134, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3780180', 'n_tokens_mistral': 958, 'n_tokens_neox': 927, 'n_words': 173}