def _getResourceData(self,jid,dataname):
        """ Return specific jid's resource representation in internal format. Used internally. """
        if jid.find('/')+1:
            jid,resource=jid.split('/',1)
            if self._data[jid]['resources'].has_key(resource): return self._data[jid]['resources'][resource][dataname]
        elif self._data[jid]['resources'].keys():
            lastpri=-129
            for r in self._data[jid]['resources'].keys():
                if int(self._data[jid]['resources'][r]['priority'])>lastpri: resource,lastpri=r,int(self._data[jid]['resources'][r]['priority'])
            return self._data[jid]['resources'][resource][dataname]
 Return specific jid's resource representation in internal format. Used internally. 
chrome-cordova/gcmServer/xmpp/roster.py