<commit_before>$(function() { 
  var $el = $('<div/>').addClass(css_prefix + 'tooltip');
  var $help = $('<div/>').addClass(css_prefix + 'help_popup').appendTo('div.sidebar');
  var exposed = false;
  var help_shown = false;

  // Input html can have some basic markup.  Things between <<>> will be turned into a 'code' span block,
  // things between <[]> will be placed in a bounding box to indicate input (no nested boxes or code blocks), 
  // and things between || become an 'explanation' span.  \n changed to <br>
  var markup = function(html) {
  	return html.replace(/<\[([^>]*)\]>/g,'<span class="box">$1</span>').replace(/<<(.*)>>/g,'<span class="code">$1</span>').replace(/\n/g,'<br>').replace(/\|(.*)\|/g,'<span class="explanation">$1</span>');
  }
  // Create a tooltip with content HTML and location topblock.  Optional leftblock can be used as a different element to use for left position.  Assumes blocks are within sc_element_container
  var createTooltip = SwiftCalcs.createTooltip = function(html, topBlock, leftBlock) {
  	destroyTooltip();
    var container = $('.sc_element_container');
    var container_offset = container.offset();
  	if(typeof leftBlock === 'undefined') leftBlock = topBlock;
    var leftOffset = leftBlock.offset().left - 13;
    var topOffset = topBlock.offset().top  - container_offset.top + topBlock.height() + 18;
    if($('.top_warning').length) topOffset += $('.top_warning').height()+8;
    var $arrow = $('<div/>').addClass(css_prefix + 'arrow');
    var $close = $('<div/>').addClass(css_prefix + 'close').html('Close').on('click', function() { SwiftCalcs.destroyTooltip(); });
    $el.html(markup(html)).append($arrow).append($close);

    $($el).appendTo(container);

    if(leftOffset > ($(window).width()/2)) {
    	$arrow.addClass('right');
    	leftOffset -= ($el.width() - 26);<commit_msg>Make help tooltip always appear, even if toolbox is collapsed<commit_after>$(function() { 
  var $el = $('<div/>').addClass(css_prefix + 'tooltip');
  var $help = $('<div/>').addClass(css_prefix + 'help_popup').insertAfter('div.sidebar');
  var exposed = false;
  var help_shown = false;

  // Input html can have some basic markup.  Things between <<>> will be turned into a 'code' span block,
  // things between <[]> will be placed in a bounding box to indicate input (no nested boxes or code blocks), 
  // and things between || become an 'explanation' span.  \n changed to <br>
  var markup = function(html) {
  	return html.replace(/<\[([^>]*)\]>/g,'<span class="box">$1</span>').replace(/<<(.*)>>/g,'<span class="code">$1</span>').replace(/\n/g,'<br>').replace(/\|(.*)\|/g,'<span class="explanation">$1</span>');
  }
  // Create a tooltip with content HTML and location topblock.  Optional leftblock can be used as a different element to use for left position.  Assumes blocks are within sc_element_container
  var createTooltip = SwiftCalcs.createTooltip = function(html, topBlock, leftBlock) {
  	destroyTooltip();
    var container = $('.sc_element_container');
    var container_offset = container.offset();
  	if(typeof leftBlock === 'undefined') leftBlock = topBlock;
    var leftOffset = leftBlock.offset().left - 13;
    var topOffset = topBlock.offset().top  - container_offset.top + topBlock.height() + 18;
    if($('.top_warning').length) topOffset += $('.top_warning').height()+8;
    var $arrow = $('<div/>').addClass(css_prefix + 'arrow');
    var $close = $('<div/>').addClass(css_prefix + 'close').html('Close').on('click', function() { SwiftCalcs.destroyTooltip(); });
    $el.html(markup(html)).append($arrow).append($close);

    $($el).appendTo(container);

    if(leftOffset > ($(window).width()/2)) {
    	$arrow.addClass('right');
    	leftOffset -= ($el.width() - 26);
{'fraction_non_alphanumeric': 0.19402188417400587, 'fraction_numerical': 0.005871363757672805, 'mean_word_length': 4.27887323943662, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 43, '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': '5737315', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1144, 'n_words': 300}