<commit_before>(function ($) {

  "use strict";

  /****
   ****
   ****  Tools
   ****
   ****/

  function clearFormFields($element)
  {
    $element.find('input:text, input:password, input:file, select').val('');
    $element.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');
  }

  /****
   ****
   ****  Generic
   ****
   ****/

  $(function ()
    {
      var $navigation = $('#navigation');
      $navigation.hover(
        function()
          {
            $navigation.addClass('expanded');
          },
        function()
          {
            $navigation.removeClass('expanded');
          });

    });

  /****
   ****
   ****  Google Maps
   ****
   ****/

  $(function ()
    {
      var $container = $('.simple-map');

      if (!$container.length)
      {
        return;
      }

      window.initializeSimpleMap = function()
        {
          var location = new google.maps.LatLng($container.data('latitude'), $container.data('longitude'));
          var map = new google.maps.Map($container.get(0), {
              zoom: 16,
              center: location,
              panControl: false,
              mapTypeControl: true,
              zoomControl: true,
              scaleControl: false,
              streetViewControl: false,
              mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU },
              mapTypeId: google.maps.MapTypeId.ROADMAP,
              zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL },
            });
          var marker = new google.maps.Marker({ position: location, map: map});
        };

      $.getScript('https://maps.google.com/maps/api/js?sensor=false&callback=initializeSimpleMap&key=' + $container.data('key'));
    });

  /****
   ****
   ****  jQuery Masonry
   ****
   ****/

  $(function ()
    {
      var $container = $('.masonry');
      $container.imagesLoaded(function() {
        $container.masonry({
          itemSelector: '.brick',
          isAnimated: true
        });
      });
    });

  /****
   ****
   ****  jQuery miniColors
   ****
   ****/

  $(function ()
    {
      if ($.isFunction($.fn.miniColors))
      {
        $('input.color-picker').miniColors({
            opacity: false,
            readonly: false,
            letterCase: 'lowercase',
            disabled: false
          });
      }
    });

  /****
   ****
   ****  Autocomplete plugin
   ****
   ****/

  var Autocomplete = function (element)
    {
      this.$element = element;
      this.$menu = $('<div id="search-suggestions" class="search-popover"></div>').appendTo('body');
      this.$realm = this.$element.parent().find('#search-realm');

      this.source = this.$element.closest('form').data('autocomplete');
      this.shown = false;
      this.timeout = 150;

      this.listen();
      this.showRealm();
    };

  Autocomplete.prototype = {

    constructor: Autocomplete,

    listen: function()
      {
        $(window)
          .on('resize', $.proxy(this.resize, this));

        this.$element
          .on('focus', $.proxy(this.focus, this))
          .on('blur', $.proxy(this.blur, this))
          .on('keypress', $.proxy(this.keypress, this))
          .on('keyup', $.proxy(this.keyup, this));

        if ($.browser.webkit || $.browser.msie)
        {
          this.$element.on('keydown', $.proxy(this.keypress, this));
        }

        this.$menu.on('mouseenter', 'li', $.proxy(this.mouseenter, this));
      },

    resize: function()
      {
        this.hide();
        this.hideRealm();
      },

    locate: function ($item)
      {
        var pos = $.extend({}, this.$element.position(), {
          height: this.$element[0].offsetHeight,
          width: this.$element.outerWidth()
        });<commit_msg>Get position relative to the doc<commit_after>(function ($) {

  "use strict";

  /****
   ****
   ****  Tools
   ****
   ****/

  function clearFormFields($element)
  {
    $element.find('input:text, input:password, input:file, select').val('');
    $element.find('input:radio, input:checkbox').removeAttr('checked').removeAttr('selected');
  }

  /****
   ****
   ****  Generic
   ****
   ****/

  $(function ()
    {
      var $navigation = $('#navigation');
      $navigation.hover(
        function()
          {
            $navigation.addClass('expanded');
          },
        function()
          {
            $navigation.removeClass('expanded');
          });

    });

  /****
   ****
   ****  Google Maps
   ****
   ****/

  $(function ()
    {
      var $container = $('.simple-map');

      if (!$container.length)
      {
        return;
      }

      window.initializeSimpleMap = function()
        {
          var location = new google.maps.LatLng($container.data('latitude'), $container.data('longitude'));
          var map = new google.maps.Map($container.get(0), {
              zoom: 16,
              center: location,
              panControl: false,
              mapTypeControl: true,
              zoomControl: true,
              scaleControl: false,
              streetViewControl: false,
              mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.DROPDOWN_MENU },
              mapTypeId: google.maps.MapTypeId.ROADMAP,
              zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL },
            });
          var marker = new google.maps.Marker({ position: location, map: map});
        };

      $.getScript('https://maps.google.com/maps/api/js?sensor=false&callback=initializeSimpleMap&key=' + $container.data('key'));
    });

  /****
   ****
   ****  jQuery Masonry
   ****
   ****/

  $(function ()
    {
      var $container = $('.masonry');
      $container.imagesLoaded(function() {
        $container.masonry({
          itemSelector: '.brick',
          isAnimated: true
        });
      });
    });

  /****
   ****
   ****  jQuery miniColors
   ****
   ****/

  $(function ()
    {
      if ($.isFunction($.fn.miniColors))
      {
        $('input.color-picker').miniColors({
            opacity: false,
            readonly: false,
            letterCase: 'lowercase',
            disabled: false
          });
      }
    });

  /****
   ****
   ****  Autocomplete plugin
   ****
   ****/

  var Autocomplete = function (element)
    {
      this.$element = element;
      this.$menu = $('<div id="search-suggestions" class="search-popover"></div>').appendTo('body');
      this.$realm = this.$element.parent().find('#search-realm');

      this.source = this.$element.closest('form').data('autocomplete');
      this.shown = false;
      this.timeout = 150;

      this.listen();
      this.showRealm();
    };

  Autocomplete.prototype = {

    constructor: Autocomplete,

    listen: function()
      {
        $(window)
          .on('resize', $.proxy(this.resize, this));

        this.$element
          .on('focus', $.proxy(this.focus, this))
          .on('blur', $.proxy(this.blur, this))
          .on('keypress', $.proxy(this.keypress, this))
          .on('keyup', $.proxy(this.keyup, this));

        if ($.browser.webkit || $.browser.msie)
        {
          this.$element.on('keydown', $.proxy(this.keypress, this));
        }

        this.$menu.on('mouseenter', 'li', $.proxy(this.mouseenter, this));
      },

    resize: function()
      {
        this.hide();
        this.hideRealm();
      },

    locate: function ($item)
      {
        var pos = $.extend({}, this.$element.offset(), {
          height: this.$element[0].offsetHeight,
          width: this.$element.outerWidth()
        });
{'fraction_non_alphanumeric': 0.18567849136225767, 'fraction_numerical': 0.0018462349993406304, 'mean_word_length': 1.9259259259259258, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '7436174', 'n_tokens_mistral': 2262, 'n_tokens_neox': 2175, 'n_words': 343}