def changePasswordTo(disp, newpassword, host=None):
 if (not host):
  host = disp._owner.Server
 resp = disp.SendAndWaitForResponse(Iq('set', NS_REGISTER, to=host, payload=[Node('username', payload=[disp._owner.Server]), Node('password', payload=[newpassword])]))
 if isResultNode(resp):
  return 1

def changePasswordTo ( disp , newpassword , host = None ) : if ( not host ) : host = disp . _owner . Server resp = disp . SendAndWaitForResponse ( Iq ( 'set' , NS_REGISTER , to = host , payload = [ Node ( 'username' , payload = [ disp . _owner . Server ] ) , Node ( 'password' , payload = [ newpassword ] ) ] ) ) if isResultNode ( resp ) : return 1
changes password on specified or current server .