<commit_before>require "ditties"

module Integrity
  module Helpers
    module Authorization
      include Sinatra::Authorization

      def authorization_realm
        "Integrity"
      end

      def authorized?
        return true unless Integrity.config[:use_basic_auth]
        !!request.env["REMOTE_USER"]
      end

      def authorize(user, password)
        if Integrity.config[:hash_admin_password]
          password = <PASSWORD>(password)
        end

        !Integrity.config[:use_basic_auth] ||
        (Integrity.config[:admin_username] == user &&
          Integrity.config[:admin_password] == password)
      end<commit_msg>Duh, right, we should require now 'sinatra/ditties', not just 'ditties'<commit_after>require "sinatra/ditties"

module Integrity
  module Helpers
    module Authorization
      include Sinatra::Authorization

      def authorization_realm
        "Integrity"
      end

      def authorized?
        return true unless Integrity.config[:use_basic_auth]
        !!request.env["REMOTE_USER"]
      end

      def authorize(user, password)
        if Integrity.config[:hash_admin_password]
          password = <PASSWORD>(password)
        end

        !Integrity.config[:use_basic_auth] ||
        (Integrity.config[:admin_username] == user &&
          Integrity.config[:admin_password] == password)
      end
{'fraction_non_alphanumeric': 0.08962962962962963, 'fraction_numerical': 0.0, 'mean_word_length': 2.7320441988950277, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2750149', 'n_tokens_mistral': 385, 'n_tokens_neox': 370, 'n_words': 80}