def get_password(prompt='<STR_LIT>', confirm=False):
<EOL>securesystemslib.formats.TEXT_SCHEMA.check_match(prompt)<EOL>securesystemslib.formats.BOOLEAN_SCHEMA.check_match(confirm)<EOL>while True:<EOL><INDENT>password = getpass.getpass(prompt, sys.stderr)<EOL>if not confirm:<EOL><INDENT>return password<EOL><DEDENT>password2 = getpass.getpass('<STR_LIT>', sys.stderr)<EOL>if password == password2:<EOL><INDENT>return password<EOL><DEDENT>else:<EOL><INDENT>print('<STR_LIT>')<EOL><DEDENT><DEDENT>
<Purpose>
  Return the password entered by the user.  If 'confirm' is True, the user is
  asked to enter the previously entered password once again.  If they match,
  the password is returned to the caller.

<Arguments>
  prompt:
    The text of the password prompt that is displayed to the user.

  confirm:
    Boolean indicating whether the user should be prompted for the password
    a second time.  The two entered password must match, otherwise the
    user is again prompted for a password.

<Exceptions>
  None.

<Side Effects>
  None.

<Returns>
  The password entered by the user.