'Connections to the device and sets the terminal type'

def _connect(self):

    if (self._play_context.password and (not self._play_context.private_key_file)):
        C.PARAMIKO_LOOK_FOR_KEYS = False
    super(Connection, self)._connect()
    display.display('ssh    connection    done,    setting    terminal', log_only=True)
    self._shell = self.ssh.invoke_shell()
    self._shell.settimeout(self._play_context.timeout)
    network_os = self._play_context.network_os
    if (not network_os):
        raise AnsibleConnectionFailure('Unable    to    automatically    determine    host    network    os.    Please    manually    configure    ansible_network_os    value    for    this    host')
    self._terminal = terminal_loader.get(network_os, self)
    if (not self._terminal):
        raise AnsibleConnectionFailure(('network    os    %s    is    not    supported' % network_os))
    display.display(('loaded    terminal    plugin    for    network_os    %s' % network_os), log_only=True)
    self._cliconf = cliconf_loader.get(network_os, self)
    if self._cliconf:
        self._rpc.add(self._cliconf)
        display.display(('loaded    cliconf    plugin    for    network_os    %s' % network_os), log_only=True)
    else:
        display.display(('unable    to    load    cliconf    for    network_os    %s' % network_os))
    self.receive()
    display.display('firing    event:    on_open_shell()', log_only=True)
    self._terminal.on_open_shell()
    if getattr(self._play_context, 'become', None):
        display.display('firing    event:    on_authorize', log_only=True)
        auth_pass = self._play_context.become_pass
        self._terminal.on_authorize(passwd=auth_pass)
    self._connected = True
    display.display('ssh    connection    has    completed    successfully', log_only=True)
