#NEWLINE# def is_canonical( path ) : #NEWLINE# #INDENT# 'True if path is absolute and normalized.\n\n    Canonical path is unique, i.e. two different such paths are never\n    equivalent.\n    ' #NEWLINE# if ( ( path == '' ) or ( not posixpath . isabs ( path ) ) or path . startswith ( '//' ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# normalized_path = posixpath . normpath ( path ) #NEWLINE# if ( ( path != path ) and ( ( normalized_path + '/' ) != path ) ) : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# return True