def init(pid, id, model, arg=None):
    """
    :param pid: process id
    :param id: session id
    :param model: model path
    :param arg: extra arguments
    :return: None
    """
    _cwd = os.getcwd()
    os.chdir(_BASEDIR)

    _libc.tr_init(pid, id, c_ptr(model), arg)

    os.chdir(_cwd)

    :param pid: process id
    :param id: session id
    :param model: model path
    :param arg: extra arguments
    :return: None
    
backend/tr/tr.py