<commit_before>class WikimediaCommonsPhoto < Photo
  
  Photo.descendent_classes ||= []
  Photo.descendent_classes << self
  
  # retrieve WikimediaCommonsPhotos from Wikimedia Commons based on a taxon_name
  def self.search_wikimedia_for_taxon(taxon_name, options = {})
    wm = WikimediaCommonsService.new
    wikimedia_photos = []
    begin
      query_results = wm.query(
        :titles => taxon_name,
        :redirects => '',
        :imlimit => '100',
        :prop => 'images')
    rescue Timeout::Error => e
      query_results = nil
    end
    file_names = []
    unless query_results.blank?
      raw = query_results.at('images')
      filenames = []
      unless raw.blank?
        raw.children.each do |child|
          filename = child.attributes["title"].value<commit_msg>fixed minor bug in wikimedia_commons_photo.rb<commit_after>class WikimediaCommonsPhoto < Photo
  
  Photo.descendent_classes ||= []
  Photo.descendent_classes << self
  
  # retrieve WikimediaCommonsPhotos from Wikimedia Commons based on a taxon_name
  def self.search_wikimedia_for_taxon(taxon_name, options = {})
    wm = WikimediaCommonsService.new
    wikimedia_photos = []
    begin
      query_results = wm.query(
        :titles => taxon_name,
        :redirects => '',
        :imlimit => '100',
        :prop => 'images')
    rescue Timeout::Error => e
      query_results = nil
    end
    filenames = []
    unless query_results.blank?
      raw = query_results.at('images')
      unless raw.blank?
        raw.children.each do |child|
          filename = child.attributes["title"].value
{'fraction_non_alphanumeric': 0.10327455919395466, 'fraction_numerical': 0.003778337531486146, 'mean_word_length': 2.8661800486618003, 'pattern_counts': {'":': 0, '<': 9, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5509508', 'n_tokens_mistral': 488, 'n_tokens_neox': 479, 'n_words': 102}