<commit_before>/*exported settingsCreator */
function settingsCreator() {
   'use strict';

   var settings = {
      rootNode: document,
      defaultScope: constants.scope.multiInstance,
      moduleSettingsSelector: 'script[type="%name%/settings"],script[type="true/%name%/settings"]',
      partSettingsSelector: 'head script[type="%name%/settings"]',
      attribute: 'modules',
      selector: '[%attribute%]',
      domMutationSupport: false,
      customIdAttribute: 'mom-id'
   };


   function init() {
      settings.actualSelector = replacePlaceholder(settings.selector, 'attribute', settings.attribute);
      settings.mergeWith = mergeWith;
      settings.getModuleSettingsSelector = getModuleSettingsSelelector;
      settings.getPartSettingsSelector = getPartSettingsSelector;
   }


   function getModuleSettingsSelelector(moduleName) {
      return replacePlaceholder(settings.moduleSettingsSelector, 'name', moduleName);
   }

   function getPartSettingsSelector(partName) {
      return replacePlaceholder(settings.partSettingsSelector, 'name', partName);
   }

   function replacePlaceholder(text, placeholder, value) {
      var actualPlaceholder = '%' + placeholder + '%',
         regEx,
         result = text;

      if (stringContains(text, actualPlaceholder)) {
         regEx = new RegExp(actualPlaceholder, 'g');

         result = text.replace(regEx, value);
      }

      return result;
   }

   function mergeWith(newSettings) {
      merge(settings, newSettings);
      init();
   }

   init();

   return settings;
}<commit_msg>merging develop<commit_after>/*exported settingsCreator */
function settingsCreator() {
  'use strict';

  var settings = {
    rootNode: document,
    defaultScope: constants.scope.multiInstance,
    moduleSettingsSelector: 'script[type="%name%/settings"],script[type="true/%name%/settings"]',
    partSettingsSelector: 'head script[type="%name%/settings"]',
    attribute: 'modules',
    selector: '[%attribute%]',
    domMutationSupport: false,
    customIdAttribute: 'mom-id'
  };

  init();

  return settings;

  //////////////////////////////////////////////////////////

  function init() {
    settings.actualSelector = replacePlaceholder(settings.selector, 'attribute', settings.attribute);
    settings.mergeWith = mergeWith;
    settings.getModuleSettingsSelector = getModuleSettingsSelelector;
    settings.getPartSettingsSelector = getPartSettingsSelector;
  }


  function getModuleSettingsSelelector(moduleName) {
    return replacePlaceholder(settings.moduleSettingsSelector, 'name', moduleName);
  }

   function getPartSettingsSelector(partName) {
      return replacePlaceholder(settings.partSettingsSelector, 'name', partName);
   }

   function replacePlaceholder(text, placeholder, value) {
      var actualPlaceholder = '%' + placeholder + '%',
         regEx,
         result = text;

      if (stringContains(text, actualPlaceholder)) {
         regEx = new RegExp(actualPlaceholder, 'g');

         result = text.replace(regEx, value);
      }

      return result;
   }

   function mergeWith(newSettings) {
      merge(settings, newSettings);
      init();
   }
}
{'fraction_non_alphanumeric': 0.13181242078580482, 'fraction_numerical': 0.0, 'mean_word_length': 3.459039548022599, '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': '7221617', 'n_tokens_mistral': 858, 'n_tokens_neox': 832, 'n_words': 159}