<commit_before>(function () {
  "use strict";

  angular.module('mnSettingsClusterService', [
    'mnPoolDefault'
  ]).factory('mnSettingsClusterService', mnSettingsClusterServiceFactory);

  function mnSettingsClusterServiceFactory($http, $q, IEC, mnPoolDefault) {
    var mnSettingsClusterService = {
      postPoolsDefault: postPoolsDefault,
      getIndexSettings: getIndexSettings,
      postIndexSettings: postIndexSettings,
      getLogRedaction: getLogRedaction,
      postLogRedaction: postLogRedaction
    };

    return mnSettingsClusterService;

    function getLogRedaction() {
      return $http.get("/settings/logRedaction").then(function (resp) {
        return resp.data;
      });
    }

    function postLogRedaction(data) {
      return $http.post("/settings/logRedaction", data);
    }

    function maybeSetQuota(data, memory, service, key) {
      if (!memory.services || memory.services.model[service]) {
        if (memory[key] === null) {
          data[key] = "";
        } else {
          data[key] = memory[key];
        }
      }
    }

    function postPoolsDefault(memoryQuotaConfig, justValidate, clusterName) {
      var data = {
        clusterName: clusterName
      };

      if (memoryQuotaConfig) {
        maybeSetQuota(data, memoryQuotaConfig, "kv", "memoryQuota");
        maybeSetQuota(data, memoryQuotaConfig, "index", "indexMemoryQuota");
        maybeSetQuota(data, memoryQuotaConfig, "fts", "ftsMemoryQuota");
      }

      if (mnPoolDefault.export.isEnterprise) {<commit_msg>MB-28129: read isEnterprise from mnPools<commit_after>(function () {
  "use strict";

  angular.module('mnSettingsClusterService', [
    'mnPools'
  ]).factory('mnSettingsClusterService', mnSettingsClusterServiceFactory);

  function mnSettingsClusterServiceFactory($http, $q, IEC, mnPools) {
    var mnSettingsClusterService = {
      postPoolsDefault: postPoolsDefault,
      getIndexSettings: getIndexSettings,
      postIndexSettings: postIndexSettings,
      getLogRedaction: getLogRedaction,
      postLogRedaction: postLogRedaction
    };

    return mnSettingsClusterService;

    function getLogRedaction() {
      return $http.get("/settings/logRedaction").then(function (resp) {
        return resp.data;
      });
    }

    function postLogRedaction(data) {
      return $http.post("/settings/logRedaction", data);
    }

    function maybeSetQuota(data, memory, service, key) {
      if (!memory.services || memory.services.model[service]) {
        if (memory[key] === null) {
          data[key] = "";
        } else {
          data[key] = memory[key];
        }
      }
    }

    function postPoolsDefault(memoryQuotaConfig, justValidate, clusterName) {
      var data = {
        clusterName: clusterName
      };

      if (memoryQuotaConfig) {
        maybeSetQuota(data, memoryQuotaConfig, "kv", "memoryQuota");
        maybeSetQuota(data, memoryQuotaConfig, "index", "indexMemoryQuota");
        maybeSetQuota(data, memoryQuotaConfig, "fts", "ftsMemoryQuota");
      }

      if (mnPools.export.isEnterprise) {
{'fraction_non_alphanumeric': 0.11572409284079764, 'fraction_numerical': 0.0016345210853220007, 'mean_word_length': 3.226519337016575, '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': '832845', 'n_tokens_mistral': 917, 'n_tokens_neox': 891, 'n_words': 158}