def __init__(self, host='<STR_LIT:localhost>', userid='<STR_LIT>', password='<STR_LIT>',<EOL>login_method='<STR_LIT>', login_response=None,<EOL>virtual_host='<STR_LIT:/>', locale='<STR_LIT>', client_properties=None,<EOL>ssl=False, connect_timeout=None, channel_max=None,<EOL>frame_max=None, heartbeat=<NUM_LIT:0>, on_blocked=None,<EOL>on_unblocked=None, confirm_publish=False, **kwargs):
channel_max = channel_max or <NUM_LIT><EOL>frame_max = frame_max or <NUM_LIT><EOL>if (login_response is None)and (userid is not None)and (password is not None):<EOL><INDENT>login_response = AMQPWriter()<EOL>login_response.write_table({'<STR_LIT>': userid, '<STR_LIT>': password})<EOL>login_response = login_response.getvalue()[<NUM_LIT:4>:]<EOL><DEDENT>d = dict(LIBRARY_PROPERTIES, **client_properties or {})<EOL>self._method_override = {(<NUM_LIT>, <NUM_LIT:50>): self._dispatch_basic_return}<EOL>self.channels = {}<EOL>super(Connection, self).__init__(self, <NUM_LIT:0>)<EOL>self.transport = None<EOL>self.channel_max = channel_max<EOL>self.frame_max = frame_max<EOL>self.client_heartbeat = heartbeat<EOL>self.confirm_publish = confirm_publish<EOL>self.on_blocked = on_blocked<EOL>self.on_unblocked = on_unblocked<EOL>self._avail_channel_ids = array('<STR_LIT:H>', range(self.channel_max, <NUM_LIT:0>, -<NUM_LIT:1>))<EOL>self.version_major = <NUM_LIT:0><EOL>self.version_minor = <NUM_LIT:0><EOL>self.server_properties = {}<EOL>self.mechanisms = []<EOL>self.locales = []<EOL>self.transport = self.Transport(host, connect_timeout, ssl)<EOL>self.method_reader = MethodReader(self.transport)<EOL>self.method_writer = MethodWriter(self.transport, self.frame_max)<EOL>self.wait(allowed_methods=[<EOL>(<NUM_LIT:10>, <NUM_LIT:10>),  <EOL>])<EOL>self._x_start_ok(d, login_method, login_response, locale)<EOL>self._wait_tune_ok = True<EOL>while self._wait_tune_ok:<EOL><INDENT>self.wait(allowed_methods=[<EOL>(<NUM_LIT:10>, <NUM_LIT:20>),  <EOL>(<NUM_LIT:10>, <NUM_LIT:30>),  <EOL>])<EOL><DEDENT>return self._x_open(virtual_host)<EOL>
Create a connection to the specified host, which should be
        a 'host[:port]', such as 'localhost', or '1.2.3.4:5672'
        (defaults to 'localhost', if a port is not specified then
        5672 is used)

        If login_response is not specified, one is built up for you from
        userid and password if they are present.

        The 'ssl' parameter may be simply True/False, or for Python >= 2.6
        a dictionary of options to pass to ssl.wrap_socket() such as
        requiring certain certificates.