Update the cluster with id/label `cluster_id_label` using information provided in
        `cluster_info`.
12510
def update(cls, cluster_id_label, cluster_info):
        
        conn = Qubole.agent(version="v2")
        return conn.put(cls.element_path(cluster_id_label), data=cluster_info)
265331
def set(self, field, clusters, value, add_to_stack=True):
        """"""
        # Add the field if it doesn't exist.
        if field not in self._fields:
            self.add_field(field)
        assert field in self._fields

        clusters = _as_list(clusters)
        for cluster in clusters:
            if cluster not in self._data:
                self._data[cluster] = {}
            self._data[cluster][field] = value

        up = UpdateInfo(description='metadata_' + field,
                        metadata_changed=clusters,
                        metadata_value=value,
                        )
        undo_state = self.emit('request_undo_state', up)

        if add_to_stack:
            self._undo_stack.add((clusters, field, value, up, undo_state))
            self.emit('cluster', up)

        return up
1346054
def label_set(self, subid, label, params=None):
        ''' 
        '''
        params = update_params(params, {
            'SUBID': subid,
            'label': label
        })
        return self.request('/v1/server/label_set', params, 'POST')
943639
def update_id_list(self, update_ids_finished_cb):
        """"""
        if not self._update_ids_finished_cb:
            self._update_ids_finished_cb = update_ids_finished_cb
            self.anchor_ids = []
            self.active_anchor_ids = []
            self.anchor_data = {}

            self.nr_of_anchors = 0
            self.ids_valid = False
            self.data_valid = False

            logger.debug('Updating ids of memory {}'.format(self.id))

            # Start reading the header
            self.mem_handler.read(self, LocoMemory2.ADR_ID_LIST,
                                  LocoMemory2.ID_LIST_LEN)
265891
def update_config(self, cluster_config):
        
        for key, attr in [
                ('ssh_to', 'ssh_to'),
        ]:
            oldvalue = getattr(self, attr)
            try:
                newvalue = cluster_config[key]
            except KeyError:
                continue
            if key in cluster_config and newvalue != oldvalue:
                setattr(self, attr, newvalue)
                log.debug(
                    "Configuration attribute `%s` updated: %s -> %s",
                    key, oldvalue, newvalue)
981402
def update_info(self, info):
        

        for key in self._info_fields:

            value = getattr(self, key, None)
            idx = _get_info(info, self.name)

            existing_value = idx.get(key)
            if key in idx and value is not None and existing_value != value:

                # frequency/name just warn
                if key in ['freq', 'index_name']:
                    ws = attribute_conflict_doc % (key, existing_value, value)
                    warnings.warn(ws, AttributeConflictWarning, stacklevel=6)

                    # reset
                    idx[key] = None
                    setattr(self, key, None)

                else:
                    raise ValueError(
                        "invalid info for [{name}] for [{key}], "
                        "existing_value [{existing_value}] conflicts with "
                        "new value [{value}]".format(
                            name=self.name, key=key,
                            existing_value=existing_value, value=value))
            else:
                if value is not None or existing_value is not None:
                    idx[key] = value

        return self
76600
def addClusterId(self,line):
        
        if isinstance(line,dict):
            jsonObj = line
        else:
            jsonObj = json.loads(line)
        concat_str=''
        for item in jsonObj['cluster']:
            concat_str += item['uri']
        cluster_id = "http://dig.isi.edu/ht/data/" + str(hash(concat_str)% 982451653)
        for item in jsonObj['cluster']:
            item['cluster_id']=cluster_id
            yield item
790657
def update_label(self):
        """"""
        current_file = str(self.selectedFiles()[0])
        if not '.' in current_file.split(os.path.sep)[-1]:
            # add hdf5 extention if none given
            current_file += '.hdf5'
        if os.path.isfile(current_file):
            self.setLabelText(QtGui.QFileDialog.Accept, 'Reload')
        elif os.path.isdir(current_file):
            self.setLabelText(QtGui.QFileDialog.Accept, 'Open')
        else:
            self.setLabelText(QtGui.QFileDialog.Accept, 'Create')
761574
def update(self, data):
        """"""
        if data is None:
            for device in self.devices:
                device.clear_info()
        else:
            for device, device_info in zip(self.devices, data):
                device.device_info = device_info
                self.connection.log("Device information updated -> [{}]".format(device))
309812
def add_cluster(
        self, 
        name, 
        server=None,
        certificate_authority_data=None,
        **attrs):
        """"""
        if self.cluster_exists(name):
            raise KubeConfError("Cluster with the given name already exists.")

        clusters = self.get_clusters()
        
        # Add parameters.
        new_cluster = {'name': name, 'cluster':{}}
        attrs_ = new_cluster['cluster']
        if server is not None:
            attrs_['server'] = server
        if certificate_authority_data is not None:
            attrs_['certificate-authority-data'] = certificate_authority_data

        attrs_.update(attrs)
        clusters.append(new_cluster)
