<commit_before>module Signatures
  module Validators
    class Basic
      attr_accessor :keystore, :signer, :expiration_time, :clock

      def initialize(keystore: {}, signer: Signers::Keystore.new(keystore: keystore), expiration_time: 900, clock: Time)
        self.signer = signer
        self.expiration_time = expiration_time
        self.clock = clock
      end

      def call(to_validate:, signature:, key:, timestamp: nil)
        !expired_signature?(timestamp) &&
        signer.call(to_validate, key: key, timestamp: timestamp) == signature
      end

      private

      def expired_signature?(timestamp)
        timestamp && !timestamp.empty? && (clock.now.to_i - timestamp.to_i) > expiration_time
      end

      attr_writer :keystore, :signer, :expiration_time, :clock
    end
  end
end<commit_msg>Fixing stuff<commit_after>module Signatures
  module Validators
    class Basic
      attr_accessor :keystore, :signer, :expiration_time, :clock

      def initialize(keystore: {}, signer: Signers::Keystore.new(keystore: keystore), expiration_time: 900, clock: Time)
        self.signer = signer
        self.expiration_time = expiration_time
        self.clock = clock
      end

      def call(to_validate:, signature:, key:, timestamp: nil)
        !expired_signature?(timestamp) &&
        signer.call(to_validate, key: key, timestamp: timestamp) == signature
      end

      private

      def expired_signature?(timestamp)
        timestamp && timestamp.to_i != 0 && (clock.now.to_i - timestamp.to_i) > expiration_time
      end

      attr_writer :keystore, :signer, :expiration_time, :clock
    end
  end
end
{'fraction_non_alphanumeric': 0.09920391916717697, 'fraction_numerical': 0.004286589099816289, 'mean_word_length': 3.1262626262626263, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3084871', 'n_tokens_mistral': 516, 'n_tokens_neox': 482, 'n_words': 117}