Update the estimate after querying the label for an item
495777
def _update_estimate_and_sampler(self, ell, ell_hat, weight, extra_info,
                                     **kwargs):
        """"""
        self._TP += ell_hat * ell * weight
        self._FP += ell_hat * (1 - ell) * weight
        self._FN += (1 - ell_hat) * ell * weight
        self._TN += (1 - ell_hat) * (1 - ell) * weight

        self._estimate[self.t_] = \
                self._F_measure(self.alpha, self._TP, self._FP, self._FN)
963934
def update_label(self, old_label, new_label):
        
        logger.info("%s : Updating label ([%s] -> [%s])"
                    % (str(self), old_label.name, new_label.name))
        labels = self.labels
        try:
            labels.remove(old_label)
        except ValueError:
            # this document doesn't have this label
            return

        logger.info("%s : Updating label ([%s] -> [%s])"
                    % (str(self), old_label.name, new_label.name))
        labels.append(new_label)
        with self.fs.open(self.fs.join(self.path, self.LABEL_FILE), 'w') \
                as file_desc:
            for label in labels:
                file_desc.write("%s,%s\n" % (label.name,
                                             label.get_color_str()))
786903
def _todo_do_update(self, line):
        ""
        table, line = self.get_table_params(line)
        hkey, line = line.split(" ", 1)
        expected, attr = self.get_expected(line)

        if attr[0] == '-':
            op, attr = attr.split(" ", 1)
            op = op[1]
        else:
            op = "u"

        if attr[0] == '+':
            ret, attr = attr.split(" ", 1)
            ret = ret[1:]
        else:
            ret = "ALL_NEW"

        if ',' in hkey:
            hkey, rkey = hkey.split(",", 1)
        else:
            rkey = None

        item = table.new_item(hash_key=self.get_typed_key_value(table, hkey), range_key=self.get_typed_key_value(table, rkey, False))

        attr = json.loads(attr.strip())
        for name in attr.keys():
            value = attr[name]
            if isinstance(value, list):
                value = set(value)

            if op == 'a':
                item.add_attribute(name, value)
            elif op == 'd':
                item.delete_attribute(name, value)
            else:
                item.put_attribute(name, value)

        self.pprint(item)
        updated = item.save(expected_value=expected or None, return_values=ret)
        self.pprint(updated)

        if self.consumed:
            print "consumed units:", item.consumed_units
1066024
def calculate_offset(cls, labels):
        ''''''
        used_strings = set(cls._nice_strings.keys()) & set(labels)
        return max([len(cls._nice_strings[s]) for s in used_strings])
836415
def updateitem(self, key, new_val):
        
        if key not in self._position:
            raise KeyError(key)
        self[key] = new_val
582660
def add(self, labels, value):
        """"""

        if type(value) not in (float, int):
            raise TypeError("Summary only works with digits (int, float)")

        # We have already a lock for data but not for the estimator
        with mutex:
            try:
                e = self.get_value(labels)
            except KeyError:
                # Initialize quantile estimator
                e = quantile.Estimator(*self.__class__.DEFAULT_INVARIANTS)
                self.set_value(labels, e)
            e.observe(float(value))
30187
def updateItem(self, instance, subKey, value):
    """"""
    instanceId = statsId(instance)

    container = _Stats.getContainerForObject(instanceId)
    self._aggregate(instanceId, container, value, subKey)
481560
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi2*con.tind)
486984
def update(self, item, dry_run=None):
        """"""
        return self.backend.update(validate(item, version=self.version, context=self.context), dry_run=dry_run)
466086
function updateLabels($labels, $operation = 'add')
    {
        $query = $this->newQueryWithoutScopes();

        // If the "saving" event returns false we'll bail out of the save and return
        // false, indicating that the save failed. This gives an opportunities to
        // listeners to cancel save operations if validations fail or whatever.
        if ($this->fireModelEvent('saving') === false)
        {
            return false;
        }

        if( ! is_array($labels) || count($labels) == 0)
        {
            return false;
        }

        foreach($labels as $label)
        {
            if( ! preg_match( '/^[a-z]([a-z0-9]+)$/i', $label))
            {
                return false;
            }
        }

        // If the model already exists in the database we can just update our record
        // that is already in this database using the current IDs in this "where"
        // clause to only update this model. Otherwise, we'll return false.
        if($this->exists)
        {
            $this->setKeysForSaveQuery($query)->updateLabels($labels, $operation);
            $this->fireModelEvent('updated', false);
        } else
        {
            return false;
        }
    }
1231313
def update_label(self, old_label, new_label, callback=dummy_progress_cb):
        
        current = 0
        total = self.index.get_nb_docs()
        self.index.start_update_label(old_label, new_label)
        while True:
            (op, doc) = self.index.continue_update_label()
            if op == 'end':
                break
            callback(current, total, self.LABEL_STEP_UPDATING, doc)
            current += 1
        self.index.end_update_label()
513229
def _value_from_label(self, label):
        '''
        '''
        unser_val = (label.rel_strength.value, label.meta)
        return cbor.dumps(unser_val)
930183
def update(self, request, *args, **kwargs):
        
        return super(PriceListItemViewSet, self).update(request, *args, **kwargs)
200607
function update(itemName, isSnapshot, data) {
		var message, id = getIdFromItemName(itemName);
		message = proto.writeUpdate(id, itemName, isSnapshot, data);
		notify(message);
		return that;
	}
1329264
protected void updateLabeling(double slack) {
        for (int w = 0; w < dim; w++) {
            if (committedWorkers[w]) {
                labelByWorker[w] += slack;
            }
        }
        for (int j = 0; j < dim; j++) {
            if (parentWorkerByCommittedJob[j] != -1) {
                labelByJob[j] -= slack;
            } else {
                minSlackValueByJob[j] -= slack;
            }
        }
    }
1145172
def update(self, request, datum):
        """"""
        if getattr(self, 'action_present', False):
            self.verbose_name = self._get_action_name()
            self.verbose_name_plural = self._get_action_name('plural')
488085
def update(self, entry_id, new_label):
        
        self.data[entry_id] = (self.data[entry_id][0], new_label)
        self.modified = True
        for callback in self._update_callback:
            callback(entry_id, new_label)