<commit_before>module ApplicationHelper
  BOOTSTRAP_FLASH_MSG = {
    success: 'alert-success',
    error: 'alert-danger',
    alert: 'alert-warning',
    notice: 'alert-info'
  }.freeze

  def bootstrap_class_for(flash_type)
    BOOTSTRAP_FLASH_MSG.fetch(flash_type.to_sym, flash_type.to_s)
  end

  def display_validation_errors(resource)
    return unless resource.errors.present?

    content_tag :ul, class: 'error-list' do
      resource.errors.full_messages.each do |message|
        concat content_tag(:li, message)
      end
    end
  end

  def available_roles
    roles = current_community.primary? ? User::PRIMARY_ROLES : User::NON_PRIMARY_ROLES
    roles << ['Remote Clinic Lawyer', 'remote_clinic_lawyer'] if current_user.regional_admin?
    roles
  end

  def locations_by_name(region)
    region.locations.order('name')
  end

  def us_states_options
    [<commit_msg>create a new array of roles, rather than changing frozen array<commit_after>module ApplicationHelper
  BOOTSTRAP_FLASH_MSG = {
    success: 'alert-success',
    error: 'alert-danger',
    alert: 'alert-warning',
    notice: 'alert-info'
  }.freeze

  def bootstrap_class_for(flash_type)
    BOOTSTRAP_FLASH_MSG.fetch(flash_type.to_sym, flash_type.to_s)
  end

  def display_validation_errors(resource)
    return unless resource.errors.present?

    content_tag :ul, class: 'error-list' do
      resource.errors.full_messages.each do |message|
        concat content_tag(:li, message)
      end
    end
  end

  def available_roles
    roles = current_community.primary? ? User::PRIMARY_ROLES : User::NON_PRIMARY_ROLES
    if current_user.regional_admin?
      roles + [['Remote Clinic Lawyer', 'remote_clinic_lawyer']]
    else
      roles
    end
  end

  def locations_by_name(region)
    region.locations.order('name')
  end

  def us_states_options
    [
{'fraction_non_alphanumeric': 0.09115572436245252, 'fraction_numerical': 0.0, 'mean_word_length': 3.7161125319693094, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '6180319', 'n_tokens_mistral': 630, 'n_tokens_neox': 607, 'n_words': 126}