<commit_before>module Sinatra
  module Nedry
    def protected!(&blk)
      if authorized?
        blk.call
      else
        not_authorized
      end
    end
    
    def flagged!(&blk)
      if authorized? || ENV["RACK_ENV"] != "production"
        blk.call
      else
        not_authorized
      end
    end
    
    private
    
    def authorized?
      editor_credentials = if ENV["RACK_ENV"] == "production"
        [ENV["ADMIN_USERNAME"], ENV["ADMIN_PASSWORD"]]
      else
        ["admin", "<PASSWORD>"]
      end      
  
      @auth ||= Rack::Auth::Basic::Request.new(request.env)
      @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == editor_credentials
    end
  end

  helpers Nedry
end<commit_msg>Editor => Admin<commit_after>module Sinatra
  module Nedry
    def protected!(&blk)
      if authorized?
        blk.call
      else
        not_authorized
      end
    end
    
    def flagged!(&blk)
      if authorized? || ENV["RACK_ENV"] != "production"
        blk.call
      else
        not_authorized
      end
    end
    
    private
    
    def authorized?
      admin_credentials = if ENV["RACK_ENV"] == "production"
        [ENV["ADMIN_USERNAME"], ENV["<PASSWORD>_PASSWORD"]]
      else
        ["admin", "<PASSWORD>"]
      end      
  
      @auth ||= Rack::Auth::Basic::Request.new(request.env)
      @auth.provided? and @auth.basic? and @auth.credentials and @auth.credentials == editor_credentials
    end
  end

  helpers Nedry
end
{'fraction_non_alphanumeric': 0.11096256684491979, 'fraction_numerical': 0.0, 'mean_word_length': 2.125260960334029, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 7, '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': '6482401', 'n_tokens_mistral': 479, 'n_tokens_neox': 470, 'n_words': 104}