<commit_before>#encoding: utf-8
module SuggestedAssayTypesHelper
  def create_suggested_assay_type_popup_link is_for_modelling=nil, link_from="suggested_assay_types"
    return link_to_remote_redbox(image("new") + ' new assay type',
                                 {:url => new_suggested_assay_type_path,
                                  :failure => "alert('Sorry, an error has occurred.'); RedBox.close();",
                                  :with => "'is_for_modelling=#{is_for_modelling}' +'&link_from=#{link_from}'",
                                  :method=> :get
                                 }
    )
  end

  #select tag without form
  def ontology_selection_list type, element_name, selected_uri, html_options={}
    case type
      when "assay", "modelling_analysis", "technology"
        reader = reader_for_type(type)
        classes = reader.class_hierarchy
        options = render_ontology_class_options classes
      when "all_assay_type"
        assay_type_reader = reader_for_type("assay")
        modelling_analysis_reader = reader_for_type("modelling_analysis")
        assay_type_classes = assay_type_reader.class_hierarchy
        modelling_analysis_classes = modelling_analysis_reader.class_hierarchy

        options = render_ontology_class_options(assay_type_classes)
        options += render_ontology_class_options(modelling_analysis_classes)
      else
        options = []
    end

    select_tag element_name, options_for_select(options, :selected => selected_uri), html_options
  end
<commit_msg>tweak suggested assay type link title<commit_after>#encoding: utf-8
module SuggestedAssayTypesHelper
  def create_suggested_assay_type_popup_link is_for_modelling=nil, link_from="suggested_assay_types"
    link_title = is_for_modelling ? "new modelling analysis type" : "new assay type"
    return link_to_remote_redbox(image("new") + ' ' + link_title,
                                 {:url => new_suggested_assay_type_path,
                                  :failure => "alert('Sorry, an error has occurred.'); RedBox.close();",
                                  :with => "'is_for_modelling=#{is_for_modelling}' +'&link_from=#{link_from}'",
                                  :method=> :get
                                 }
    )
  end

  #select tag without form
  def ontology_selection_list type, element_name, selected_uri, html_options={}
    case type
      when "assay", "modelling_analysis", "technology"
        reader = reader_for_type(type)
        classes = reader.class_hierarchy
        options = render_ontology_class_options classes
      when "all_assay_type"
        assay_type_reader = reader_for_type("assay")
        modelling_analysis_reader = reader_for_type("modelling_analysis")
        assay_type_classes = assay_type_reader.class_hierarchy
        modelling_analysis_classes = modelling_analysis_reader.class_hierarchy

        options = render_ontology_class_options(assay_type_classes)
        options += render_ontology_class_options(modelling_analysis_classes)
      else
        options = []
    end

    select_tag element_name, options_for_select(options, :selected => selected_uri), html_options
  end

{'fraction_non_alphanumeric': 0.08007566204287515, 'fraction_numerical': 0.0006305170239596469, 'mean_word_length': 2.8695121951219513, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6334393', 'n_tokens_mistral': 930, 'n_tokens_neox': 883, 'n_words': 162}