<commit_before>:ruby
  no_options = properties[:options].nil? || properties[:options].empty?
  tooltip = properties[:tooltip]
  if properties[:selected]
    selected_title = properties[:options].find{ |option| option[:value] == properties[:selected] || option[:title] == properties[:selected] }.try(:[], :title)
  end

.dropdown.js-select-group-manager{ class: "#{properties[:class]}#{no_options ? ' is-disabled' : ''}#{!tooltip.nil? ? ' tooltip--container' : ''}" }
  %label.dropdown__value.js-select-overlay.icon--chevron-down--after{ for: properties[:id] }
    - unless no_options
      = selected_title || properties[:placeholder] || properties[:options].first[:title] || ""

  %select.dropdown__select.js-select{ id: properties[:id], name: properties[:name], data: properties[:data], class: properties[:dropdown_class], disabled: no_options}

    - if no_options
      %option{ value: "" }<
        Nothing to select
    - elsif properties[:placeholder]
      %option{ value: "" }<
        = properties[:placeholder]

    - properties[:options].each do |option|
      %option{value: option[:value] || option[:title], disabled: option[:disabled], data: option[:data], selected: (properties[:selected] && (properties[:selected] == option[:value] || properties[:selected] == option[:title])) ? 'selected' : false}<
        = option[:title]

  = render :partial => 'components/forms/partials/tooltip', :locals => { tooltip: tooltip }
<commit_msg>Add in required attribute<commit_after>:ruby
  no_options = properties[:options].nil? || properties[:options].empty?
  tooltip = properties[:tooltip]
  if properties[:selected]
    selected_title = properties[:options].find{ |option| option[:value] == properties[:selected] || option[:title] == properties[:selected] }.try(:[], :title)
  end

  select_properties = {
    id: properties[:id], name: properties[:name], data: properties[:data], class: properties[:dropdown_class], disabled: no_options
  }

  if properties[:required]
    select_properties[:required] = ""
  end

.dropdown.js-select-group-manager{ class: "#{properties[:class]}#{no_options ? ' is-disabled' : ''}#{!tooltip.nil? ? ' tooltip--container' : ''}" }
  %label.dropdown__value.js-select-overlay.icon--chevron-down--after{ for: properties[:id] }
    - unless no_options
      = selected_title || properties[:placeholder] || properties[:options].first[:title] || ""

  %select.dropdown__select.js-select{ select_properties }

    - if no_options
      %option{ value: "" }<
        Nothing to select
    - elsif properties[:placeholder]
      %option{ value: "" }<
        = properties[:placeholder]

    - properties[:options].each do |option|
      %option{value: option[:value] || option[:title], disabled: option[:disabled], data: option[:data], selected: (properties[:selected] && (properties[:selected] == option[:value] || properties[:selected] == option[:title])) ? 'selected' : false}<
        = option[:title]

  = render :partial => 'components/forms/partials/tooltip', :locals => { tooltip: tooltip }

{'fraction_non_alphanumeric': 0.18151815181518152, 'fraction_numerical': 0.0, 'mean_word_length': 4.784351145038168, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2226885', 'n_tokens_mistral': 863, 'n_tokens_neox': 852, 'n_words': 169}