<commit_before><?php

class UserRole extends Eloquent {
        
        const GROUP_LEADER = 0;
        const LAB_LEADER = 1;
        const SUPER_ADMIN = 2;
    
	public function user()
	{
		return $this->belongsTo('User');
	}

	public function role()
	{
		return $this->morphTo();
	}
        
        public static function getUserRole($roleId) {
            $roles = UserRole::where('user_id', '=', Auth::user()->id)->get();
            foreach($roles as $role) {
                if($role->role_id == $roleId) 
                    return $role;
            }      
            return null;
        }    
        
        public static function updateRole($user, $roleId, $isActive) {
            $role = UserRole::getUserRole($roleId);<commit_msg>-fixed constants<commit_after><?php

class UserRole extends Eloquent {
        

        const SUPER_ADMIN = 1;
        const LAB_LEADER = 2;
        const GROUP_LEADER = 3;
    
	public function user()
	{
		return $this->belongsTo('User');
	}

	public function role()
	{
		return $this->morphTo();
	}
        
        public static function getUserRole($roleId) {
            $roles = UserRole::where('user_id', '=', Auth::user()->id)->get();
            foreach($roles as $role) {
                if($role->role_id == $roleId) 
                    return $role;
            }      
            return null;
        }    
        
        public static function updateRole($user, $roleId, $isActive) {
            $role = UserRole::getUserRole($roleId);
{'fraction_non_alphanumeric': 0.1283244680851064, 'fraction_numerical': 0.003989361702127659, 'mean_word_length': 1.787037037037037, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1743227', 'n_tokens_mistral': 474, 'n_tokens_neox': 449, 'n_words': 96}