def sync_file(user, session, filename, index):
    if index == '0':
        logging.debug('Compiling session dependency ...')
        (rc, msg) = Compiler.compile_pyimport(user, session)
        if not rc:
            return rc, msg

    _file = os.path.join(ServerSettings.session_path(session), filename)
    if os.path.exists(_file):
        (rc, msgs) = Compiler.compile_cxml(user, session, _file)
    else:
        logging.error('sync_file: File %s not found ' % filename)
        (rc, msgs) = (False, None)
    return rc, msgs
Compile yang module
dataset/ETHPy150Open CiscoDevNet/yang-explorer/server/explorer/utils/uploader.py/sync_file