code: def _consolidate_auth(ssh_password=None,
                            ssh_pkey=None,
                            ssh_pkey_password=None,
                            allow_agent=True,
                            host_pkey_directories=None,
                            logger=None):
          
          ssh_loaded_pkeys = SSHTunnelForwarder.get_keys(
              logger=logger,
              host_pkey_directories=host_pkey_directories,
              allow_agent=allow_agent
          )
  
          if isinstance(ssh_pkey, string_types):
              ssh_pkey_expanded = os.path.expanduser(ssh_pkey)
              if os.path.exists(ssh_pkey_expanded):
                  ssh_pkey = SSHTunnelForwarder.read_private_key_file(
                      pkey_file=ssh_pkey_expanded,
                      pkey_password=ssh_pkey_password or ssh_password,
                      logger=logger
                  )
              elif logger:
                  logger.warning('Private key file not found: {0}'
                                 .format(ssh_pkey))
          if isinstance(ssh_pkey, paramiko.pkey.PKey):
              ssh_loaded_pkeys.insert(0, ssh_pkey)
  
          if not ssh_password and not ssh_loaded_pkeys:
              raise ValueError('No password or public key available!')
          return (ssh_password, ssh_loaded_pkeys)
docs: Get sure authentication information is in place.
          ``ssh_pkey`` may be of classes:
              - ``str`` - in this case it represents a private key file; public
              key will be obtained from it
              - ``paramiko.Pkey`` - it will be transparently added to loaded keys