def setuser(user_or_pid):
    try:
        try:
            userinfo = pwd.getpwuid(int(user_or_pid))
        except ValueError:
            userinfo = pwd.getpwnam(user_or_pid)

        __fix_perms(userinfo)
        os.setgid(userinfo.pw_gid)
        os.setuid(userinfo.pw_uid)
        return True
    except __HOLE__ as e:
        print(str(e))
        return False
dataset/ETHPy150Open memsql/memsql-loader/memsql_loader/util/setuser.py/setuser