<commit_before>angular.module('ocWebGui.screen.service', ['ngResource', 'ocWebGui.filterpanel'])
  .factory('Agents', function ($resource, shared) {
    var teams = shared.getTeams();
    var states = shared.getStates();
    return $resource('agent_statuses.json', {}, {
      query: {
        method: 'get',
        isArray: true,
        transformResponse: function (data) {
          var agents = angular.fromJson(data);
          agents = agents.map(function (agent) {
            agent.created_at = new Date(agent.created_at);
            return agent;
          });
          return agents.filter(function (agent) {
            return teams[agent.team.name] && (states[agent.status] || (states.Muut && !(agent.status in states)));
          });
        }
      }
    });
  });
<commit_msg>combine map and filter and switch positions<commit_after>angular.module('ocWebGui.screen.service', ['ngResource', 'ocWebGui.filterpanel'])
  .factory('Agents', function ($resource, shared) {
    var teams = shared.getTeams();
    var states = shared.getStates();
    return $resource('agent_statuses.json', {}, {
      query: {
        method: 'get',
        isArray: true,
        transformResponse: function (data) {
          return angular.fromJson(data)
            .filter(function (agent) {
              return teams[agent.team.name] && (states[agent.status] || (states.Muut && !(agent.status in states)));
            })
            .map(function (agent) {
              agent.created_at = new Date(agent.created_at);
              return agent;
            });
        }
      }
    });
  });

{'fraction_non_alphanumeric': 0.14893617021276595, 'fraction_numerical': 0.0, 'mean_word_length': 2.3174273858921164, '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': '1206899', 'n_tokens_mistral': 447, 'n_tokens_neox': 448, 'n_words': 91}