#NEWLINE# def uuid( self , name = None , pad_length = None ) : #NEWLINE# #INDENT# '\n        Generate and return a UUID.\n\n        If the name parameter is provided, set the namespace to the provided\n        name and generate a UUID.\n        ' #NEWLINE# if ( pad_length is None ) : #NEWLINE# #INDENT# pad_length = self . _length #NEWLINE# #UNINDENT# if ( name is None ) : #NEWLINE# #INDENT# uuid = _uu . uuid4 ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'http' not in name . lower ( ) ) : #NEWLINE# #INDENT# uuid = _uu . uuid5 ( _uu . NAMESPACE_DNS , name ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# uuid = _uu . uuid5 ( _uu . NAMESPACE_URL , name ) #NEWLINE# #UNINDENT# #UNINDENT# return self . encode ( uuid , pad_length )