<commit_before>var XDemo = undefined;
(function() {

  var updatePreview = function(preview, source) {
    preview.document.open();
    preview.document.write(source);
    preview.document.close();
  };

  if(document.currentScript) {
    var localDoc = document.currentScript.ownerDocument;
  } else {
    var localDoc = document._currentScript.ownerDocument;
  }
  var proto = Object.create(HTMLElement.prototype);

  Object.defineProperty(proto, "src", { get: function() { return src; }, set: function(newSrc) { src = newSrc; this.load(); } });

  proto.createdCallback = function() {
    if(this.createShadowRoot) {
      this._root = this.createShadowRoot();
    } else {
      this._root = this.webkitCreateShadowRoot();
    }

    var tplContent = localDoc.querySelector("template").content;
    this._root.appendChild(tplContent.cloneNode(true));

    var self    = this,
    previewElem = self._root.getElementById("preview");

    self.source = self._root.getElementById("source");
    self.preview = (previewElem.contentWindow) ? previewElem.contentWindow :
                     (previewElem.contentDocument.document) ? previewElem.contentDocument.document : previewElem.contentDocument;

    self.source.addEventListener("keyup", function(e) { e.stopPropagation(); return false });

    this.load = function() {
      if(!self.src) throw new Error("Can't load without a source");

      var xhr = new XMLHttpRequest();
      xhr.onload = function() {
        self.source.value = this.responseText;<commit_msg>Fixing the HTML Import for the polyfill<commit_after>var XDemo = undefined;
(function() {

  var updatePreview = function(preview, source) {
    preview.document.open();
    preview.document.write(source);
    preview.document.close();
  };
  
  // The polyfill needs to take precedence or it will reference the wrong document
  if(document._currentScript) {
    var localDoc = document._currentScript.ownerDocument;
  } else {
    var localDoc = document.currentScript.ownerDocument;
  }
  var proto = Object.create(HTMLElement.prototype);

  Object.defineProperty(proto, "src", { get: function() { return src; }, set: function(newSrc) { src = newSrc; this.load(); } });

  proto.createdCallback = function() {
    if(this.createShadowRoot) {
      this._root = this.createShadowRoot();
    } else {
      this._root = this.webkitCreateShadowRoot();
    }

    var tplContent = localDoc.querySelector("template").content;
    this._root.appendChild(tplContent.cloneNode(true));

    var self    = this,
    previewElem = self._root.getElementById("preview");

    self.source = self._root.getElementById("source");
    self.preview = (previewElem.contentWindow) ? previewElem.contentWindow :
                     (previewElem.contentDocument.document) ? previewElem.contentDocument.document : previewElem.contentDocument;

    self.source.addEventListener("keyup", function(e) { e.stopPropagation(); return false });

    this.load = function() {
      if(!self.src) throw new Error("Can't load without a source");

      var xhr = new XMLHttpRequest();
      xhr.onload = function() {
        self.source.value = this.responseText;
{'fraction_non_alphanumeric': 0.12872542802790107, 'fraction_numerical': 0.0, 'mean_word_length': 3.674074074074074, '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': '2459043', 'n_tokens_mistral': 892, 'n_tokens_neox': 870, 'n_words': 180}