<commit_before>module DropFilters
  def section(path)
    @context['site'].find_section(path)
  end
  
  def child_sections(path_or_section)
    path = path_or_section.is_a?(SectionDrop) ? path_or_section['path'] : path_or_section
    @context['site'].find_child_sections(path)
  end

  def descendant_sections(path_or_section)
    path = path_or_section.is_a?(SectionDrop) ? path_or_section['path'] : path_or_section
    @context['site'].find_descendant_sections(path)
  end

  def latest_articles(site_or_section, limit = nil)
    site_or_section.latest_articles(limit || site_or_section['articles_per_page'])
  end

  def latest_article(section)
    latest_articles(section, 1).first
  end
  
  def latest_comments(site, limit = nil)
    site.latest_comments(limit || site['articles_per_page'])
  end

  def monthly_articles(section, date = nil)
    date = parse_date(date)
    returning section.source.articles.find_all_in_month(date.year, date.month) do |articles|
      articles.collect! { |a| a.to_liquid :site => @context['site'].source, :mode => :single }
    end
  end
  
  def tagged_articles(tags)
    @context['site'].source.articles.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'contents.created_at desc').collect(&:to_liquid)
  end
  
  def assets_by_type(type)
    @context['site'].source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc').collect(&:to_liquid)
  end
  
  def tagged_assets(tags)
    @context['site'].source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc').collect(&:to_liquid)
  end
end<commit_msg>dont trigger liquid strainer error with returning method<commit_after>module DropFilters
  def section(path)
    @context['site'].find_section(path)
  end
  
  def child_sections(path_or_section)
    path = path_or_section.is_a?(SectionDrop) ? path_or_section['path'] : path_or_section
    @context['site'].find_child_sections(path)
  end

  def descendant_sections(path_or_section)
    path = path_or_section.is_a?(SectionDrop) ? path_or_section['path'] : path_or_section
    @context['site'].find_descendant_sections(path)
  end

  def latest_articles(site_or_section, limit = nil)
    site_or_section.latest_articles(limit || site_or_section['articles_per_page'])
  end

  def latest_article(section)
    latest_articles(section, 1).first
  end
  
  def latest_comments(site, limit = nil)
    site.latest_comments(limit || site['articles_per_page'])
  end

  def monthly_articles(section, date = nil)
    date = parse_date(date)
    section.source.articles.find_all_in_month(date.year, date.month).collect! { |a| a.to_liquid :site => @context['site'].source, :mode => :single }
  end
  
  def tagged_articles(tags)
    @context['site'].source.articles.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'contents.created_at desc').collect(&:to_liquid)
  end
  
  def assets_by_type(type)
    @context['site'].source.assets.find_all_by_content_types([type.to_sym], :all, :order => 'created_at desc').collect(&:to_liquid)
  end
  
  def tagged_assets(tags)
    @context['site'].source.assets.find(:all, :include => :tags, :conditions => ['tags.name in (?)', Tag.parse(tags)], :order => 'assets.created_at desc').collect(&:to_liquid)
  end
end
{'fraction_non_alphanumeric': 0.14454976303317535, 'fraction_numerical': 0.0005924170616113745, 'mean_word_length': 5.196330275229358, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '1653634', 'n_tokens_mistral': 1175, 'n_tokens_neox': 1128, 'n_words': 193}