#NEWLINE# def __init__( self , body = '' , channel = None , **properties ) : #NEWLINE# #INDENT# "\n        If `body` is a `str`, then `content_encoding` will automatically be set to 'UTF-8', unless\n        explicitly specified.\n\n        Example::\n\n            msg = Message('hello world', content_type='text/plain', application_headers={'foo': 7})\n\n        :param body: message body\n        :type body: bytes or str or unicode\n        :param channel: associated channel\n        :type channel: amqpy.channel.Channel\n        :param properties:\n            * content_type (shortstr): MIME content type\n            * content_encoding (shortstr): MIME content encoding\n            * application_headers: (table): Message header field table:\n              dict[str, str|int|Decimal|datetime|dict]\n            * delivery_mode: (octet): Non-persistent (1) or persistent (2)\n            * priority (octet): The message priority, 0 to 9\n            * correlation_id (shortstr) The application correlation identifier\n            * reply_to (shortstr) The destination to reply to\n            * expiration (shortstr): Message expiration specification\n            * message_id (shortstr): The application message identifier\n            * timestamp (datetime.datetime): The message timestamp\n            * type (shortstr): The message type name\n            * user_id (shortstr): The creating user id\n            * app_id (shortstr): The creating application id\n            * cluster_id (shortstr): Intra-cluster routing identifier\n        " #NEWLINE# super ( Message , self ) . __init__ ( properties ) #NEWLINE# self . body = body #NEWLINE# self . channel = channel #NEWLINE# self . delivery_info = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# if isinstance ( body , six . string_types ) : #NEWLINE# #INDENT# self . properties [ 'content_encoding' ] = properties . get ( 'content_encoding' , 'UTF-8' )