1113827
def _update_threads(self):
        """"""
        if self.remaining_clusters is not None:
            self.threads = max(1,self.threads_total//self.remaining_clusters.value)
        #otherwise just keep the current (initial) value
        print("{} detected {} threads available to it".format(self.name,self.threads), file = self.log_fh)
281515
private void assign(HashMap<String, DBIDs> labelMap, String label, DBIDRef id) {
    if(labelMap.containsKey(label)) {
      DBIDs exist = labelMap.get(label);
      if(exist instanceof DBID) {
        ModifiableDBIDs n = DBIDUtil.newHashSet();
        n.add((DBID) exist);
        n.add(id);
        labelMap.put(label, n);
      }
      else {
        assert (exist instanceof HashSetModifiableDBIDs);
        assert (exist.size() > 1);
        ((ModifiableDBIDs) exist).add(id);
      }
    }
    else {
      labelMap.put(label, DBIDUtil.deref(id));
    }
  }
607437
def _update_similarity_view(self):
        """"""
        if not self.similarity:
            return
        selection = self.cluster_view.selected
        if not len(selection):
            return
        cluster_id = selection[0]
        cluster_ids = self.clustering.cluster_ids
        self._best = cluster_id
        logger.log(5, "Update the similarity view.")
        # This is a list of pairs (closest_cluster, similarity).
        similarities = self.similarity(cluster_id)
        # We save the similarity values wrt the currently-selected clusters.
        # Note that we keep the order of the output of the self.similary()
        # function.
        clusters_sim = OrderedDict([(int(cl), s) for (cl, s) in similarities])
        # List of similar clusters, remove non-existing ones.
        clusters = [c for c in clusters_sim.keys()
                    if c in cluster_ids]
        # The similarity view will use these values.
        self._current_similarity_values = clusters_sim
        # Set the rows of the similarity view.
        # TODO: instead of the self._current_similarity_values hack,
        # give the possibility to specify the values here (?).
        self.similarity_view.set_rows([c for c in clusters
                                       if c not in selection])
394794
def update(self, labels, preds):
        """"""
        batch_sum_metric = 0
        batch_num_inst = 0
        for label, pred_outcaps in zip(labels[0], preds[0]):
            label_np = int(label.asnumpy())
            pred_label = int(np.argmax(pred_outcaps.asnumpy()))
            batch_sum_metric += int(label_np == pred_label)
            batch_num_inst += 1
        batch_loss = preds[1].asnumpy()
        recon_loss = preds[2].asnumpy()
        self.sum_metric += batch_sum_metric
        self.num_inst += batch_num_inst
        self.loss += batch_loss
        self.recon_loss += recon_loss
        self.batch_sum_metric = batch_sum_metric
        self.batch_num_inst = batch_num_inst
        self.batch_loss = batch_loss
        self.n_batch += 1
626566
def _update_status(self, sub_job_num=None):
        
        job_id = '%s.%s' % (self.cluster_id, sub_job_num) if sub_job_num else str(self.cluster_id)
        format = ['-format', '"%d"', 'JobStatus']
        cmd = 'condor_q {0} {1} && condor_history {0} {1}'.format(job_id, ' '.join(format))
        args = [cmd]
        out, err = self._execute(args, shell=True, run_in_job_dir=False)
        if err:
            log.error('Error while updating status for job %s: %s', job_id, err)
            raise HTCondorError(err)
        if not out:
            log.error('Error while updating status for job %s: Job not found.', job_id)
            raise HTCondorError('Job not found.')

        out = out.replace('\"', '').split('\n')


        status_code = 0
        for status_code_str in out:
            try:
                status_code = int(status_code_str.strip())
            except:
                pass

        log.info('Job %s status: %d', job_id, status_code)

        key = CONDOR_JOB_STATUSES[status_code]

        return key
804292
def update_member(self, member_id, peer_urls):
        
        member_update_request = etcdrpc.MemberUpdateRequest(ID=member_id,
                                                            peerURLs=peer_urls)
        self.clusterstub.MemberUpdate(
            member_update_request,
            self.timeout,
            credentials=self.call_credentials,
            metadata=self.metadata
        )
218626
def get_cluster_id(kwargs=None, call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The get_cluster_id function must be called with -f or --function.'
        )

    if kwargs is None:
        kwargs = {}

    name = kwargs.get('name', None)
    if name is None:
        raise SaltCloudSystemExit(
            'The get_cluster_id function requires a name.'
        )

    try:
        ret = list_clusters()[name]['id']
    except KeyError:
        raise SaltCloudSystemExit(
            'The cluster \'{0}\' could not be found'.format(name)
        )

    return ret