#NEWLINE# def __bits2mask( self , bits ) : #NEWLINE# #INDENT# if ( ( self <= 32 ) and ( bits >= 0 ) ) : #NEWLINE# #INDENT# return ( ( 4294967295 << ( 32 - bits ) ) & 4294967295 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'mask bits must be in range 0 to 32' )