<commit_before>Rails.application.routes.draw do
  mount Payola::Engine => '/payola', as: :payola
  require 'sidekiq/web'
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == ENV["SIDEKIQ_USERNAME"] && password == ENV["SIDEKIQ_PASSWORD"]
  end if Rails.env.production?
  mount Sidekiq::Web => '/sidekiq'

  get '/home', to: 'dashboard#home'

  namespace :api do
    get '/', to: 'docs#index'
    get '/search', to: 'search#index'
    get '/searchcode', to: 'projects#searchcode'

    get '/github/:owner/:name/dependencies', to: 'github_repositories#dependencies'
    get '/github/:owner/:name/projects', to: 'github_repositories#projects'
    get '/github/:owner/:name', to: 'github_repositories#show'

    get '/:platform/:name/:version/dependencies', to: 'projects#dependencies', constraints: { :platform => /[\w\-\_]+/, :name => /[\w\-\_\%]+/, :version => /[\w\-\_\.]+/ }
    get '/:platform/:name/dependent_repositories', to: 'projects#dependent_repositories'
    get '/:platform/:name/dependents', to: 'projects#dependents'
    get '/:platform/:name', to: 'projects#show'
  end

  namespace :admin do
    resources :projects do
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    resources :project_suggestions
    resources :github_repositories do
      collection do
        get 'mit'
      end
    end
    resources :users do
      member do
        post 'sync'
      end
    end
    get '/stats', to: 'stats#index', as: :stats<commit_msg>Fix some api route constraints<commit_after>Rails.application.routes.draw do
  mount Payola::Engine => '/payola', as: :payola
  require 'sidekiq/web'
  Sidekiq::Web.use Rack::Auth::Basic do |username, password|
    username == ENV["SIDEKIQ_USERNAME"] && password == ENV["SIDEKIQ_PASSWORD"]
  end if Rails.env.production?
  mount Sidekiq::Web => '/sidekiq'

  get '/home', to: 'dashboard#home'

  namespace :api do
    get '/', to: 'docs#index'
    get '/search', to: 'search#index'
    get '/searchcode', to: 'projects#searchcode'

    get '/github/:owner/:name/dependencies', to: 'github_repositories#dependencies', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name/projects', to: 'github_repositories#projects', constraints: { :name => /[^\/]+/ }
    get '/github/:owner/:name', to: 'github_repositories#show', constraints: { :name => /[^\/]+/ }

    get '/:platform/:name/:version/dependencies', to: 'projects#dependencies', constraints: { :platform => /[\w\-\_]+/, :name => /[\w\-\_\%]+/, :version => /[\w\-\_\.]+/ }
    get '/:platform/:name/dependent_repositories', to: 'projects#dependent_repositories', constraints: { :platform => /[\w\-\_]+/, :name => /[\w\-\_\%]+/ }
    get '/:platform/:name/dependents', to: 'projects#dependents', constraints: { :platform => /[\w\-\_]+/, :name => /[\w\-\_\%]+/ }
    get '/:platform/:name', to: 'projects#show', constraints: { :platform => /[\w\-\_]+/, :name => /[\w\-\_\%]+/ }
  end

  namespace :admin do
    resources :projects do
      collection do
        get 'deprecated'
        get 'unmaintained'
      end
    end
    resources :project_suggestions
    resources :github_repositories do
      collection do
        get 'mit'
      end
    end
    resources :users do
      member do
        post 'sync'
      end
    end
    get '/stats', to: 'stats#index', as: :stats
{'fraction_non_alphanumeric': 0.18615751789976134, 'fraction_numerical': 0.0, 'mean_word_length': 3.154894671623296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, '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': '7009961', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1092, 'n_words': 260}