def METHOD_NAME(self, key, count=None):
    if count is None:
        if not key.value:
            return None
        item = random.sample(list(key.value), 1)[0]
        key.value.remove(item)
        key.updated()
        return item
    else:
        if count < 0:
            raise SimpleError(msgs.INDEX_ERROR_MSG)
        items = self.srandmember(key, count)
        for item in items:
            key.value.remove(item)
            key.updated()  # Inside the loop because redis special-cases count=0
        return items