<commit_before>module TwitterBootstrapCombo
  module ViewHelpers
    def combo_box(object, method, choices, options = {}, html_options = {})
      current_value = self.instance_variable_get("@#{object}").instance_variable_get("@attributes")[method.to_s].to_i

      curent = choices.select { |c| c[1] == current_value }.first
      if curent.nil? then
        current_text = "(None)"
      else
	current_text = curent[0]
      end

      hidden_field(object, method) +
      content_tag(:div, :class => "btn-group") do
	link_to(content_tag(:span, strip_tags(current_text), :class => "combo_box_text") + " " + content_tag(:i, "", :class => "icon-caret-down"), "#", :class => "btn dropdown-toggle", :data => { :toggle => "dropdown" }) +
	content_tag(:ul, :class => "dropdown-menu", :data => { :for => "#{object}_#{method}" }) do
	  if options[:include_blank] then
	    css_class = []
	    if current_value == 0 then
	      css_class << "active"
	    end
	    content_tag(:li, :class => css_class.join(" ")) do
	      link_to("(None)", '#', :class => "combo_box_item")
	    end
	  else
	    "".html_safe
	  end +
	  choices.collect do |o|
	    css_class = []
	    if current_value == o[1] then
	      css_class << "active"
	    end
	    content_tag(:li, :class => css_class.join(" ")) do
	      link_to(o[0], '#', :class => "combo_box_item", :data => { :value => o[1] })
	    end
	  end.join().html_safe
	end
      end
    end
  end
end
<commit_msg>Don't mix tabs en spaces.<commit_after>module TwitterBootstrapCombo
  module ViewHelpers
    def combo_box(object, method, choices, options = {}, html_options = {})
      current_value = self.instance_variable_get("@#{object}").instance_variable_get("@attributes")[method.to_s].to_i

      curent = choices.select { |c| c[1] == current_value }.first
      if curent.nil? then
        current_text = "(None)"
      else
        current_text = curent[0]
      end

      hidden_field(object, method) +
      content_tag(:div, :class => "btn-group") do
        link_to(content_tag(:span, strip_tags(current_text), :class => "combo_box_text") + " " + content_tag(:i, "", :class => "icon-caret-down"), "#", :class => "btn dropdown-toggle", :data => { :toggle => "dropdown" }) +
        content_tag(:ul, :class => "dropdown-menu", :data => { :for => "#{object}_#{method}" }) do
          if options[:include_blank] then
            css_class = []
            if current_value == 0 then
              css_class << "active"
            end
            content_tag(:li, :class => css_class.join(" ")) do
              link_to("(None)", '#', :class => "combo_box_item")
            end
          else
            "".html_safe
          end +
          choices.collect do |o|
            css_class = []
            if current_value == o[1] then
              css_class << "active"
            end
            content_tag(:li, :class => css_class.join(" ")) do
              link_to(o[0], '#', :class => "combo_box_item", :data => { :value => o[1] })
            end
          end.join().html_safe
        end
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.1640625, 'fraction_numerical': 0.00390625, 'mean_word_length': 2.556712962962963, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 33, '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': '3006732', 'n_tokens_mistral': 1018, 'n_tokens_neox': 997, 'n_words': 210}