Redo the last cluster assignment operation.

        Returns
        -------

        up : UpdateInfo instance of the changes done by this operation.
480075
def redo(self):
        
        # Go forward in the stack, and retrieve the new assignment.
        item = self._undo_stack.forward()
        if item is None:
            # No redo has been performed: abort.
            return

        # NOTE: the undo_state object is only returned when undoing.
        # It represents data associated to the state
        # *before* the action. What might be more useful would be the
        # undo_state object of the next item in the list (if it exists).
        spike_ids, cluster_ids, undo_state = item
        assert spike_ids is not None

        # We apply the new assignment.
        up = self._do_assign(spike_ids, cluster_ids)
        up.history = 'redo'

        self.emit('cluster', up)
        return up
635715
def reload(self):
        
        cluster_pb = self._instance._client.instance_admin_client.get_cluster(self.name)

        # NOTE: _update_from_pb does not check that the project and
        #       cluster ID on the response match the request.
        self._update_from_pb(cluster_pb)
196434
def reassign_label(cls, destination_cluster, label):
        
        conn = Qubole.agent(version=Cluster.api_version)
        data = {
                    "destination_cluster": destination_cluster,
                    "label": label
                }
        return conn.put(cls.rest_entity_path + "/reassign-label", data)
1155402
def clear_cluster(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Clearing cluster statistics'
        return ret

    __salt__['trafficserver.clear_cluster']()

    ret['result'] = True
    ret['comment'] = 'Cleared cluster statistics'
    return ret
233013
def refresh(self):
        
        if not self._client:
            return
        current_containers = self._client.containers(all=True)
        self.clear()
        for container in current_containers:
            container_names = container.get('Names')
            if container_names:
                c_id = container['Id']
                self.update((name[1:], c_id)
                            for name in container_names)
942408
public void reloadPartitions() {

        if (partitions == null) {
            initializePartitions();
            partitions.updateCache();
        } else {

            Partitions loadedPartitions = loadPartitions();
            if (TopologyComparators.isChanged(getPartitions(), loadedPartitions)) {

                logger.debug("Using a new cluster topology");

                List<RedisClusterNode> before = new ArrayList<RedisClusterNode>(getPartitions());
                List<RedisClusterNode> after = new ArrayList<RedisClusterNode>(loadedPartitions);

                getResources().eventBus().publish(new ClusterTopologyChangedEvent(before, after));
            }

            this.partitions.reload(loadedPartitions.getPartitions());
        }

        updatePartitionsInConnections();
    }
891332
async def cluster_setslot(self, node_id, slot_id, state):
        
        if state.upper() in {'IMPORTING', 'MIGRATING', 'NODE'} and node_id is not None:
            return await self.execute_command('CLUSTER SETSLOT', slot_id, state, node_id)
        elif state.upper() == 'STABLE':
            return await self.execute_command('CLUSTER SETSLOT', slot_id, 'STABLE')
        else:
            raise RedisError('Invalid slot state: {0}'.format(state))
1048677
def reindex(self):
        ''''''
        for i in range(self.count()):
            w = self.points[i]
            w.idx = i
            w.count = self.count()
            w.target_system = self.target_system
            w.target_component = self.target_component
        self.last_change = time.time()
657589
def update_config(self, cluster_config, login_config):
        

        oldvalue = self.__update_option(cluster_config, 'ssh_to', 'ssh_to')
        if oldvalue:
            log.debug("Attribute 'ssh_to' updated: %s -> %s", oldvalue, self.ssh_to)
223316
def refresh(self):
        
        if not self._client:
            return
        current_volumes = self._client.volumes()['Volumes']
        self.clear()
        if current_volumes:
            self.update(vol['Name'] for vol in current_volumes)
187957
def update(self):
        
        raise(AssertionError("out of date"))
        
        new_ids = []
        old_ids = []
        
        # collect old ip addresses
        for chain in self.chains:
            if (self.verbose): print(self.pre, "old :", chain, chain.get__id(), chain.get_address(), chain._id)
            old_ids.append(chain.get__id())
            
        # collect devices
        devices = []
        for dic in self.datamodel.camera_collection.get():
            if (self.verbose): print(self.pre, "update : dic", dic)
            if (dic["classname"] == DataModel.RTSPCameraRow.__name__):
                devices.append(dic)
            
        devices_by_id={}
        for dic in devices: # DataModel.RTSPCameraRow instances
            _id = dic["_id"]
            new_ids.append(_id)
            devices_by_id[_id] = dic
        
        if (self.verbose):
            print(self.pre, "update : new_ids =", new_ids)
            print(self.pre, "update : old_ids =", old_ids)
        
        add_list = list(set(new_ids).difference(set(old_ids))) # cams to be added
        rem_list = list(set(old_ids).difference(set(new_ids))) # cams to be removed
        
        if (self.verbose):
            print(self.pre, "update : add_list =", add_list)
            print(self.pre, "update : rem_list =", rem_list)
        
        # purge removed chains
        for i, chain in enumerate(self.chains):
            if (chain.get__id() in rem_list):
                chain_ = self.chains.pop(i)
                if (self.verbose): print(self.pre, "closing chain", chain_)
                chain_.close()
        
        # add new chains
        for new_address in add_list:
            dic = devices_by_id[new_address]
            chain = ManagedFilterchain( # decoding and branching the stream happens here
                livethread  = self.livethread,
                openglthreads
                            = self.gpu_handler.openglthreads,
                address     = DataModel.RTSPCameraRow.getMainAddressFromDict(dic),
                slot        = dic["slot"],
                _id         = dic["_id"],
                # affinity    = a,
                msreconnect = 10000,
                verbose = True
            )
            if (self.verbose): print(self.pre, "adding chain", chain)
            self.chains.append(chain)
952870
def last_change(self):
        
        try:
            cdt = self.latest('created')
            udt = self.latest('updated')
            #print cdt, udt
            return max(cdt.created, udt.updated)

        except ObjectDoesNotExist:
            return None
944056
def reset(self):
        
        self.curr_batch_index = 0
        if self.permute:
            # shuffle batch start indices
            random.shuffle(self.batch_indices)

            # restore the data permutation
            self.data = self.data.permute(self.inverse_data_permutations)

            # permute the data within each batch
            self.data_permutations, self.inverse_data_permutations = get_permutations(self.data.get_bucket_counts())
            self.data = self.data.permute(self.data_permutations)
1032171
def undo_last_change(self):
        
        if len(self.history) == 0:
            raise IndexError("Can't undo. Already at oldest change.")
        if 'input_structure' not in self.history[-1]:
            raise IndexError("Can't undo. Latest history has no "
                             "input_structure")
        h = self.history.pop()
        self._undone.append((h, self.final_structure))
        s = h["input_structure"]
        if isinstance(s, dict):
            s = Structure.from_dict(s)
        self.final_structure = s
44804
function() {
    // Make sure pending changes have been committed.
    this.commit();

    if (this.history.length) {
      // Take the top diff from the history, apply it, and store its
      // shadow in the redo history.
      var item = this.history.pop();
      this.redoHistory.push(this.updateTo(item, "applyChain"));
      this.notifyEnvironment();
      return this.chainNode(item);
    }
  }
1219533
def update_cluster(cluster_ref, cluster_spec):
    '''
    
    '''
    cluster_name = get_managed_object_name(cluster_ref)
    log.trace('Updating cluster \'%s\'', cluster_name)
    try:
        task = cluster_ref.ReconfigureComputeResource_Task(cluster_spec,
                                                           modify=True)
    except vim.fault.NoPermission as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(
            'Not enough permissions. Required privilege: '
            '{}'.format(exc.privilegeId))
    except vim.fault.VimFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareApiError(exc.msg)
    except vmodl.RuntimeFault as exc:
        log.exception(exc)
        raise salt.exceptions.VMwareRuntimeError(exc.msg)
    wait_for_task(task, cluster_name, 'ClusterUpdateTask')
633416
def on_cluster(self, up):
        """"""

        similar = self.similarity_view.selected

        # Reinitialize the cluster view if clusters have changed.
        if up.added:
            self._update_cluster_view()

        # Select all new clusters in view 1.
        if up.history == 'undo':
            # Select the clusters that were selected before the undone
            # action.
            clusters_0, clusters_1 = up.undo_state[0]['selection']
            # Select rows in the tables.
            self.cluster_view.select(clusters_0, up=up)
            self.similarity_view.select(clusters_1, up=up)
        elif up.added:
            if up.description == 'assign':
                # NOTE: we change the order such that the last selected
                # cluster (with a new color) is the split cluster.
                added = list(up.added[1:]) + [up.added[0]]
            else:
                added = up.added
            # Select the new clusters in the cluster view.
            self.cluster_view.select(added, up=up)
            if similar:
                self.similarity_view.next()
        elif up.metadata_changed:
            # Select next in similarity view if all moved are in that view.
            if set(up.metadata_changed) <= set(similar):
                next_cluster = self.similarity_view.get_next_id()
                self._update_similarity_view()
                if next_cluster is not None:
                    # Select the cluster in the similarity view.
                    self.similarity_view.select([next_cluster])
            # Otherwise, select next in cluster view.
            else:
                self._update_cluster_view()
                # Determine if there is a next cluster set from a
                # previous clustering action.
                cluster = up.metadata_changed[0]
                next_cluster = self.cluster_meta.get('next_cluster', cluster)
                logger.debug("Get next_cluster for %d: %s.",
                             cluster, next_cluster)
                # If there is not, fallback on the next cluster in the list.
                if next_cluster is None:
                    self.cluster_view.select([cluster], do_emit=False)
                    self.cluster_view.next()
                else:
                    self.cluster_view.select([next_cluster])