#NEWLINE# def compare_versions( v1 , v2 ) : #NEWLINE# #INDENT# 'Compare two version strings.\n    Returns True if the former is (strictly) greater than the later,\n            False otherwise.\n    ' #NEWLINE# def normalize( v ) : #NEWLINE# #INDENT# return tuple ( map ( int , re . sub ( '(\\.0+)*$' , '' , v ) . split ( '.' ) ) ) #NEWLINE# #UNINDENT# return ( normalize ( v1 ) > normalize ( v1 ) )