<s> '''<STR_LIT>''' <EOL> class Message ( object ) : <EOL> '''<STR_LIT>''' <EOL> def __init__ ( self , body = '<STR_LIT>' , delivery_info = None , return_info = None , <EOL> ** properties ) : <EOL> '''<STR_LIT>''' <EOL> if isinstance ( body , unicode ) : <EOL> if '<STR_LIT>' not in properties : <EOL> properties [ '<STR_LIT>' ] = '<STR_LIT:utf-8>' <EOL> body = body . encode ( properties [ '<STR_LIT>' ] ) <EOL> if not isinstance ( body , ( str , unicode , bytearray ) ) : <EOL> raise TypeError ( "<STR_LIT>" % ( type ( body ) ) ) <EOL> self . _body = body <EOL> self . _delivery_info = delivery_info <EOL> self . _return_info = return_info <EOL> self . _properties = properties <EOL> @ property <EOL> def body ( self ) : <EOL> return self . _body <EOL> def __len__ ( self ) : <EOL> return len ( self . _body ) <EOL> def __nonzero__ ( self ) : <EOL> '''<STR_LIT>''' <EOL> return True <EOL> def __eq__ ( self , other ) : <EOL> if isinstance ( other , Message ) : <EOL> return self . _properties == other . _properties and self . _body == other . _body <EOL> return False <EOL> @ property <EOL> def delivery_info ( self ) : <EOL> '''<STR_LIT>''' <EOL> return self . _delivery_info <EOL> @ property <EOL> def return_info ( self ) : <EOL> '''<STR_LIT>''' <EOL> return self . _return_info <EOL> @ property <EOL> def properties ( self ) : <EOL> return self . _properties <EOL> def __str__ ( self ) : <EOL> return ( "<STR_LIT>" <EOL> "<STR_LIT>" ) % ( str ( self . _body ) . encode ( '<STR_LIT>' ) , <EOL> self . _delivery_info , self . return_info , self . _properties ) </s>
