<commit_before><commit_msg>clean unit rake<commit_after>namespace :hide_units_without_classroom_activities do
  desc 'hides units that do not have a classroom activity'
  task :run => :environment do
    ids = ActiveRecord::Base.connection.execute("SELECT units.id FROM units
    LEFT JOIN classroom_activities AS ca ON ca.unit_id = units.id
    WHERE ca IS null AND units.visible IS true
    ORDER BY units.updated_at").to_a.map{|x| x['id']}

    Unit.where(id: ids).update_all(visible: false)
  end
end
{'fraction_non_alphanumeric': 0.09126984126984126, 'fraction_numerical': 0.0, 'mean_word_length': 4.611111111111111, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '4259987', 'n_tokens_mistral': 159, 'n_tokens_neox': 153, 'n_words': 49}