<commit_before>module Afterburner
    class Permission
      include Mongoid::Document
      field :slug, type: String
      field :name, type: String
    end

    class User
      include Mongoid::Document
      include Mongoid::Timestamps
      field :github_login, type: String
      field :name, type: String
      field :email, type: String
      field :type, type: Symbol
      field :t_shirt_size, type: String
      has_many :applications
      has_and_belongs_to_many :permissions, inverse_of: nil
      has_many :decorations

      def has_permission?(p)
        return self.permissions.where(slug: p).exists?
      end

      def points
        points = 0
        for d in self.decorations
          points += d.medal.points
        end
        return points
      end
    end

    class Session
      include Mongoid::Document
      field :slug, type: String
      field :name, type: String
      field :start, type: Time
      field :end, type: Time
      field :apply_start, type: Time
      field :apply_end, type: Time
      has_one :challenge
      has_many :applications
    end

    class Medal
      include Mongoid::Document
      include Mongoid::Timestamps
      field :name, type: String
      field :image, type: String
      field :image_disabled, type: String
      field :points, type: Integer
      field :sort_key, type: String
      field :description, type: String
      field :secret, type: Boolean
      has_many :decorations
    end

    class Decoration
      include Mongoid::Document
      include Mongoid::Timestamps
      belongs_to :user
      belongs_to :medal
    end

    class Challenge
      include Mongoid::Document
      include Mongoid::Timestamps
      field :slug, type: String
      field :name, type: String
      belongs_to :session
    end

    class Application
      include Mongoid::Document
      include Mongoid::Timestamps
      field :github_login, type: String
      field :repo, type: String
      field :project_description, type: String
      belongs_to :user
      belongs_to :session
    end
end
<commit_msg>Chagne has_permission? to take a list of permissions<commit_after>module Afterburner
    class Permission
      include Mongoid::Document
      field :slug, type: String
      field :name, type: String
    end

    class User
      include Mongoid::Document
      include Mongoid::Timestamps
      field :github_login, type: String
      field :name, type: String
      field :email, type: String
      field :type, type: Symbol
      field :t_shirt_size, type: String
      has_many :applications
      has_and_belongs_to_many :permissions, inverse_of: nil
      has_many :decorations

      def has_permission?(*perms)
        b = false
        for p in perms
          b |= self.permissions.where(slug: p).exists?
        end
        return b
      end

      def points
        points = 0
        for d in self.decorations
          points += d.medal.points
        end
        return points
      end
    end

    class Session
      include Mongoid::Document
      field :slug, type: String
      field :name, type: String
      field :start, type: Time
      field :end, type: Time
      field :apply_start, type: Time
      field :apply_end, type: Time
      has_one :challenge
      has_many :applications
    end

    class Medal
      include Mongoid::Document
      include Mongoid::Timestamps
      field :name, type: String
      field :image, type: String
      field :image_disabled, type: String
      field :points, type: Integer
      field :sort_key, type: String
      field :description, type: String
      field :secret, type: Boolean
      has_many :decorations
    end

    class Decoration
      include Mongoid::Document
      include Mongoid::Timestamps
      belongs_to :user
      belongs_to :medal
    end

    class Challenge
      include Mongoid::Document
      include Mongoid::Timestamps
      field :slug, type: String
      field :name, type: String
      belongs_to :session
    end

    class Application
      include Mongoid::Document
      include Mongoid::Timestamps
      field :github_login, type: String
      field :repo, type: String
      field :project_description, type: String
      belongs_to :user
      belongs_to :session
    end
end

{'fraction_non_alphanumeric': 0.06255857544517339, 'fraction_numerical': 0.00046860356138706655, 'mean_word_length': 2.2712643678160918, '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': '1959579', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1180, 'n_words': 400}