<commit_before>
- id = "tab_menu_"  + rand(1000).to_s unless defined? id and not id.nil?
- active = false unless defined? active and not active.nil?
- active = headers.first if TrueClass === active
.ui.top.attached.tabular.stackable.menu(id=id)
  - headers.each do |header|
    - code = codes[header] || Misc.digest(header)
    - tab_active = (active and active == header) ? 'active' : ''
    .ui.item(data-tab=code class=tab_active)= header

- headers.each do |header|
  - code = codes[header] || Misc.digest(header)
  - next if content[header].nil?
  - tab_active = (active and active == header) ? 'active' : ''
  .ui.tab.bottom.attached.segment.content(data-tab=code class=tab_active)
    = content[header]

:deferjs
  $("##{id} > .item[data-tab]").tab()

  $('##{id} > .item[data-tab=close]').click(function(item){
    var tool = $(this).parents('.cytoscape_tool').first()
    tool.find('.tab.active, .item.active').removeClass('active')
    return false
  })
<commit_msg>Avoid tab code clash<commit_after>
- id = "tab_menu_"  + rand(1000).to_s unless defined? id and not id.nil?
- active = false unless defined? active and not active.nil?
- active = headers.first if TrueClass === active
.ui.top.attached.tabular.stackable.menu(id=id)
  - headers.each do |header|
    - code = codes[header] ||= Misc.digest([header, id]*"-")
    - tab_active = (active and active == header) ? 'active' : ''
    .ui.item(data-tab=code class=tab_active)= header

- headers.each do |header|
  - code = codes[header] 
  - next if content[header].nil?
  - tab_active = (active and active == header) ? 'active' : ''
  .ui.tab.bottom.attached.segment.content(data-tab=code class=tab_active)
    = content[header]

:deferjs
  $("##{id} > .item[data-tab]").tab()

  $('##{id} > .item[data-tab=close]').click(function(item){
    var tool = $(this).parents('.cytoscape_tool').first()
    tool.find('.tab.active, .item.active').removeClass('active')
    return false
  })

{'fraction_non_alphanumeric': 0.18531827515400412, 'fraction_numerical': 0.004106776180698152, 'mean_word_length': 3.8004926108374386, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4487909', 'n_tokens_mistral': 690, 'n_tokens_neox': 675, 'n_words': 141}