<commit_before>namespace :users do
  desc "List the emails of all admin accounts"
  task :list_admins => :environment do
    admins = User.where(admin: true).map do |u|
      u.email
    end.sort
    puts admins.empty? ? "No Admin Users" : admins
  end
  desc "Remove admin status from an account, given an email"
  task :remove_admin, [:email] => :environment do |t, args|
    u = User.find_by_email(args[:email])
    u.admin = false
    u.save
  end
  desc "Add admin status from an account, given an email"
  task :add_admin, [:email] => :environment do |t, args|
    u = User.find_by_email(args[:email])
    u.admin = true
    u.save
  end
end<commit_msg>Status message for rake users:add_admin<commit_after>namespace :users do
  desc "List the emails of all admin accounts"
  task :list_admins => :environment do
    admins = User.where(admin: true).map do |u|
      u.email
    end.sort
    puts admins.empty? ? "No Admin Users" : admins
  end
  desc "Remove admin status from an account, given an email"
  task :remove_admin, [:email] => :environment do |t, args|
    u = User.find_by_email(args[:email])
    u.admin = false
    u.save
  end
  desc "Add admin status from an account, given an email"
  task :add_admin, [:email] => :environment do |t, args|
    email = args[:email]
    u = User.find_by_email(email)
    u.admin = true
    if u.save
      puts "Successfully granted admin status to #{email}."
    else
      puts "Granting admin status to #{email} failed."
    end
  end
end
{'fraction_non_alphanumeric': 0.10821643286573146, 'fraction_numerical': 0.0, 'mean_word_length': 3.1267217630853996, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '5284272', 'n_tokens_mistral': 494, 'n_tokens_neox': 494, 'n_words': 174}