def register(disp,host,info):
    """ Perform registration on remote server with provided info.
        disp must be connected dispatcher instance.
        Returns true or false depending on registration result.
        If registration fails you can get additional info from the dispatcher's owner
        attributes lastErrNode, lastErr and lastErrCode.
    """
    iq=Iq('set',NS_REGISTER,to=host)
    if type(info)<>type({}): info=info.asDict()
    for i in info.keys(): iq.setTag('query').setTagData(i,info[i])
    resp=disp.SendAndWaitForResponse(iq)
    if isResultNode(resp): return 1
 Perform registration on remote server with provided info.
        disp must be connected dispatcher instance.
        Returns true or false depending on registration result.
        If registration fails you can get additional info from the dispatcher's owner
        attributes lastErrNode, lastErr and lastErrCode.
    
chrome-cordova/gcmServer/xmpp/features.py