<commit_before>$.fn.dynasize = function() {

  var _MAX = 500;   // Max font size to render
  var _MIN = 1;     // Min font size to render
  var bins = {};    // For common buckets

  // Optimistically size the elements
  var ret = this.each(function() {
      var h = $(this).height();
      var w = $(this).width();
      var el = $(this).children("span");

      // Binary search for max size
      for (var low = _MIN, high = _MAX, rounds = 0; low < high && rounds < 50; rounds) {
        var mid = ~~((high+low)/2);
        el.css('font-size', mid);
        if (el.height() > h || el.width() > w) high = mid;
        else if (el.height() < h || el.width() < w) low = mid + 1;
        else break;
      }

      // Log computed size if part of a set
      var group = $(this).data('sizegroup');
      if (group) {
        if (bins[group]) bins[group].push(mid);
        else bins[group] = [mid];
      }
    });

    // Unify the sizes for grouped items<commit_msg>Safety fix for dynamic resizing<commit_after>$.fn.dynasize = function() {

  var _MAX = 500;   // Max font size to render
  var _MIN = 1;     // Min font size to render
  var bins = {};    // For common buckets

  // Optimistically size the elements
  var ret = this.each(function() {
      var h = $(this).height();
      var w = $(this).width();
      var el = $(this).children("span");

      // Binary search for max size
      for (var low = _MIN, high = _MAX, rounds = 0; low < high && rounds < 50; rounds++) {
        var mid = ~~((high+low)/2);
        el.css('font-size', mid);
        if (el.height() > h || el.width() > w) high = mid;
        else if (el.height() < h || el.width() < w) low = mid + 1;
        else break;
      }

      // Log computed size if part of a set
      var group = $(this).data('sizegroup');
      if (group) {
        if (bins[group]) bins[group].push(mid);
        else bins[group] = [mid];
      }
    });

    // Unify the sizes for grouped items
{'fraction_non_alphanumeric': 0.1644535240040858, 'fraction_numerical': 0.009193054136874362, 'mean_word_length': 2.0184899845916795, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3671048', 'n_tokens_mistral': 658, 'n_tokens_neox': 614, 'n_words': 213}