<commit_before>module ContentBlock
  module BlockHelper
    def rich_block(name)
      block = ContentBlock::RichBlock.find_by_name(name)
      block.content
    end

    def rich_block_with_title(name, wrapper)
      block         = ContentBlock::RichBlock.find_by_name(name)
      wrapped_title = "<#{wrapper}>#{block.title}</#{wrapper}>"
      "#{wrapped_title}#{block.content}".html_safe<commit_msg>change helper to find by id or name<commit_after>module ContentBlock
  module BlockHelper
    def rich_block(find_by)
      block = ContentBlock::RichBlock.where('id = ? OR name = ?', find_by, find_by).first
      block.content.html_safe
    end

    def rich_block_with_title(find_by, wrapper)
      block         = ContentBlock::RichBlock.where('id = ? OR name = ?', find_by, find_by).first
      wrapped_title = "<#{wrapper}>#{block.title}</#{wrapper}>"
      "#{wrapped_title}#{block.content}".html_safe
{'fraction_non_alphanumeric': 0.12857142857142856, 'fraction_numerical': 0.0, 'mean_word_length': 3.871657754010695, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2126892', 'n_tokens_mistral': 284, 'n_tokens_neox': 293, 'n_words': 50}