<commit_before>namespace :dc do
  desc 'Create and register a new user'
  task :create_user, [:username, :password, :email, :first_name, :last_name] => :environment do |t, args|
    unless args.username && args.email && args.password
      puts "Usage: rake 'dc:create_user[username,password,email,first_name,last_name]'"
      exit(1)
    end

    user = User.find_by_username(args.username)

    if user
      puts "User already exists: #{args.username}"
      exit(1)
    end

    first_name = args.first_name.nil? ? "" : args.first_name
    last_name  = args.last_name.nil?  ? "" : args.last_name

    user = User.new(:username => args.username, :email => args.email,
                    :password => <PASSWORD>,
                    :password_confirmation => <PASSWORD>,
                    :first_name => first_name,
                    :last_name  => last_name,
                    :quota => Quota.new)
    registration = RegistrationService.new(user)
    if registration.save
      puts "User #{args.username} registered"
    else
      puts "User registration failed: #{registration.error}"
    end
  end<commit_msg>Make dc:setup print admin user password  to console<commit_after>namespace :dc do
  desc 'Create and register a new user'
  task :create_user, [:username, :password, :email, :first_name, :last_name] => :environment do |t, args|
    unless args.username && args.email && args.password
      puts "Usage: rake 'dc:create_user[username,password,email,first_name,last_name]'"
      exit(1)
    end

    user = User.find_by_username(args.username)

    if user
      puts "User already exists: #{args.username}"
      exit(1)
    end

    first_name = args.first_name.nil? ? "" : args.first_name
    last_name  = args.last_name.nil?  ? "" : args.last_name

    user = User.new(:username => args.username, :email => args.email,
                    :password => <PASSWORD>,
                    :password_confirmation => <PASSWORD>,
                    :first_name => first_name,
                    :last_name  => last_name,
                    :quota => Quota.new)
    registration = RegistrationService.new(user)
    if registration.save
      puts "User '#{args.username}' with password '#{args.password}' registered"
    else
      puts "User registration failed: #{registration.error}"
    end
  end
{'fraction_non_alphanumeric': 0.11934510986643689, 'fraction_numerical': 0.0017233950883239983, 'mean_word_length': 2.6, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '93593', 'n_tokens_mistral': 698, 'n_tokens_neox': 683, 'n_words': 167}