<commit_before># frozen_string_literal: true

namespace :randomizations do
  desc 'Add site to all randomization characteristics'
  task add_site_characteristic: :environment do
    RandomizationCharacteristic.where(site_id: nil).find_each do |characteristic|
      next if characteristic.randomization.subject.nil?
      characteristic.update site_id: characteristic.randomization.subject.site_id
    end<commit_msg>Note to remove rake task in future release<commit_after># frozen_string_literal: true

namespace :randomizations do
  # TODO: Remove in 0.42.0
  desc 'Add site to all randomization characteristics'
  task add_site_characteristic: :environment do
    RandomizationCharacteristic.where(site_id: nil).find_each do |characteristic|
      next if characteristic.randomization.subject.nil?
      characteristic.update site_id: characteristic.randomization.subject.site_id
    end
{'fraction_non_alphanumeric': 0.06292134831460675, 'fraction_numerical': 0.0044943820224719105, 'mean_word_length': 5.410071942446043, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4985291', 'n_tokens_mistral': 235, 'n_tokens_neox': 232, 'n_words': 66}