<commit_before><div class="btn-group refresh-button">

  <button type="button"
          onclick="cronenberg.dashboards.refresh()"
          class="btn btn-default"
          data-toggle="tooltip"
          data-placement="bottom"
          title="Refresh">
    <i class="fa fa-lg fa-refresh"></i>
  </button>

  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
    <span class="caret"
          data-toggle="tooltip"
          data-placement="bottom"
          title="Set Refresh Options"
          ></span>
    <span class="sr-only">Toggle Dropdown</span>
  </button>

  <ul class="dropdown-menu dropdown-menu-right ds-refresh-menu" role="menu">
    <li style="display:none" data-fullscreen="show" role="presentation" class="dropdown-header"><i class="fa fa-clock-o"></i> Recent Time Range</li>
    <li style="display:none" data-fullscreen="show" class="divider"></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-1h">Past Hour</a></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-3h">Past 3 Hours</a></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-6h">Past 6 Hours</a></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-12h">Past 12 Hours</a></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-1d">Past Day</a></li>
    <li style="display:none" data-fullscreen="show"><a href="#" data-range="-7d">Past Week</a></li>
    <br style="display:none" data-fullscreen="show"/>
    <li role="presentation" class="dropdown-header"><i class="fa fa-clock-o"></i> Auto Refresh</li>
    <li class="divider"></li>
    <li><a href="#" data-interval="0" >None</a></li>
    <li><a href="#" data-interval="2" >2 seconds</a></li>
    <li><a href="#" data-interval="30" >30 seconds</a></li>
    <li><a href="#" data-interval="60" >1 minute</a></li>
    <li><a href="#" data-interval="120">2 minutes</a></li>
    <li><a href="#" data-interval="300">5 minutes</a></li>
    <li><a href="#" data-interval="600">10 minutes</a></li>
    <li><a href="#" data-interval="1800">30 minutes</a></li>
    <li><a href="#" data-interval="3600">1 hour</a></li>
  </ul>

  <script>
    $("ul.ds-refresh-menu a").click(function(e) {
        var target = $(e.target);
        if (target.attr('data-range')) {
            cronenberg.dashboards.set_time_range(target.attr('data-range'));
        } else if (target.attr('data-interval')) {
            cronenberg.dashboards.set_refresh_interval(target.attr('data-interval'));
        }
    });
  </script>

</div>
<commit_msg>Handle setting the 'active' class on selected menu items<commit_after><div class="btn-group refresh-button">

  <button type="button"
          onclick="cronenberg.dashboards.refresh()"
          class="btn btn-default"
          data-toggle="tooltip"
          data-placement="bottom"
          title="Refresh">
    <i class="fa fa-lg fa-refresh"></i>
  </button>

  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
    <span class="caret"
          data-toggle="tooltip"
          data-placement="bottom"
          title="Set Refresh Options"
          ></span>
    <span class="sr-only">Toggle Dropdown</span>
  </button>

  <ul class="dropdown-menu dropdown-menu-right ds-refresh-menu" role="menu">
    <li style="display:none" data-fullscreen="show" role="presentation" class="dropdown-header"><i class="fa fa-clock-o"></i> Recent Time Range</li>
    <li style="display:none" data-fullscreen="show" class="divider"></li>
    <li style="display:none" data-fullscreen="show" data-range="-1h"><a href="#">Past Hour</a></li>
    <li style="display:none" data-fullscreen="show" data-range="-3h"><a href="#">Past 3 Hours</a></li>
    <li style="display:none" data-fullscreen="show" data-range="-6h"><a href="#">Past 6 Hours</a></li>
    <li style="display:none" data-fullscreen="show" data-range="-12h"><a href="#">Past 12 Hours</a></li>
    <li style="display:none" data-fullscreen="show" data-range="-1d"><a href="#">Past Day</a></li>
    <li style="display:none" data-fullscreen="show" data-range="-7d"><a href="#">Past Week</a></li>
    <br style="display:none" data-fullscreen="show"/>
    <li role="presentation" class="dropdown-header"><i class="fa fa-clock-o"></i> Auto Refresh</li>
    <li class="divider"></li>
    <li data-interval="0"><a href="#">None</a></li>
    <li data-interval="30"><a href="#">30 seconds</a></li>
    <li data-interval="60"><a href="#">1 minute</a></li>
    <li data-interval="120"><a href="#">2 minutes</a></li>
    <li data-interval="300"><a href="#">5 minutes</a></li>
    <li data-interval="600"><a href="#">10 minutes</a></li>
    <li data-interval="1800"><a href="#">30 minutes</a></li>
    <li data-interval="3600"><a href="#">1 hour</a></li>
  </ul>

  <script>
    $("ul.ds-refresh-menu li").on('click', 'a', function(e) {
        var target = $(e.target).parent();
        console.log(target);
        if (target.attr('data-range')) {
            var range = target.attr('data-range');
            cronenberg.dashboards.set_time_range(range);
            $("ul.ds-refresh-menu li[data-range]").removeClass('active');
            $("ul.ds-refresh-menu li[data-range=" + range + "]").addClass('active');
        } else if (target.attr('data-interval')) {
            var interval = target.attr('data-interval');
            cronenberg.dashboards.set_refresh_interval(interval);
            $("ul.ds-refresh-menu li[data-interval]").removeClass('active');
            $("ul.ds-refresh-menu li[data-interval=" + interval + "]").addClass('active');
        }
    });
  </script>

</div>

{'fraction_non_alphanumeric': 0.2223197052114406, 'fraction_numerical': 0.015441305492191613, 'mean_word_length': 3.6530612244897958, 'pattern_counts': {'":': 0, '<': 177, '<?xml version=': 0, '>': 177, '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': '3100852', 'n_tokens_mistral': 1936, 'n_tokens_neox': 1841, 'n_words': 339}