def METHOD_NAME(prompt='Password: ', stream=None):
    """Prompt for a password, with echo turned off.
    The prompt is written on stream, by default stdout.
    Restore terminal settings at end.
    """
    if stream is None:
        stream = sys.stdout
    try:
        terminal = sys._jy_interpreter.reader.terminal
    except:
        return default_getpass(prompt)
    echoed = terminal.getEcho()
    terminal.disableEcho()
    try:
        passwd = _raw_input(prompt, stream)
    finally:
        if echoed:
           terminal.enableEcho()
    stream.write('\n')
    return passwd