<commit_before>require 'rake'

namespace :rigse do
  namespace :convert do
    desc 'reclaim un-owned page-elements (by using the owner for the containing page...)'
    task :reclaim_elements => :environment do
       investigations = Investigation.find(:all).each do |i|
         current_user = i.user 
         if (current_user)
           puts "working with #{current_user.login}"
           i.deep_set_user(current_user)
         else
           puts "skipping investigation #{i.name} : #{i.id} which has no owner!"
           next
         end
       end  
    end
  end
end<commit_msg>new task run_deep_set_user_on_all_investigations<commit_after>require 'rake'

namespace :rigse do
  namespace :convert do
    desc 'reclaim un-owned page-elements (by using the owner for the containing page...)'
    task :reclaim_elements => :environment do
       investigations = Investigation.find(:all).each do |i|
         current_user = i.user 
         if (current_user)
           puts "working with #{current_user.login}"
           i.deep_set_user(current_user)
         else
           puts "skipping investigation #{i.name} : #{i.id} which has no owner!"
           next
         end
       end  
    end
    desc 'run deep_set_user on each owned investigation using the current owner of the investigation)'
    task :run_deep_set_user_on_all_investigations => :environment do
       Investigation.find(:all).each do |inv|
         if owner = inv.user
           puts " deep_set_user: #{owner.login} => Investigation: #{inv.id}: #{inv.name}"
           inv.deep_set_user(owner)
         else
           puts "skipping investigation #{i.name} : #{i.id} which has no owner!"
           next
         end
       end  
    end
  end
end
{'fraction_non_alphanumeric': 0.08991354466858789, 'fraction_numerical': 0.0, 'mean_word_length': 2.3066666666666666, 'pattern_counts': {'":': 0, '<': 3, '<?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': '102282', 'n_tokens_mistral': 498, 'n_tokens_neox': 498, 'n_words': 152}