def getSocketId(self): socketId = int(getUniqueId()) while socketId in self.sockets: socketId = int(getUniqueId()) return socketId
def getCode(maxInstances): while True: try: code = unicode(getUniqueId()) addCode(code, maxInstances) return code except DuplicateKeyError: pass
def func(): instanceKey = unicode(getUniqueId()) while instanceKey in self._by_instance_key: instanceKey = unicode(getUniqueId()) return instanceKey
def getHashKey(hashKey): if hashKey is None: hashKey = getUniqueId() return hash(hashKey)