def auth_password(self):
        """
        Try to authenticate with a password.  Ask the user for a password.
        If the user will return a password, return True.  Otherwise, return
        False.

        @rtype: L{bool}
        """
        d = self.getPassword()
        if d:
            d.addCallbacks(self._cbPassword, self._ebAuth)
            return True
        else: # returned None, don't do password auth
            return False

        Try to authenticate with a password.  Ask the user for a password.
        If the user will return a password, return True.  Otherwise, return
        False.

        @rtype: L{bool}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/conch/ssh/userauth.py