<commit_before>'use strict';

// Initialize highlight.js
window.hljs.initHighlightingOnLoad();

function evalChartistCode(code, chartElement) {
  // Modify the code to use a proper selector using the ID of the example as well as return the Chartist object
  var modified = code.replace(/.*Chartist\s*\.\s*(.+)\(\s*['"](.+)['"]/, function(match, type) {
    return ['var chart = new Chartist.', type, '(chartElement'].join('');
  }) + '; return chart;';

  // Remove any declaration of $chart as we are passing $chart to our function eval
  modified = modified.replace(/var \$chart.+;/, '');

  if(chartElement.__chartist__) {
    chartElement.__chartist__.detach();
  }
  var $chartElement = $(chartElement).empty();

  try {
    // Create function from the modified code and execute it
    return (new Function(['chartElement', '$chart'], modified)(chartElement, $chartElement)); // jshint ignore:line
  } catch(err) {
    // Maybe show error in the future
  }
}

// Generic data-* driven control behaviour
$(function() {
  $('[data-toggle-visible]').each(function() {
    var $element = $(this),
      $target = $($element.data('toggleVisible'));

    $target.addClass('invisible');<commit_msg>doc: removed unecessary code from example code evaluator<commit_after>'use strict';

// Initialize highlight.js
window.hljs.initHighlightingOnLoad();

function evalChartistCode(code, chartElement) {
  // Modify the code to use a proper selector using the ID of the example as well as return the Chartist object
  var modified = code.replace(/.*Chartist\s*\.\s*(.+)\(\s*['"](.+)['"]/, function(match, type) {
    return ['var chart = new Chartist.', type, '(chartElement'].join('');
  }) + '; return chart;';

  // Remove any declaration of $chart as we are passing $chart to our function eval
  modified = modified.replace(/var \$chart.+;/, '');

  var $chartElement = $(chartElement).empty();

  try {
    // Create function from the modified code and execute it
    return (new Function(['chartElement', '$chart'], modified)(chartElement, $chartElement)); // jshint ignore:line
  } catch(err) {
    // Maybe show error in the future
  }
}

// Generic data-* driven control behaviour
$(function() {
  $('[data-toggle-visible]').each(function() {
    var $element = $(this),
      $target = $($element.data('toggleVisible'));

    $target.addClass('invisible');
{'fraction_non_alphanumeric': 0.16673737802291047, 'fraction_numerical': 0.0, 'mean_word_length': 3.9642105263157896, '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': '6846780', 'n_tokens_mistral': 693, 'n_tokens_neox': 670, 'n_words': 210}