<commit_before><script>

(function() {

  var modules = {};

  var DomModule = function() {
    return document.createElement('dom-module');
  };

  DomModule.prototype = {

    constructor: DomModule,

    createdCallback: function() {
      if (this.id || this.name) {
        modules[this.id || this.name] = this;
      }
    },

    import: function(id, slctr) {
      var m = modules[id];
      if (m && slctr) {
        m = m.querySelector(slctr);
      }
      return m;
    },
    
    __proto__: HTMLElement.prototype

  };

  document.registerElement('dom-module', DomModule);

})();

</script><commit_msg>Force registering `dom-module` to immediately upgrade the document tree. This enables it to be used synchronously by scripts processed by the HTMLImports polyfill.<commit_after><script>

(function() {

  var modules = {};

  var DomModule = function() {
    return document.createElement('dom-module');
  };

  DomModule.prototype = {

    constructor: DomModule,

    createdCallback: function() {
      if (this.id || this.name) {
        modules[this.id || this.name] = this;
      }
    },

    import: function(id, slctr) {
      var m = modules[id];
      if (m && slctr) {
        m = m.querySelector(slctr);
      }
      return m;
    },
    
    __proto__: HTMLElement.prototype

  };

  // TODO(sorvell): dubious fix here; HTMLImports polyfill does not
  // block scripts on upgrading elements. However, we want to ensure that
  // any dom-module in the tree is available prior to a subsequent script
  // processing.
  // Therefore, we force any dom-modules in the tree to upgrade when dom-module
  // is registered by temporarily setting CE polyfill to crawl the entire
  // imports tree. (Note: this should only upgrade any imports that have been
  // loaded by this point. In addition the HTMLImports polyfill should be 
  // changed to upgrade elements prior to running any scripts.)
  if (window.CustomElements) {
    var ready = CustomElements.ready;
    CustomElements.ready = true;
  }
  document.registerElement('dom-module', DomModule);
  if (window.CustomElements) {
    CustomElements.ready = ready;
  }

})();

</script>
{'fraction_non_alphanumeric': 0.11614993058769088, 'fraction_numerical': 0.0, 'mean_word_length': 2.7797202797202796, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '7568653', 'n_tokens_mistral': 637, 'n_tokens_neox': 623, 'n_words': 195}