<commit_before>module ShowFor
  module Label
    def label(text_or_attribute, options={}, apply_options=true)
      label = if text_or_attribute.is_a?(String)
        text_or_attribute
      elsif options.key?(:label)
        options.delete(:label)
      elsif text_or_attribute.is_a?(Symbol) and !text_or_attribute.blank?
        I18n.t( text_or_attribute.to_sym, :scope => [:show_for,@object.class.to_s.downcase.to_sym], :default => human_attribute_name(text_or_attribute) )
      else
        human_attribute_name(text_or_attribute)
      end

      return nil.to_s if label == false
      options[:label_html] = options.dup if apply_options

      label = ShowFor.label_proc.call(label) if options.fetch(:wrap_label, true) && ShowFor.label_proc
      wrap_with :label, label, options
    end

  protected

    def human_attribute_name(attribute) #:nodoc:
      @object.class.human_attribute_name(attribute.to_s)
    end
  end
end<commit_msg>still trying to align with simple_form<commit_after>module ShowFor
  module Label
    def label(text_or_attribute, options={}, apply_options=true)
      label = if text_or_attribute.is_a?(String)
        text_or_attribute
      elsif options.key?(:label)
        options.delete(:label)
      elsif text_or_attribute.is_a?(Symbol) and !text_or_attribute.blank?
        I18n.t( text_or_attribute.to_sym, :scope => [:show_for,@object.class.to_s.tableize.singularize.to_sym], :default => human_attribute_name(text_or_attribute) )
      else
        human_attribute_name(text_or_attribute)
      end

      return nil.to_s if label == false
      options[:label_html] = options.dup if apply_options

      label = ShowFor.label_proc.call(label) if options.fetch(:wrap_label, true) && ShowFor.label_proc
      wrap_with :label, label, options
    end

  protected

    def human_attribute_name(attribute) #:nodoc:
      @object.class.human_attribute_name(attribute.to_s)
    end
  end
end
{'fraction_non_alphanumeric': 0.096004151530877, 'fraction_numerical': 0.0020757654385054488, 'mean_word_length': 3.7139364303178484, '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': '1419722', 'n_tokens_mistral': 631, 'n_tokens_neox': 622, 'n_words': 116}