<commit_before>require "credentials"
require "menu"

class Role < ActiveRecord::Base
  include ApplicationHelper

  belongs_to :parent, class_name: 'Role'
  has_many :users

  serialize :cache
  validates_presence_of :name
  validates_uniqueness_of :name

  attr_reader :cache
  attr_writer :cache
  attr_reader :student, :ta, :instructor, :administrator, :superadministrator

   def cache
    @cache = Hash.new
    unless self.nil?
      @cache[:credentials] = get_cache_roles(self.id)[:credentials]
      @cache[:menu] = get_cache_roles(self.id)[:menu]
    end
    @cache
  end

  def self.find_or_create_by_name(params)
    Role.find_or_create_by(name: params)
  end

  def self.student
    @@student_role ||= find_by_name 'Student'
  end

  def student?
    name['Student']
  end

  def instructor?
    name['Instructor']
  end

  def ta?
    name['Teaching Assistant']
  end
<commit_msg>Resolving indentation issue.<commit_after>require "credentials"
require "menu"

class Role < ActiveRecord::Base
  include ApplicationHelper

  belongs_to :parent, class_name: 'Role'
  has_many :users

  serialize :cache
  validates_presence_of :name
  validates_uniqueness_of :name

  attr_reader :cache
  attr_writer :cache
  attr_reader :student, :ta, :instructor, :administrator, :superadministrator

  def cache
    @cache = Hash.new
    unless self.nil?
      @cache[:credentials] = get_cache_roles(self.id)[:credentials]
      @cache[:menu] = get_cache_roles(self.id)[:menu]
    end
    @cache
  end

  def self.find_or_create_by_name(params)
    Role.find_or_create_by(name: params)
  end

  def self.student
    @@student_role ||= find_by_name 'Student'
  end

  def student?
    name['Student']
  end

  def instructor?
    name['Instructor']
  end

  def ta?
    name['Teaching Assistant']
  end

{'fraction_non_alphanumeric': 0.09844271412680757, 'fraction_numerical': 0.0, 'mean_word_length': 3.9287671232876713, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1411211', 'n_tokens_mistral': 631, 'n_tokens_neox': 608, 'n_words': 138}