<commit_before>import { Injectable } from '@angular/core';
import { DataService } from '../../_service/dataconnect';
import { Router } from '@angular/router';
import { Cookie } from 'ng2-cookies/ng2-cookies';

@Injectable()
export class UserService {
    private loginUser: any
    constructor(private _dataserver: DataService, private _router: Router) { }

    getMenuMaster(req: any) {
        return this._dataserver.post("GetMenuMaster", req)
    }

    getMenuHead(req: any) {
        return this._dataserver.post("getMenuHead", req)
    }

    getSubMenu(req: any) {
        return this._dataserver.post("getMenu", req);
    }

    getUser() {
        if (this.loginUser === undefined) {
            let usr = Cookie.get('usr');

            if (usr) {
                //this._router.navigate(['login']);
                return null;
            } else {
                //this._router.navigate(['login']);
                return null;
            }
        } else {
            return this.loginUser;
        }
    }

    setUser(userDetails) {
        this.loginUser = userDetails;
        Cookie.delete('usr');
        Cookie.set("usr", userDetails.uid);
    }

    viewUserDetails(req: any) {
        return this._dataserver.post("GetUserMaster", req)
    }

    saveUserMaster(req: any) {
        return this._dataserver.post("SaveUserMaster", req)
    }

    viewUserRights(req: any) {
        return this._dataserver.post("GetUserRights", req)
    }

    saveUserRights(req: any) {
        return this._dataserver.post("SaveUserRights", req)
    }
}<commit_msg>rename function name<commit_after>import { Injectable } from '@angular/core';
import { DataService } from '../../_service/dataconnect';
import { Router } from '@angular/router';
import { Cookie } from 'ng2-cookies/ng2-cookies';

@Injectable()
export class UserService {
    private loginUser: any
    constructor(private _dataserver: DataService, private _router: Router) { }

    getMenuMaster(req: any) {
        return this._dataserver.post("GetMenuMaster", req)
    }

    getMenuHead(req: any) {
        return this._dataserver.post("getMenuHead", req)
    }

    getSubMenu(req: any) {
        return this._dataserver.post("getMenu", req);
    }

    getUser() {
        if (this.loginUser === undefined) {
            let usr = Cookie.get('usr');

            if (usr) {
                //this._router.navigate(['login']);
                return null;
            } else {
                //this._router.navigate(['login']);
                return null;
            }
        } else {
            return this.loginUser;
        }
    }

    setUsers(userDetails) {
        this.loginUser = userDetails;
        Cookie.delete('usr');
        Cookie.set("usr", userDetails.uid);
    }

    getUsers(req: any) {
        return this._dataserver.post("getUsers", req)
    }

    saveUsers(req: any) {
        return this._dataserver.post("saveUsers", req)
    }

    viewUserRights(req: any) {
        return this._dataserver.post("GetUserRights", req)
    }

    saveUserRights(req: any) {
        return this._dataserver.post("SaveUserRights", req)
    }
}
{'fraction_non_alphanumeric': 0.1333758774728781, 'fraction_numerical': 0.0012763241863433313, 'mean_word_length': 2.1957186544342506, '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': '4212901', 'n_tokens_mistral': 977, 'n_tokens_neox': 944, 'n_words': 180}