<commit_before>class PageLayout
  
  def self.element_names_for(page_layout)
    page_layouts = self.get_layouts
    layout_description = page_layouts.select{ |p| p["name"].downcase == page_layout.downcase }
    raise "No Layout Description for #{page_layout} found! in page_layouts.yml" if layout_description.blank?
    layout_description.first["elements"]
  end

  def self.get_layouts
    if File.exists? "#{RAILS_ROOT}/config/alchemy/page_layouts.yml"
      layouts = YAML.load_file( "#{RAILS_ROOT}/config/alchemy/page_layouts.yml" )
    elsif File.exists? "#{RAILS_ROOT}/config/alchemy/page_layouts.yml"
      layouts = YAML.load_file( "#{RAILS_ROOT}/config/alchemy/page_layouts.yml" )
    else<commit_msg>fetching page_layout via detect not via select and first...<commit_after>class PageLayout
  
  def self.element_names_for(page_layout)
    page_layouts = self.get_layouts
    layout_description = page_layouts.detect { |p| p["name"].downcase == page_layout.downcase }
    raise "No Layout Description for #{page_layout} found! in page_layouts.yml" if layout_description.blank?
    layout_description["elements"]
  end

  def self.get_layouts
    if File.exists? "#{RAILS_ROOT}/config/alchemy/page_layouts.yml"
      layouts = YAML.load_file( "#{RAILS_ROOT}/config/alchemy/page_layouts.yml" )
    elsif File.exists? "#{RAILS_ROOT}/config/alchemy/page_layouts.yml"
      layouts = YAML.load_file( "#{RAILS_ROOT}/config/alchemy/page_layouts.yml" )
    else
{'fraction_non_alphanumeric': 0.11756664388243336, 'fraction_numerical': 0.0, 'mean_word_length': 4.587786259541985, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2754333', 'n_tokens_mistral': 529, 'n_tokens_neox': 504, 'n_words': 85}