<commit_before>/*!
 * Original idea: https://github.com/Nycto/PicoModal
 * Accessibility inspiration: https://github.com/nico3333fr/jquery-accessible-modal-window-aria
 * MIT License (https://github.com/Aymkdn/picoModal-Accessible/blob/master/LICENSE)
*/
!function(name, definition) {
  if (typeof module != 'undefined') module.exports = definition()
  else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
  else this[name] = definition()
}('picoModal', function() {

  var picoModal = (function(window, document) {
    "use strict";

    // Generates observable objects that can be watched and triggered
    var observable = function() {
      var callbacks = [];
      return {
        watch: function(callback) {
          callbacks.push(callback);
        },
        trigger: function() {
          for (var i = 0; i < callbacks.length; i++) {
            window.setTimeout(callbacks[i], 1);
          }
        }
      };
    };

    // A small interface for creating and managing a dom element
    var make = function(parent, tag) {
      if (arguments.length == 1 && typeof parent === "string") {
        tag = parent;
        parent = null;
      }
      tag = tag || 'div';

      var elem = document.createElement(tag);
      (parent || document.body).appendChild(elem);

      var iface = {

        elem: elem,

        // Creates a child of this node
        child: function(tag) {
          return make(elem, tag || 'a');
        },

        // Applies a set of styles to an element
        stylize: function(styles) {
          styles = styles || {};

          if (typeof styles.opacity !== "undefined") {
            styles.filter =
              "alpha(opacity=" + (styles.opacity * 100) + ")";
          }

          for (var prop in styles) {
            if (styles.hasOwnProperty(prop)) {
              elem.style[prop] = styles[prop];
            }
          }

          return iface;
        },

        // Adds a class name
        clazz: function(clazz) {
          elem.className += clazz;
          return iface;
        },
        // set attributes
        setAttr: function(attr) {
          for (var a in attr) {
            if (attr.hasOwnProperty(a)) {
              elem.setAttribute(a, attr[a]);
            }
          }
          return iface;
        },

        // set an element invisible for users but not readers
        invisible: function() {
          this.stylize({
            "border":"0 none",
            "clip":"rect(0px, 0px, 0px, 0px)",
            "height":"1px",
            "margin":"-1px",
            "overflow":"hidden",
            "padding":"0",
            "position":"absolute",
            "width":"1px"
          });
          return iface;
        },

        // Sets the HTML
        html: function(content) {
          elem.innerHTML = content;
          return iface;
        },

        // Returns the width of this element
        getWidth: function() {
          return elem.clientWidth;
        },

        // Adds a click handler to this element
        onClick: function(callback) {
          if (elem.attachEvent) {
            elem.attachEvent('onclick', callback);
          } else {
            elem.addEventListener('click', callback);
          }

          return iface;
        },

        // Removes this element from the DOM
        destroy: function() {
          document.body.removeChild(elem);
          return iface;
        }

      };

      return iface;
    };

    // An interface for generating the grey-out effect
    var overlay = function(getOption) {

      // The registered on click events
      var clickCallbacks = observable();

      // The overlay element
      var elem = make()
        .setAttr({"title":"Close this windows"})
        .clazz("pico-overlay")
        .stylize({
          display: "block",
          position: "fixed",
          top: "0px",
          left: "0px",
          height: "100%",
          width: "100%",
          zIndex: 10000
        })
        .stylize(getOption('overlayStyles', {
          opacity: 0.5,
          background: "#000"
        }))
        .onClick(clickCallbacks.trigger);

      // create a hidden element that permits to be read and that explains we can close the overlay by clicking
      elem.child('span')
        .invisible()
        .setAttr({"tabindex":"0"})
        .html(getOption('closeHtml', "Close"));
      
      return {
        elem: elem.elem,
        destroy: elem.destroy,
        onClick: clickCallbacks.watch
      };
    };

    // Wrap an HTMLElement around another HTMLElement or an array of them.
    // source: http://stackoverflow.com/questions/3337587/wrapping-a-set-of-dom-elements-using-javascript/13169465#13169465
    var wrapAll = function(father, elms) {
        var el = elms.length ? elms[0] : elms;

        // Cache the current parent and sibling of the first element.
        var parent  = el.parentNode;
        var sibling = el.nextSibling;

        // Wrap the first element (is automatically removed from its
        // current parent).
        father.appendChild(el);

        // Wrap all other elements (if applicable). Each element is
        // automatically removed from its current parent and from the elms
        // array.
        while (elms.length) {
            father.appendChild(elms[0]);
        }

        // If the first element had a sibling, insert the wrapper before the
        // sibling to maintain the HTML structure; otherwise, just append it
        // to the parent.
        if (sibling) {
            try { parent.insertBefore(father, sibling) } catch(e) {}
        } else {
            parent.appendChild(father);
        }
    };

    // A function for easily displaying a modal with the given content
    return function(options) {<commit_msg>Other fix<commit_after>/*!
 * Original idea: https://github.com/Nycto/PicoModal
 * Accessibility inspiration: https://github.com/nico3333fr/jquery-accessible-modal-window-aria
 * MIT License (https://github.com/Aymkdn/picoModal-Accessible/blob/master/LICENSE)
*/
!function(name, definition) {
  if (typeof module != 'undefined') module.exports = definition()
  else if (typeof define == 'function' && typeof define.amd == 'object') define(definition)
  else this[name] = definition()
}('picoModal', function() {

  var picoModal = (function(window, document) {
    "use strict";

    // Generates observable objects that can be watched and triggered
    var observable = function() {
      var callbacks = [];
      return {
        watch: function(callback) {
          callbacks.push(callback);
        },
        trigger: function() {
          for (var i = 0; i < callbacks.length; i++) {
            window.setTimeout(callbacks[i], 1);
          }
        }
      };
    };

    // A small interface for creating and managing a dom element
    var make = function(parent, tag) {
      if (arguments.length == 1 && typeof parent === "string") {
        tag = parent;
        parent = null;
      }
      tag = tag || 'div';

      var elem = document.createElement(tag);
      (parent || document.body).appendChild(elem);

      var iface = {

        elem: elem,

        // Creates a child of this node
        child: function(tag) {
          return make(elem, tag || 'a');
        },

        // Applies a set of styles to an element
        stylize: function(styles) {
          styles = styles || {};

          if (typeof styles.opacity !== "undefined") {
            styles.filter =
              "alpha(opacity=" + (styles.opacity * 100) + ")";
          }

          for (var prop in styles) {
            if (styles.hasOwnProperty(prop)) {
              elem.style[prop] = styles[prop];
            }
          }

          return iface;
        },

        // Adds a class name
        clazz: function(clazz) {
          elem.className += clazz;
          return iface;
        },
        // set attributes
        setAttr: function(attr) {
          for (var a in attr) {
            if (attr.hasOwnProperty(a)) {
              elem.setAttribute(a, attr[a]);
            }
          }
          return iface;
        },

        // set an element invisible for users but not readers
        invisible: function() {
          this.stylize({
            "border":"0 none",
            "clip":"rect(0px, 0px, 0px, 0px)",
            "height":"1px",
            "margin":"-1px",
            "overflow":"hidden",
            "padding":"0",
            "position":"absolute",
            "width":"1px"
          });
          return iface;
        },

        // Sets the HTML
        html: function(content) {
          elem.innerHTML = content;
          return iface;
        },

        // Returns the width of this element
        getWidth: function() {
          return elem.clientWidth;
        },

        // Adds a click handler to this element
        onClick: function(callback) {
          if (elem.attachEvent) {
            elem.attachEvent('onclick', callback);
          } else {
            elem.addEventListener('click', callback);
          }

          return iface;
        },

        // Removes this element from the DOM
        destroy: function() {
          document.body.removeChild(elem);
          return iface;
        }

      };

      return iface;
    };

    // An interface for generating the grey-out effect
    var overlay = function(getOption) {

      // The registered on click events
      var clickCallbacks = observable();

      // The overlay element
      var elem = make()
        .setAttr({"title":"Close this windows"})
        .clazz("pico-overlay")
        .stylize({
          display: "block",
          position: "fixed",
          top: "0px",
          left: "0px",
          height: "100%",
          width: "100%",
          zIndex: 10000
        })
        .stylize(getOption('overlayStyles', {
          opacity: 0.5,
          background: "#000"
        }))
        .onClick(clickCallbacks.trigger);

      // create a hidden element that permits to be read and that explains we can close the overlay by clicking
      elem.child('span')
        .invisible()
        .setAttr({"tabindex":"0"})
        .html(getOption('closeHtml', "Close"));
      
      return {
        elem: elem.elem,
        destroy: elem.destroy,
        onClick: clickCallbacks.watch
      };
    };

    // Wrap an HTMLElement around another HTMLElement or an array of them.
    // source: http://stackoverflow.com/questions/3337587/wrapping-a-set-of-dom-elements-using-javascript/13169465#13169465
    var wrapAll = function(father, elms) {
        var el = elms.length ? elms[0] : elms;

        // Cache the current parent and sibling of the first element.
        var parent  = el.parentNode;
        var sibling = el.nextSibling;

        // Wrap the first element (is automatically removed from its
        // current parent).
        father.appendChild(el);

        // Wrap all other elements (if applicable). Each element is
        // automatically removed from its current parent and from the elms
        // array.
        while (elms.length) {
            father.appendChild(elms[0]);
        }

        // If the first element had a sibling, insert the wrapper before the
        // sibling to maintain the HTML structure; otherwise, just append it
        // to the parent.
        if (sibling) {
            try { parent.insertBefore(father, sibling) } catch(e) {}
        } else {
            try { parent.appendChild(father) } catch(e) {}
        }
    };

    // A function for easily displaying a modal with the given content
    return function(options) {
{'fraction_non_alphanumeric': 0.11856246238500559, 'fraction_numerical': 0.010833118390508125, 'mean_word_length': 1.7414565166156022, 'pattern_counts': {'":': 20, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 6, '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': '2791794', 'n_tokens_mistral': 3242, 'n_tokens_neox': 3101, 'n_words': 895}