<commit_before>class User
  include Mongoid::Document
  include Mongoid::Timestamps

  field :email, type: String
  field :encrypted_password, type: String

  index({ email: 1 }, { unique: true })

  # Get password - it will return special hash object according to encrypted password.
  # This object is allowed to equal with actual password string.
  def password
    unless @password
      begin
        @password = ::BCrypt::Password.new(self.encrypted_password)
      rescue
        @password = nil
      end
    end
    @password
  end

  # Set password.
  # Password will be converted to special hash object.
  # This hash object also will be written into encrypted password.
  def password=(new_password)
    @password = <PASSWORD>.<PASSWORD>(<PASSWORD>)<commit_msg>Added simple model for critical periods - just to have a look (2).<commit_after>class User
  include Mongoid::Document
  include Mongoid::Timestamps

  field :email, type: String
  field :encrypted_password, type: String

  has_many :critical_periods

  index({ email: 1 }, { unique: true })

  # Get password - it will return special hash object according to encrypted password.
  # This object is allowed to equal with actual password string.
  def password
    unless @password
      begin
        @password = <PASSWORD>(self.encrypted_password)
      rescue
        @password = nil
      end
    end
    @password
  end

  # Set password.
  # Password will be converted to special hash object.
  # This hash object also will be written into encrypted password.
  def password=(new_password)
    @password = <PASSWORD>.<PASSWORD>(<PASSWORD>)
{'fraction_non_alphanumeric': 0.0766852195423624, 'fraction_numerical': 0.0018552875695732839, 'mean_word_length': 3.2917771883289126, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '7013230', 'n_tokens_mistral': 445, 'n_tokens_neox': 428, 'n_words': 170}