Update the list of scales to include only the list of usable scales (from all possible scales).
162044
public void updateUsableScales() {
		Bbox bgBounds = backgroundPart.getBounds();
		/*
		 * First move background a little bit to right based on difference in width with the sliderUnit.
		 */
		int internalHorMargin = (int) (sliderUnit.getBounds().getWidth() - backgroundPart.getBounds().getWidth()) / 2;
		bgBounds.setX(internalHorMargin);
		
		int backgroundPartHeight = (int) bgBounds.getHeight();
		int sliderAreaHeight = 0;
		/*
		 * Needed for aligning the sliderUnit's y with currentScale's y.
		 */
		int currentUnitY = sliderAreaHeight;
		double currentScale = mapWidget.getMapModel().getMapView().getCurrentScale();
		
		List<Bbox> partBounds = new ArrayList<Bbox>();
		List<ScaleInfo> zoomLevels = mapWidget.getMapModel().getMapInfo().getScaleConfiguration().getZoomLevels();
		int size = zoomLevels.size();
		currentScaleList.clear();
		boolean scaleFound = false;
		for (int i = size - 1 ; i >= 0 ; i--) {
			double scale = zoomLevels.get(i).getPixelPerUnit();
			if (mapWidget.getMapModel().getMapView().isResolutionAvailable(1.0 / scale)) {
				Bbox bounds = (Bbox) bgBounds.clone();
				bounds.setY(sliderAreaHeight);
				partBounds.add(bounds);
				currentScaleList.add(scale);
				if (scale <= currentScale && !scaleFound) {
					scaleFound = true;
					currentUnitY = sliderAreaHeight;
				}
				sliderAreaHeight += backgroundPartHeight;
			}
		}
		/*
		 * Align zoom slider unit with current zoom
		 */
		Bbox bounds = sliderUnit.getBounds();
		bounds.setY(currentUnitY);

		/*
		 * Zoom slider area 
		 */
		sliderArea = new SliderArea(SLIDER_AREA, (int) sliderUnit.getBounds().getWidth(), 
				sliderAreaHeight, sliderUnit, backgroundPart, partBounds,
				mapWidget, new ZoomSliderController(this));
		sliderArea.setHorizontalMargin((int) -bgBounds.getX());
		sliderArea.setVerticalMargin((int) backgroundPart.getBounds().getWidth());
		
		/*
		 * Zoom out button internal margin.
		 */
		zoomOut.getBackground().getBounds().setY(sliderArea.getVerticalMargin() + sliderAreaHeight);
		zoomOut.getIcon().getBounds().setY(sliderArea.getVerticalMargin() + sliderAreaHeight);
	}
1241486
def update(self, iterable):
        """"""
        _lists = self._lists
        _maxes = self._maxes
        values = sorted(iterable)

        if _maxes:
            if len(values) * 4 >= self._len:
                values.extend(chain.from_iterable(_lists))
                values.sort()
                self._clear()
            else:
                _add = self.add
                for val in values:
                    _add(val)
                return

        _load = self._load
        _lists.extend(values[pos:(pos + _load)]
                      for pos in range(0, len(values), _load))
        _maxes.extend(sublist[-1] for sublist in _lists)
        self._len = len(values)
        del self._index[:]
476495
def update(self):
        

        self.states = [bool(int(x)) for x in self.get('port list') or '0000']
926324
def update_scale(self, overflow):
        """"""
        iter_since_rescale = self._num_steps - self._last_rescale_iter
        if overflow:
            self._last_overflow_iter = self._num_steps
            self._overflows_since_rescale += 1
            percentage = self._overflows_since_rescale / float(iter_since_rescale)
            # we tolerate a certrain amount of NaNs before actually scaling it down
            if percentage >= self.tolerance:
                self.loss_scale /= self.scale_factor
                self._last_rescale_iter = self._num_steps
                self._overflows_since_rescale = 0
                logging.info('DynamicLossScaler: overflow detected. set loss_scale = %s',
                             self.loss_scale)
        elif (self._num_steps - self._last_overflow_iter) % self.scale_window == 0:
            self.loss_scale *= self.scale_factor
            self._last_rescale_iter = self._num_steps
        self._num_steps += 1
