def expandcorepath(pathname, session=None, node=None):
    if session is not None:
        pathname = pathname.replace('~', "/home/%s" % session.user)
        pathname = pathname.replace('%SESSION%', str(session.sessionid))
        pathname = pathname.replace('%SESSION_DIR%', session.sessiondir)
        pathname = pathname.replace('%SESSION_USER%', session.user)
    if node is not None:
        pathname = pathname.replace('%NODE%', str(node.objid))
        pathname = pathname.replace('%NODENAME%', node.name)
    return pathname
Expand a file path given session information.
dataset/ETHPy150Open coreemu/core/daemon/core/misc/utils.py/expandcorepath