<commit_before># Page titles on Wikipedia may include dots, so this constraint is needed.

Rails.application.routes.draw do
  get 'errors/file_not_found'
  get 'errors/unprocessable'
  get 'errors/login_error'
  get 'errors/internal_server_error'
  get 'errors/incorrect_passcode'
  put 'errors/incorrect_passcode'

  # Sessions
  devise_for :users, controllers: { omniauth_callbacks: 'omniauth_callbacks' }
  devise_scope :user do
    # OmniAuth may fall back to :new_user_session when the OAuth flow fails.
    # So, we treat it as a login error.
    get 'sign_in', to: 'errors#login_error', as: :new_user_session

    get 'sign_out', to: 'users#signout', as: :destroy_user_session
    get 'sign_out_oauth', to: 'devise/sessions#destroy',
                          as: :true_destroy_user_session
  end

  get '/settings/all_admins' => 'settings#all_admins'
  post '/settings/upgrade_admin' => 'settings#upgrade_admin'
  post '/settings/downgrade_admin' => 'settings#downgrade_admin'

  get '/settings/special_users' => 'settings#special_users'
  post '/settings/upgrade_special_user' => 'settings#upgrade_special_user'
  post '/settings/downgrade_special_user' => 'settings#downgrade_special_user'

  post '/settings/update_salesforce_credentials' => 'settings#update_salesforce_credentials'
  # Griddler allows us to receive incoming emails. By default,
  # the path for incoming emails is /email_processor
  mount_griddler

  #UserProfilesController
  controller :user_profiles do
    get 'users/:username' => 'user_profiles#show' , constraints: { username: /.*/ }
    get 'user_stats' => 'user_profiles#stats'
    get 'stats_graphs' => 'user_profiles#stats_graphs'
    delete 'profile_image' => 'user_profiles#delete_profile_image', as: 'delete_profile_image', constraints: { username: /.*/ }
    get 'update_email_preferences/:username' => 'user_profiles#update_email_preferences', constraints: { username: /.*/ }
    post 'users/update/:username' => 'user_profiles#update' , constraints: { username: /.*/ }
  end

  #PersonalDataController
  controller :personal_data do
    get 'download_personal_data' => 'personal_data#show'
  end

  # Users
  resources :users, only: [:index, :show], param: :username, constraints: { username: /.*/ } do
    collection do
      get 'revisions'
    end
  end

  resources :assignments do
    patch '/status' => 'assignments#update_status'
    resources :assignment_suggestions
  end

  get 'mass_enrollment/:course_id'  => 'mass_enrollment#index',
      constraints: { course_id: /.*/ }
  post 'mass_enrollment/:course_id'  => 'mass_enrollment#add_users',
      constraints: { course_id: /.*/ }

  get '/requested_accounts_campaigns/*campaign_slug/create' => 'requested_accounts_campaigns#create_accounts',
      constraints: { campaign_slug: /.*/ }
  put '/requested_accounts_campaigns/*campaign_slug/enable_account_requests' => 'requested_accounts_campaigns#enable_account_requests',
      constraints: { campaign_slug: /.*/ }
  put '/requested_accounts_campaigns/*campaign_slug/disable_account_requests' => 'requested_accounts_campaigns#disable_account_requests',
      constraints: { campaign_slug: /.*/ }
  get '/requested_accounts_campaigns/*campaign_slug' => 'requested_accounts_campaigns#index',
      constraints: { campaign_slug: /.*/ }
<commit_msg>Added route to add random peer assignments.<commit_after># Page titles on Wikipedia may include dots, so this constraint is needed.

Rails.application.routes.draw do
  get 'errors/file_not_found'
  get 'errors/unprocessable'
  get 'errors/login_error'
  get 'errors/internal_server_error'
  get 'errors/incorrect_passcode'
  put 'errors/incorrect_passcode'

  # Sessions
  devise_for :users, controllers: { omniauth_callbacks: 'omniauth_callbacks' }
  devise_scope :user do
    # OmniAuth may fall back to :new_user_session when the OAuth flow fails.
    # So, we treat it as a login error.
    get 'sign_in', to: 'errors#login_error', as: :new_user_session

    get 'sign_out', to: 'users#signout', as: :destroy_user_session
    get 'sign_out_oauth', to: 'devise/sessions#destroy',
                          as: :true_destroy_user_session
  end

  get '/settings/all_admins' => 'settings#all_admins'
  post '/settings/upgrade_admin' => 'settings#upgrade_admin'
  post '/settings/downgrade_admin' => 'settings#downgrade_admin'

  get '/settings/special_users' => 'settings#special_users'
  post '/settings/upgrade_special_user' => 'settings#upgrade_special_user'
  post '/settings/downgrade_special_user' => 'settings#downgrade_special_user'

  post '/settings/update_salesforce_credentials' => 'settings#update_salesforce_credentials'
  # Griddler allows us to receive incoming emails. By default,
  # the path for incoming emails is /email_processor
  mount_griddler

  #UserProfilesController
  controller :user_profiles do
    get 'users/:username' => 'user_profiles#show' , constraints: { username: /.*/ }
    get 'user_stats' => 'user_profiles#stats'
    get 'stats_graphs' => 'user_profiles#stats_graphs'
    delete 'profile_image' => 'user_profiles#delete_profile_image', as: 'delete_profile_image', constraints: { username: /.*/ }
    get 'update_email_preferences/:username' => 'user_profiles#update_email_preferences', constraints: { username: /.*/ }
    post 'users/update/:username' => 'user_profiles#update' , constraints: { username: /.*/ }
  end

  #PersonalDataController
  controller :personal_data do
    get 'download_personal_data' => 'personal_data#show'
  end

  # Users
  resources :users, only: [:index, :show], param: :username, constraints: { username: /.*/ } do
    collection do
      get 'revisions'
    end
  end

  resources :assignments do
    patch '/status' => 'assignments#update_status'
    resources :assignment_suggestions
  end
  post '/assignments/random_peer' => 'assignments#create_random_peer'

  get 'mass_enrollment/:course_id'  => 'mass_enrollment#index',
      constraints: { course_id: /.*/ }
  post 'mass_enrollment/:course_id'  => 'mass_enrollment#add_users',
      constraints: { course_id: /.*/ }

  get '/requested_accounts_campaigns/*campaign_slug/create' => 'requested_accounts_campaigns#create_accounts',
      constraints: { campaign_slug: /.*/ }
  put '/requested_accounts_campaigns/*campaign_slug/enable_account_requests' => 'requested_accounts_campaigns#enable_account_requests',
      constraints: { campaign_slug: /.*/ }
  put '/requested_accounts_campaigns/*campaign_slug/disable_account_requests' => 'requested_accounts_campaigns#disable_account_requests',
      constraints: { campaign_slug: /.*/ }
  get '/requested_accounts_campaigns/*campaign_slug' => 'requested_accounts_campaigns#index',
      constraints: { campaign_slug: /.*/ }

{'fraction_non_alphanumeric': 0.1178400954653938, 'fraction_numerical': 0.0, 'mean_word_length': 4.770223752151463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 46, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6388994', 'n_tokens_mistral': 2167, 'n_tokens_neox': 2134, 'n_words': 427}