<commit_before><%//used for extracting objects from the spec
var objectFindByKey = function(array, key, value) {
   for (var i = 0; i < array.length; i++) {
     if (array[i][key] == value) {
       return array[i];
     }
   }
   return null;
 }%>
angular.module('<%=moduleName %>')

  .factory('<%=moduleName %>Services', ['$rootScope', '$q', '$filter', '$timeout', '$eventsCommon', 'RestService', 'SocketService', <% _.each(agents, function(agent, index){%>'<%=objectFindByKey(agentSpec, 'id', agent).name%>Services',<% });%> function($rootScope, $q, $filter, $timeout, $eventsCommon, RestService, SocketService<% _.each(agents, function(agent, index){%>
       ,<%=objectFindByKey(agentSpec, 'id', agent).name%>Services<% }); %>){
    //CRUD STUFFS
    <% for(element in actions.elements){
    var elementName = element.toLowerCase();%>
      var _<%=elementName%><%=moduleName %> = function(data, id) {
        <% if (element == 'FIND') {%>
          var data = data || {};
          return $q.when(RestService['FIND']('<%=actions.url%>', data));
        <% } else if (element == 'GET') {%>
          return $q.when(RestService['FINDBYID']('<%=actions.url%>', id));
        <% } else if (element == 'DELETE') {%>
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', null, id));
        <% } else if (element == 'POST') {%>
          var data = data;
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', data));
        <% } else if (element == 'PUT') {%>
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', data, id));
        <% }%>
      }
    <% if (element == 'FIND') {%>
      var _columnDefs = [ <%
          var elems = actions.elements.FIND.components.elements;
          Object.keys(elems).forEach(function(elem, index, test) {
            var element = elems[elem]; %> { <%
              if (element.type == "typeAhead" || element.type == "select") { %> <%
                if (element.ui.hasTitle) { %>
              field: '<%=element.ui.title%>.title',
                <%
                } else { %>
              field: '<%=element.ui.title%>',
                <%<commit_msg>selects values in grids working again<commit_after><%//used for extracting objects from the spec
var objectFindByKey = function(array, key, value) {
   for (var i = 0; i < array.length; i++) {
     if (array[i][key] == value) {
       return array[i];
     }
   }
   return null;
 }%>
angular.module('<%=moduleName %>')

  .factory('<%=moduleName %>Services', ['$rootScope', '$q', '$filter', '$timeout', '$eventsCommon', 'RestService', 'SocketService', <% _.each(agents, function(agent, index){%>'<%=objectFindByKey(agentSpec, 'id', agent).name%>Services',<% });%> function($rootScope, $q, $filter, $timeout, $eventsCommon, RestService, SocketService<% _.each(agents, function(agent, index){%>
       ,<%=objectFindByKey(agentSpec, 'id', agent).name%>Services<% }); %>){
    //CRUD STUFFS
    <% for(element in actions.elements){
    var elementName = element.toLowerCase();%>
      var _<%=elementName%><%=moduleName %> = function(data, id) {
        <% if (element == 'FIND') {%>
          var data = data || {};
          return $q.when(RestService['FIND']('<%=actions.url%>', data));
        <% } else if (element == 'GET') {%>
          return $q.when(RestService['FINDBYID']('<%=actions.url%>', id));
        <% } else if (element == 'DELETE') {%>
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', null, id));
        <% } else if (element == 'POST') {%>
          var data = data;
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', data));
        <% } else if (element == 'PUT') {%>
          return $q.when(RestService['<%=element%>']('<%=actions.url%>', data, id));
        <% }%>
      }
    <% if (element == 'FIND') {%>
      var _columnDefs = [ <%
          var elems = actions.elements.FIND.components.elements;
          Object.keys(elems).forEach(function(elem, index, test) {
            var element = elems[elem]; %> { <%
              if (element.type == "typeAhead" || element.type == "select") { %> <%
                if (element.ui.hasTitle) { %>
              field: '<%=elem%>.title',
                <%
                } else { %>
              field: '<%=elem%>',
                <%
{'fraction_non_alphanumeric': 0.22330547818013, 'fraction_numerical': 0.00046425255338904364, 'mean_word_length': 2.7798245614035086, 'pattern_counts': {'":': 0, '<': 73, '<?xml version=': 0, '>': 69, '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': '2635917', 'n_tokens_mistral': 1438, 'n_tokens_neox': 1362, 'n_words': 273}