481560
def update(self):
        
        con = self.subpars.pars.control
        self(con.eqi2*con.tind)
493854
def update(self, settings):
        '''
        

        '''
        if 'settings' in settings:
            self._settings.update(settings['settings'])
        else:
            self._settings.update(settings)

        if 'instruments' in settings:
            for instrument_name, instrument_setting in settings['instruments'].items():
                self.instruments[instrument_name]['settings'].update(instrument_setting['settings'])

        if 'scripts' in settings:
            for script_name, script_setting in settings['scripts'].items():
                self.scripts[script_name].update(script_setting)
944305
def update(self, dictionary=None, **kwargs):
        
        if not dictionary == None: kwargs.update(dictionary)
        for k in list(kwargs.keys()): self[k] = kwargs[k]
480195
private void updateFromProperties() {
        // Get value from all properties: use a new collection so that equals() returns false
        List<R> newValues = new ArrayList<R>();
        for (ReadableProperty<R> master : properties) {
            newValues.add(master.getValue());
        }

        // Notify slaves
        setValue(newValues);
    }
38109
def normalize_set(self, items, **kwargs):
        """"""
        values = set()
        for item in ensure_list(items):
            values.update(self.normalize(item, **kwargs))
        return list(values)
1141289
private void updateValue() {
        if (list != null) {
            int oldCount = this.count;
            this.count = list.getSelectedIndices().length;
            maybeNotifyListeners(oldCount, count);
        }
    }
567211
protected void update() {
        int sz = dataModel.getSize();
        int[] selected = helperList.getSelectedIndices();
        ArrayList sourceItems = new ArrayList(sz);
        ArrayList chosenItems = new ArrayList(selected.length);

        // Start with the source items filled from our data model
        for (int i = 0; i < sz; i++) {
            sourceItems.add(dataModel.getElementAt(i));
        }

        // Now move the selected items to the chosen list
        for (int i = selected.length - 1; i >= 0; i--) {
            chosenItems.add(sourceItems.remove(selected[i]));
        }

        Collections.reverse(chosenItems); // We built it backwards

        // Now install the two new lists
        sourceList.setListData(sourceItems.toArray());
        chosenList.setListData(chosenItems.toArray());
    }
676137
def _replace_measures(self, et, list_of_measures):
        
        for measure in et.findall("option"):
            et.remove(measure)

        for measure_name in list_of_measures:
            tag = Element("option")
            tag.attrib["name"] = measure_name
            tag.attrib["value"] = "true"
            et.append(tag)
1040786
def list_upgrades(refresh=True, **kwargs):
    '''
    
    '''
    pkgs = {}
    for pkg in sorted(list_pkgs(refresh=refresh).keys()):
        # NOTE: we already optionally refreshed in de list_pkg call
        pkg_upgrade = latest_version(pkg, refresh=False)
        if pkg_upgrade:
            pkgs[pkg] = pkg_upgrade
    return pkgs
923327
def _apply_scales(array, scales, dtype):
    
    new_array = np.empty(array.shape, dtype)
    for i in array.dtype.names:
        try:
            new_array[i] = array[i] * scales[i]
        except TypeError:
            if np.all(scales[i] == 1):
                new_array[i] = array[i]
            else:
                raise
    return new_array
163976
def update_deps(self):
        
        onelist, dependencies = [], []
        onelist = Utils().dimensional_list(self.deps)
        dependencies = Utils().remove_dbs(onelist)
        for dep in dependencies:
            deps = Requires(self.flag).sbo(dep)
            self.deps_dict[dep] = self.one_for_all(deps)
447785
def update(self, *iterables):
        """"""
        _set = self._set
        values = set(chain(*iterables))
        if (4 * len(values)) > len(_set):
            _list = self._list
            _set.update(values)
            _list.clear()
            _list.update(_set)
        else:
            _add = self.add
            for value in values:
                _add(value)
        return self
917498
def _apply_list(self, methods):
    
    def call(value):
      for method in methods:
        newvalue = method(self, value)
        if newvalue is not None:
          value = newvalue
      return value
    return call