def canonicalize_path(cwd, path):
if not os.path.isabs(path):<EOL><INDENT>path = os.path.join(cwd, path)<EOL><DEDENT>return os.path.abspath(path)<EOL>
Canonicalizes a path relative to a given working directory.  That
is, the path, if not absolute, is interpreted relative to the
working directory, then converted to absolute form.

:param cwd: The working directory.
:param path: The path to canonicalize.

:returns: The absolute path.