Show a Gtk password dialog.

    :returns: the password or ``None`` if the user aborted the operation
    :raises RuntimeError: if Gtk can not be properly initialized
349974
async def password_dialog(key, title, message, options):
    
    with PasswordDialog.create(key, title, message, options) as dialog:
        response = await dialog
        if response == Gtk.ResponseType.OK:
            return PasswordResult(dialog.get_text(),
                                  dialog.use_cache.get_active())
        return None
27798
def get_password(self):
        
        password = self.get_as_nullable_string("password")
        password = password if password != None else self.get_as_nullable_string("pass")
        return password
1079536
public static void showDialog() {

        final CmsPopup popup = new CmsPopup(
            Messages.get().key(Messages.GUI_PASSWORD_CHANGE_TITLE_1, CmsCoreProvider.get().getUserInfo().getName()));
        popup.setModal(true);
        popup.setGlassEnabled(true);
        CmsPushButton okButton = new CmsPushButton();
        okButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.RED);
        okButton.setText(Messages.get().key(Messages.GUI_OK_0));
        okButton.setUseMinWidth(true);
        CmsPushButton cancelButton = new CmsPushButton();
        cancelButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.BLUE);
        cancelButton.setText(Messages.get().key(Messages.GUI_CANCEL_0));
        cancelButton.setUseMinWidth(true);
        popup.addButton(cancelButton);
        popup.addButton(okButton);

        Runnable finishAction = new Runnable() {

            public void run() {

                popup.hide();
            }
        };
        final CmsChangePasswordWidget passwordWidget = new CmsChangePasswordWidget(finishAction);
        okButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent e) {

                passwordWidget.changePassword();
            }
        });

        cancelButton.addClickHandler(new ClickHandler() {

            public void onClick(ClickEvent e) {

                popup.hide();
            }
        });
        popup.setMainContent(passwordWidget);
        popup.center();

    }
210166
def password_prompt(ctx, param, value):
    """"""
    if ctx.resilient_parsing:
        return

    if not value:
        if 'password_stdin' in ctx.params:
            with click.open_file('-') as fp:
                value = fp.read().strip('\n')
        else:
            value = click.prompt('Password', hide_input=True)

    click.echo(value)
    return value
863599
def unlock_password(name, root=None):
    '''
    
    '''
    pre_info = info(name, root=root)
    if not pre_info['name']:
        return False

    if not pre_info['passwd'].startswith('!'):
        return True

    cmd = ['passwd']

    if root is not None:
        cmd.extend(('-R', root))

    cmd.extend(('-u', name))

    __salt__['cmd.run'](cmd, python_shell=False)
    return not info(name, root=root)['passwd'].startswith('!')
593808
def password_link_expired(self, now=None):
        
        if not now: now = datetime.datetime.utcnow()
        return self.password_link_expires < now
1150488
def gtpswd(prompt, confirmPassword):
    
    try:
        return util.getPassword(prompt=prompt,
                                confirmPrompt=confirmPassword,
                                confirm=True)
    except TypeError:
        return util.getPassword(prompt=prompt,
                                confirm=True)
1135150
def _prompt_password(prompt="Password: "):
    """"""
    fd = sys.stdin.fileno()
    old_settings = termios.tcgetattr(fd)
    tty.setraw(fd)

    print(prompt, end="", flush=True)
    password = []
    try:
        while True:
            ch = sys.stdin.buffer.read(1)[0]
            if ch in (ord("\r"), ord("\n"), 4):  # If user presses Enter or ctrl-d
                print("\r")
                break
            elif ch == 127:  # DEL
                try:
                    password.pop()
                except IndexError:
                    pass
                else:
                    print("\b \b", end="", flush=True)
            elif ch == 3:  # ctrl-c
                print("^C", end="", flush=True)
                raise KeyboardInterrupt
            else:
                password.append(ch)
                print("*", end="", flush=True)
    finally:
        termios.tcsetattr(fd, termios.TCSADRAIN, old_settings)

    return bytes(password).decode()
1349428
def password(self):
        
        return self.response_class(request=self.request,
                                   template='zinnia/password.html',
                                   context={'error': self.error})
771420
def OnNewGpgKey(self, event):
        

        if gnupg is None:
            return

        if genkey is None:
            # gnupg is not present
            self.interfaces.display_warning(
                _("Python gnupg not found. No key selected."),
                _("Key selection failed."))
        else:
            # gnupg is present
            genkey()
198610
def special_login_handler(self, delay_factor=1):
        
        delay_factor = self.select_delay_factor(delay_factor)
        i = 0
        time.sleep(delay_factor * 0.5)
        output = ""
        while i <= 12:
            output = self.read_channel()
            if output:
                if "login as" in output or "User:" in output:
                    self.write_channel(self.username + self.RETURN)
                elif "Password" in output:
                    self.write_channel(self.password + self.RETURN)
                    break
                time.sleep(delay_factor * 1)
            else:
                self.write_channel(self.RETURN)
                time.sleep(delay_factor * 1.5)
            i += 1
373835
def check_password(raw_password, enc_password):
    
    algo, salt, hsh = enc_password.split('$')
    return enc_password == encrypt_password(raw_password, algorithm=algo,
                                            salt=salt)
594380
def _config_chooser_dialog(self, title_text, description):
        
        dialog = Gtk.Dialog(title_text, self.view["preferences_window"],
                            flags=0, buttons=
                            (Gtk.STOCK_CANCEL, Gtk.ResponseType.REJECT,
                             Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT))
        label = Gtk.Label(label=description)
        label.set_padding(xpad=10, ypad=10)
        dialog.vbox.pack_start(label, True, True, 0)
        label.show()
        self._gui_checkbox = Gtk.CheckButton(label="GUI Config")
        dialog.vbox.pack_start(self._gui_checkbox, True, True, 0)
        self._gui_checkbox.show()
        self._core_checkbox = Gtk.CheckButton(label="Core Config")
        self._core_checkbox.show()
        dialog.vbox.pack_start(self._core_checkbox, True, True, 0)
        response = dialog.run()
        dialog.destroy()
        return response
193157
def pwned_password(password):
    
    if not isinstance(password, text_type):
        raise TypeError('Password values to check must be Unicode strings.')
    password_hash = hashlib.sha1(password.encode('utf-8')).hexdigest().upper()
    prefix, suffix = password_hash[:5], password_hash[5:]
    results = _get_pwned(prefix)
    if results is None:
        # Gracefully handle timeouts and HTTP error response codes.
        return None
    return results.get(suffix, 0)
1193287
def _get_password(params):
        
        user_name = params['user']
        service_name = params['host'] + ':' + params['driver']
        return keyring.get_password(service_name=service_name,
                                    username=user_name)
203027
def _load_password_from_keyring(self):
        
        try:
            keyring = __import__('keyring')
            return keyring.get_password(self.repository, self.username)
        except Exception:
            pass
217157
private JCheckBox getChkShowPassword() {
		if (chkShowPassword == null) {
			chkShowPassword = new JCheckBox();
			chkShowPassword.setText(Constant.messages.getString("conn.options.proxy.auth.showpass"));
			chkShowPassword.addActionListener(new java.awt.event.ActionListener() { 

				@Override
				public void actionPerformed(java.awt.event.ActionEvent e) {    
					if (chkShowPassword.isSelected()) {
						txtProxyChainPassword.setEchoChar((char) 0);
			        } else {
			        	txtProxyChainPassword.setEchoChar('*');
			        }
				}
			});

		}
		return chkShowPassword;
	}