def urlpath_to_abspath(path, base, os_sep=os.sep):
prefix = base if base.endswith(os_sep) else base + os_sep<EOL>realpath = os.path.abspath(prefix + path.replace('<STR_LIT:/>', os_sep))<EOL>if check_path(base, realpath) or check_under_base(realpath, base):<EOL><INDENT>return realpath<EOL><DEDENT>raise OutsideDirectoryBase("<STR_LIT>" % (realpath, base))<EOL>
Make uri relative path fs absolute using a given absolute base path.

:param path: relative path
:param base: absolute base path
:param os_sep: path component separator, defaults to current OS separator
:return: absolute path
:rtype: str or unicode
:raises OutsideDirectoryBase: if resulting path is not below base