<commit_before>(function(root) {

  'use strict';


  var availity = root.availity;

  availity.core.factory('avCodesResource', function(AvApiResource) {
    return new AvApiResource({version: '/v1', url: '/codes'});
  });


  var AvCodesResourceFactory = function(AvApiResource) {

    var AvCodesResource = function () {
      AvApiResource.call(this, 'codes');
    };

    angular.extend(AvCodesResource.prototype, AvApiResource.prototype, {

      getCodes: function (data) {
        //config for the api resource query
        var config = {};
        config.params = {};
        config.params.offset = 50 * (data.page - 1);
        return this.query(config).then(function (response) {
          //format the response into something select2 can read
          var myResults = response.data.codes;
          if(_.isEmpty(myResults[0].id)) {
            _.each(myResults, function (code) {
              code.id = code.code;
            });
          }

          //calculate if we want to continue searching
          var moreVal = (( (response.data.offset / response.data.limit) - 1) * 50) < response.data.totalCount;
          return {
            more: moreVal,
            results: myResults
          };

        });
      }

    });
    return new AvCodesResource();
  };
  availity.core.factory('avCodesResource', AvCodesResourceFactory);
})(window);<commit_msg>whitespace<commit_after>(function(root) {

  'use strict';


  var availity = root.availity;

  availity.core.factory('avCodesResource', function(AvApiResource) {
    return new AvApiResource({version: '/v1', url: '/codes'});
  });


  var AvCodesResourceFactory = function(AvApiResource) {

    var AvCodesResource = function () {
      AvApiResource.call(this, 'codes');
    };

    angular.extend(AvCodesResource.prototype, AvApiResource.prototype, {

      getCodes: function (data) {

        // config for the api resource query
        var config = {};
        config.params = {};
        config.params.offset = 50 * (data.page - 1);

        return this.query(config).then(function (response) {
          //format the response into something select2 can read
          var myResults = response.data.codes;
          if(_.isEmpty(myResults[0].id)) {
            _.each(myResults, function (code) {
              code.id = code.code;
            });
          }

          // calculate if we want to continue searching
          var moreVal = (( (response.data.offset / response.data.limit) - 1) * 50) < response.data.totalCount;
          return {
            more: moreVal,
            results: myResults
          };

        });
      }

    });

    return new AvCodesResource();

  };

  availity.core.factory('avCodesResource', AvCodesResourceFactory);

})(window);
{'fraction_non_alphanumeric': 0.1272264631043257, 'fraction_numerical': 0.006543075245365322, 'mean_word_length': 2.2491145218417947, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7216336', 'n_tokens_mistral': 800, 'n_tokens_neox': 770, 'n_words': 169}