#NEWLINE# def has_max_length( value , ln ) : #NEWLINE# #INDENT# '\n    Ensure the given value is a maximum length.\n    ' #NEWLINE# if ( value is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( ( not value ) or ( len ( value ) > ln ) ) : #NEWLINE# #INDENT# return c ( 'maxlength' ) . replace ( '{length}' , str ( ln ) )