<commit_before>namespace :gitlab do
  namespace :import do
    desc "GITLAB | Add all users to all projects (admin users are added as masters)"
    task :all_users_to_all_projects => :environment  do |t, args|
      user_ids = User.where(:admin => false).pluck(:id)
      admin_ids = User.where(:admin => true).pluck(:id)

      Project.find_each do |project|
        puts "Importing #{user_ids.size} users into #{project.code}"
        UsersProject.bulk_import(project, user_ids, UsersProject::DEVELOPER)
        puts "Importing #{admin_ids.size} admins into #{project.code}"
        UsersProject.bulk_import(project, admin_ids, UsersProject::MASTER)
      end
    end

    desc "GITLAB | Add a specific user to all projects (as a developer)"
    task :user_to_projects, [:email] => :environment  do |t, args|
      user = User.find_by_email args.email
      project_ids = Project.pluck(:id)

      UsersProject.user_bulk_import(user, project_ids, UsersProject::DEVELOPER)
    end
  end
end<commit_msg>Fix rake task - Update method name<commit_after>namespace :gitlab do
  namespace :import do
    desc "GITLAB | Add all users to all projects (admin users are added as masters)"
    task :all_users_to_all_projects => :environment  do |t, args|
      user_ids = User.where(:admin => false).pluck(:id)
      admin_ids = User.where(:admin => true).pluck(:id)

      Project.find_each do |project|
        puts "Importing #{user_ids.size} users into #{project.code}"
        UsersProject.add_users_into_projects(project, user_ids, UsersProject::DEVELOPER)
        puts "Importing #{admin_ids.size} admins into #{project.code}"
        UsersProject.add_users_into_projects(project, admin_ids, UsersProject::MASTER)
      end
    end

    desc "GITLAB | Add a specific user to all projects (as a developer)"
    task :user_to_projects, [:email] => :environment  do |t, args|
      user = User.find_by_email args.email
      project_ids = Project.pluck(:id)

      UsersProject.add_users_into_projects(user, project_ids, UsersProject::DEVELOPER)
    end
  end
end
{'fraction_non_alphanumeric': 0.10447035957240039, 'fraction_numerical': 0.0, 'mean_word_length': 3.6795454545454547, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7647381', 'n_tokens_mistral': 643, 'n_tokens_neox': 636, 'n_words': 174}