<commit_before>class MainstreamBrowsePagePresenter < TagPresenter

private

  def format
    'mainstream_browse_page'
  end

  def links
    super.merge(
      "related_topics" => @tag.topics.order(:title).map(&:content_id),
      "top_level_browse_page" => top_level_browse_page_id,
      "top_level_browse_pages" => @tag.class.sorted_parents.map(&:content_id),
      "second_level_browse_pages" => second_level_browse_pages,
    )
  end

private

  def top_level_browse_page_id
    if @tag.has_parent?
      [@tag.parent.content_id]
    else
      []
    end
  end

  def second_level_browse_pages
    if @tag.child?
      @tag.parent.sorted_children.map(&:content_id)
    else
      @tag.sorted_children.map(&:content_id)
    end
  end

end<commit_msg>Rename top_level_browse_page -> active_top_level_browse_page<commit_after>class MainstreamBrowsePagePresenter < TagPresenter

private

  def format
    'mainstream_browse_page'
  end

  def links
    super.merge(
      "related_topics" => @tag.topics.order(:title).map(&:content_id),
      "active_top_level_browse_page" => top_level_browse_page_id,
      "top_level_browse_pages" => @tag.class.sorted_parents.map(&:content_id),
      "second_level_browse_pages" => second_level_browse_pages,
    )
  end

private

  def top_level_browse_page_id
    if @tag.has_parent?
      [@tag.parent.content_id]
    else
      []
    end
  end

  def second_level_browse_pages
    if @tag.child?
      @tag.parent.sorted_children.map(&:content_id)
    else
      @tag.sorted_children.map(&:content_id)
    end
  end

end
{'fraction_non_alphanumeric': 0.09846547314578005, 'fraction_numerical': 0.0, 'mean_word_length': 3.589442815249267, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '4369992', 'n_tokens_mistral': 603, 'n_tokens_neox': 574, 'n_words': 79}