<commit_before>'use strict';

(function() {
  angular.module('transferService', ['facetService', 'restangular']).

  factory('Transfer', ['Facet', 'Restangular', function(Facet, Restangular) {
    var create_flat_map = function(records, map) {
      if (map === undefined) {
        map = {};
      }

      angular.forEach(records, function(record) {
        map[record.id] = record;
        create_flat_map(record.children, map);
      });

      return map;
    };

    var Transfer = Restangular.all('transfers.json');
    return {
      data: [],
      formats: [],
      id_map: {},
      all: function() {
        return Transfer.customGET();
      },
      resolve: function() {
        var self = this;
        self.all().then(function(data) {
          self.data = data.transfers;
          self.data[0].version = 0;
          self.formats = data.formats;
          self.id_map = create_flat_map(data.transfers);
          self.filter();
        });
      },
      filter: function() {
        angular.forEach(this.id_map, function(file) {
          if (file.type === 'file') {
            file.display = Facet.passes_filters(file);
          } else {
            file.display = true;
          }<commit_msg>Transfer: version attribute is unused<commit_after>'use strict';

(function() {
  angular.module('transferService', ['facetService', 'restangular']).

  factory('Transfer', ['Facet', 'Restangular', function(Facet, Restangular) {
    var create_flat_map = function(records, map) {
      if (map === undefined) {
        map = {};
      }

      angular.forEach(records, function(record) {
        map[record.id] = record;
        create_flat_map(record.children, map);
      });

      return map;
    };

    var Transfer = Restangular.all('transfers.json');
    return {
      data: [],
      formats: [],
      id_map: {},
      all: function() {
        return Transfer.customGET();
      },
      resolve: function() {
        var self = this;
        self.all().then(function(data) {
          self.data = data.transfers;
          self.formats = data.formats;
          self.id_map = create_flat_map(data.transfers);
          self.filter();
        });
      },
      filter: function() {
        angular.forEach(this.id_map, function(file) {
          if (file.type === 'file') {
            file.display = Facet.passes_filters(file);
          } else {
            file.display = true;
          }
{'fraction_non_alphanumeric': 0.14892739273927394, 'fraction_numerical': 0.0008250825082508251, 'mean_word_length': 2.0852417302798982, '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': '3606053', 'n_tokens_mistral': 715, 'n_tokens_neox': 706, 'n_words': 132}