<commit_before># -*- encoding : utf-8 -*-

module Mongoid
module Userstamp

  module User

    extend ActiveSupport::Concern

    included do

      Mongoid::Userstamp.add_user_class(self)

      def current?
        self._id == Mongoid::Userstamp.current_user(self.class).try(:_id)
      end
    end

    module ClassMethods

      def current
        Mongoid::Userstamp.current_user(self)
      end

      def current=(value)
        Mongoid::Userstamp.set_current_user(value, self)
      end

      def do_as(user, &block)
        old = self.current
        begin
          self.current = user
          response = block.call unless block.nil?
        ensure
          self.current = old
        end
        response
      end

      def mongoid_userstamp_user(opts = {})
        @mongoid_userstamp_user ||= Mongoid::Userstamp::UserConfig.new(opts = {})
      end
    end
  end
end
end<commit_msg>Fix stupid error<commit_after># -*- encoding : utf-8 -*-

module Mongoid
module Userstamp

  module User

    extend ActiveSupport::Concern

    included do

      Mongoid::Userstamp.add_user_class(self)

      def current?
        self._id == Mongoid::Userstamp.current_user(self.class).try(:_id)
      end
    end

    module ClassMethods

      def current
        Mongoid::Userstamp.current_user(self)
      end

      def current=(value)
        Mongoid::Userstamp.set_current_user(value, self)
      end

      def do_as(user, &block)
        old = self.current
        begin
          self.current = user
          response = block.call unless block.nil?
        ensure
          self.current = old
        end
        response
      end

      def mongoid_userstamp_user(opts = {})
        @mongoid_userstamp_user ||= Mongoid::Userstamp::UserConfig.new(opts)
      end
    end
  end
end
end
{'fraction_non_alphanumeric': 0.08731924360400445, 'fraction_numerical': 0.0011123470522803114, 'mean_word_length': 2.085763293310463, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4874941', 'n_tokens_mistral': 560, 'n_tokens_neox': 546, 'n_words': 117}