<commit_before>class ApiKey < ActiveRecord::Base
  belongs_to :developer_account, :inverse_of => :api_keys

  def self.revoked
    where("revoked_at IS NOT NULL")
  end

  def self.unrevoked
    where("revoked_at IS NULL")
  end

  def self.generate!(developer_account_id)
    create!({
      :developer_account_id => developer_account_id,
      :secret => "temporary-#{Time.zone.now.to_datetime.to_s}"
    })
  end

  def revoke!
    update_attributes!(:revoked_at => Time.zone.now)
  end
end
<commit_msg>generating real api keys<commit_after>class ApiKey < ActiveRecord::Base
  belongs_to :developer_account, :inverse_of => :api_keys

  def self.revoked
    where("revoked_at IS NOT NULL")
  end

  def self.unrevoked
    where("revoked_at IS NULL")
  end

  def self.generate!(developer_account_id)
    create!({
      :developer_account_id => developer_account_id,
      :secret => SecureRandom.urlsafe_base64
    })
  end

  def revoke!
    update_attributes!(:revoked_at => Time.zone.now)
  end
end

{'fraction_non_alphanumeric': 0.1044776119402985, 'fraction_numerical': 0.001990049751243781, 'mean_word_length': 3.8365384615384617, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, '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': '6920128', 'n_tokens_mistral': 356, 'n_tokens_neox': 343, 'n_words': 71}