code: def password(password_command):
      
      gui = lambda: has_Gtk() and get_password_gui
      tty = lambda: sys.stdin.isatty() and get_password_tty
      if password_command == 'builtin:gui':
          return gui() or tty()
      elif password_command == 'builtin:tty':
          return tty() or gui()
      elif password_command:
          return DeviceCommand(password_command).password
      else:
          return None
docs: Create a password prompt function.