Ask the user for a password. Specify a custom
 _message_ other than 'Password: ' or override the
 default _mask_ of '*'.
16977
def password(message = 'Password: ', mask = '*')
      pass = ask(message) { |q| q.echo = mask }
      pass = password message, mask if pass.nil? || pass.empty?
      pass
    end
75637
def change_user_password(user, password):
    
    user.password = hash_password(password)
    _datastore.put(user)
    send_password_changed_notice(user)
    password_changed.send(current_app._get_current_object(),
                          user=user)
1137804
def get_tty_password(confirm):
    """"""
    LOG.debug("Reading password from TTY")
    new_password = getpass('Enter Password: ', stream=sys.stderr)
    if not new_password:
        raise aomi.exceptions.AomiCommand("Must specify a password")

    if not confirm:
        return new_password

    confirm_password = getpass('Again, Please: ', stream=sys.stderr)
    if confirm_password != new_password:
        raise aomi.exceptions.AomiCommand("Passwords do not match")

    return new_password
1350300
def pin(self, mask: str = '####') -> str:
        
        return self.random.custom_code(mask=mask)
1033310
def change_password(self, previous, new_password):
        
        if not self.verify_password(previous):
            raise exceptions.Unauthorized('Incorrect password')

        if len(new_password) < options.min_length_password:
            msg = ('Passwords must be at least {} characters'
                   .format(options.min_length_password))
            raise exceptions.ValidationError(msg)

        if len(new_password) > options.max_length_password:
            msg = ('Passwords must be at no more than {} characters'
                   .format(options.max_length_password))
            raise exceptions.ValidationError(msg)

        self.password = self.hash_password(new_password)
        yield self._save()
1273268
def clean_password(self, password, user=None):
        
        min_length = app_settings.PASSWORD_MIN_LENGTH
        if min_length and len(password) < min_length:
            raise forms.ValidationError(_("Password must be a minimum of {0} "
                                          "characters.").format(min_length))
        validate_password(password, user)
        return password
351252
def user_password_requirements(self, user_id, **kwargs):
        ""
        api_path = "/api/v2/users/{user_id}/password/requirements.json"
        api_path = api_path.format(user_id=user_id)
        return self.call(api_path, **kwargs)
750857
def a_send_password(password, ctx):
    
    if password:
        ctx.ctrl.send_command(password, password=True)
        return True
    else:
        ctx.ctrl.disconnect()
        raise ConnectionAuthenticationError("Password not provided", ctx.ctrl.hostname)
567855
def get_password(args):
    
    password = ''

    if args.__dict__.get('password'):
        # Specify password as argument (for -p option)
        password = args.password

    elif args.__dict__.get('P'):
        # Enter password interactively (for -P option)
        while True:
            # When setting password in $HOME/.tdclirc, using it.
            if password:
                break

            else:
                # Not set in $HOME/.tdclirc, attempt input prompt
                from getpass import getpass
                password = getpass(prompt='TonicDNS user password: ')

    return password
17352
def oper(self, name, password):
        
        with self.lock:
            self.send('OPER %s %s' % (name, password))
            snomasks = ''
            new_umodes = ''
            if self.readable():
                    msg = self._recv(expected_replies=( \
                                                    'MODE', '381', '008'))
                    if msg[0] == 'MODE':
                            new_umodes = msg[2].replace(':', '', 1)
                    elif msg[0] == '381':
                            return new_umodes, snomasks
                    elif msg[0] == '008':
                            snomasks = msg[2].split('(')[1].split(')')[0]
319723
def change_engine_password(self, password):
        
        self.make_request(
            ModificationFailed,
            method='update',
            resource='change_engine_password',
            params={'password': password})
135377
def prompt(msg, default=None):
    ""
    if default is not None:
        msg = '{} ({})'.format(msg, repr(default))
    msg = '{}: '.format(msg)
    try:
        s = input(msg)
    except KeyboardInterrupt:
        exit(1)
    except EOFError:
        s = ''
    if not s:
        s = default
    return s
130645
def prompt_user_passwd(self, host, realm):
        """"""
        import getpass
        try:
            user = input("Enter username for %s at %s: " % (realm, host))
            passwd = getpass.getpass("Enter password for %s in %s at %s: " %
                (user, realm, host))
            return user, passwd
        except KeyboardInterrupt:
            print()
            return None, None
386279
def prompt_for_credentials(username):
    '''

    '''
    message = 'Enter password for user "{0}": '.format(username)
    password = getpass.getpass(message)
    if not password:
        raise ValueError(
            'No credentials provided for user "{0}"'.format(username)
        )
    return password
519166
def prompt(name, default):
    
    value = raw_input('%s [%s]: ' %(name, default))
    if not value:
        value = default
    return value
337657
def send_password_change_message(self, user, base_url):
        
        subject = 'Change your password here'
        if 'password_change' in self.email_subjects.keys():
            subject = self.email_subjects['password_change']

        sender = current_app.config['MAIL_DEFAULT_SENDER']
        recipient = user.email
        link = '{url}/{link}/'.format(
            url=base_url.rstrip('/'),
            link=user.password_link
        )
        data = dict(link=link)
        html = render_template('user/mail/password-change.html', **data)
        txt = render_template('user/mail/password-change.txt', **data)

        mail.send(Message(
            subject=subject,
            recipients=[recipient],
            body=txt,
            html=html,
            sender=sender
        ))
713027
def reset_password(self):
        

        def cb():
            password = get_random_password()
            self.change_password(password)
            return password

        return signals.user_update(self, ACTIONS["PASSWORD"], cb)