def _handle_password(self, password):
        if password is None:
            password = keyring.get_password('yagmail', self.user)
            if password is None:
                password = keyring.get_password('yagmail', self.user)
            if password is None:
                import getpass
                password = getpass.getpass(
                    'Password for <{}>: '.format(self.user))
                answer = ''
                # Python 2 fix
                while answer != 'y' and answer != 'n':
                    prompt_string = 'Save username and password in keyring? [y/n]: '
                    # pylint: disable=undefined-variable
                    try:
                        answer = raw_input(prompt_string).strip()
                    except NameError:
                        answer = input(prompt_string).strip()
                if answer == 'y':
                    register(self.user, password)
        return password
Represent a topology of servers.
dataset/ETHPy150Open kootenpv/yagmail/yagmail/yagmail.py/SMTP._handle_password--crossover with--dataset/ETHPy150Open mongodb/mongo-python-driver/pymongo/topology_description.py/TopologyDescription.__init__