<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_ssh_client( ip_addr, ssh_key=None, host_name=None, ssh_tries=None, propagate_fail=True, username='root', password='123456', ):
 """ Get a connected SSH client Args: ip_addr(str):
 IP address of the endpoint ssh_key(str or list of str):
 Path to a file which contains the private key hotname(str):
 The hostname of the endpoint ssh_tries(int):
 The number of attempts to connect to the endpoint propagate_fail(bool):
 If set to true, this event will be in the log and fail the outer stage. Otherwise, it will be discarded. username(str):
 The username to authenticate with password(str):
 Used for password authentication or for private key decryption Raises: :exc:`~LagoSSHTimeoutException`: If the client failed to connect after "ssh_tries" """

    host_name = host_name or ip_addr
    with LogTask(
        'Get ssh client for %s' % host_name,
        level='debug',
        propagate_fail=propagate_fail,
    ):
        ssh_timeout = int(config.get('ssh_timeout'))
        if ssh_tries is None:
            ssh_tries = int(config.get('ssh_tries', 10))

        start_time = time.time()
        client = paramiko.SSHClient()
        client.set_missing_host_key_policy(paramiko.AutoAddPolicy(), )
        while ssh_tries > 0:
            try:
                client.connect(
                    ip_addr,
                    username=username,
                    password=password,
                    key_filename=ssh_key,
                    timeout=ssh_timeout,
                )
                break
            except (socket.error, socket.timeout) as err:
                LOGGER.debug(
                    'Socket error connecting to %s: %s',
                    host_name,
                    err,
                )
            except paramiko.ssh_exception.SSHException as err:
                LOGGER.debug(
                    'SSH error connecting to %s: %s',
                    host_name,
                    err,
                )
            except EOFError as err:
                LOGGER.debug('EOFError connecting to %s: %s', host_name, err)
            ssh_tries -= 1
            LOGGER.debug(
                'Still got %d tries for %s',
                ssh_tries,
                host_name,
            )
            time.sleep(1)
        else:
            end_time = time.time()
            raise LagoSSHTimeoutException(
                'Timed out (in %d s) trying to ssh to %s' %
                (end_time - start_time, host_name)
            )

    return client