def _create_message(response, service_instance):
respbody = response.body<EOL>custom_properties = {}<EOL>broker_properties = None<EOL>message_type = None<EOL>message_location = None<EOL>for name, value in response.headers:<EOL><INDENT>if name.lower() == '<STR_LIT>':<EOL><INDENT>broker_properties = json.loads(value)<EOL><DEDENT>elif name.lower() == '<STR_LIT>':<EOL><INDENT>message_type = value<EOL><DEDENT>elif name.lower() == '<STR_LIT:location>':<EOL><INDENT>message_location = value<EOL><DEDENT>elif name.lower() not in ['<STR_LIT>',<EOL>'<STR_LIT>',<EOL>'<STR_LIT:date>',<EOL>'<STR_LIT>']:<EOL><INDENT>if '<STR_LIT:">' in value:<EOL><INDENT>value = value[<NUM_LIT:1>:-<NUM_LIT:1>].replace('<STR_LIT>', '<STR_LIT:">')<EOL>try:<EOL><INDENT>custom_properties[name] = datetime.strptime(<EOL>value, '<STR_LIT>')<EOL><DEDENT>except ValueError:<EOL><INDENT>custom_properties[name] = value<EOL><DEDENT><DEDENT>elif value.lower() == '<STR_LIT:true>':<EOL><INDENT>custom_properties[name] = True<EOL><DEDENT>elif value.lower() == '<STR_LIT:false>':<EOL><INDENT>custom_properties[name] = False<EOL><DEDENT>else:  <EOL><INDENT>try:<EOL><INDENT>float_value = float(value)<EOL>if str(int(float_value)) == value:<EOL><INDENT>custom_properties[name] = int(value)<EOL><DEDENT>else:<EOL><INDENT>custom_properties[name] = float_value<EOL><DEDENT><DEDENT>except ValueError:<EOL><INDENT>pass<EOL><DEDENT><DEDENT><DEDENT><DEDENT>if message_type is None:<EOL><INDENT>message = Message(<EOL>respbody, service_instance, message_location, custom_properties,<EOL>'<STR_LIT>', broker_properties)<EOL><DEDENT>else:<EOL><INDENT>message = Message(respbody, service_instance, message_location,<EOL>custom_properties, message_type, broker_properties)<EOL><DEDENT>return message<EOL>
Create message from response.

    response:
        response from Service Bus cloud server.
    service_instance:
        the Service Bus client.