<commit_before><% wrap_layout :layout do %>
  <% content_for :head do %>
    <script>
      $(function() {
        // Restoring method visibility preference from localStorage
        function initApiOptions() {
          var type = this.getAttribute('data-type'),
            checked = localStorage.getItem('api-options-' + type);

          if (checked != undefined) {
            // Bools are stored as strings in localStorage
            checked = checked == 'true';
            $(this).attr('checked', checked);
          }
        };

        // Type toggling
        function toggleType() {
          var type = this.getAttribute('data-type');

          $('.'+type).toggle(this.checked);
          localStorage.setItem('api-options-' + type, this.checked);
        }

        $('#api-options input').each(initApiOptions);
        $('#api-options input').each(toggleType);
        $('#api-options input').on('change', toggleType);

        // Tabs
        $('.tabs .pane').hide();
        $('.tabs .pane:first').show();
        $('.tabs ul li:first').addClass('active');

        function showPane($tabs, href) {
          var $ul = $tabs.find('> ul'),
              $tab = $ul.find('a[href='+href+']'),
              $pane = $(href);

          $ul.find('li').removeClass('active');
          $tab.parent().addClass('active');
          $tabs.find('.pane').hide();

          $pane.show();
        }<commit_msg>no api opts remembering when localStorage is not available<commit_after><% wrap_layout :layout do %>
  <% content_for :head do %>
    <script>
      $(function() {
        var ls = window['localStorage'];

        // Restoring method visibility preference from localStorage
        function initApiOptions() {
          var type = this.getAttribute('data-type'),
            checked = ls ? ls.getItem('api-options-' + type) : undefined;

          if (checked != undefined) {
            // Bools are stored as strings in localStorage
            checked = checked == 'true';
            $(this).attr('checked', checked);
          }
        };

        // Type toggling
        function toggleType() {
          var type = this.getAttribute('data-type');

          $('.'+type).toggle(this.checked);

          if(ls)
            ls.setItem('api-options-' + type, this.checked);
        }

        $('#api-options input').each(initApiOptions);
        $('#api-options input').each(toggleType);
        $('#api-options input').on('change', toggleType);

        // Tabs
        $('.tabs .pane').hide();
        $('.tabs .pane:first').show();
        $('.tabs ul li:first').addClass('active');

        function showPane($tabs, href) {
          var $ul = $tabs.find('> ul'),
              $tab = $ul.find('a[href='+href+']'),
              $pane = $(href);

          $ul.find('li').removeClass('active');
          $tab.parent().addClass('active');
          $tabs.find('.pane').hide();

          $pane.show();
        }
{'fraction_non_alphanumeric': 0.17755102040816326, 'fraction_numerical': 0.0, 'mean_word_length': 1.9528112449799198, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '7111176', 'n_tokens_mistral': 819, 'n_tokens_neox': 801, 'n_words': 172}