Update the selection. Last two args are only used by updateDoc, since they have to be expressed in the line numbers before the update.
760173
function setSelection(doc, anchor, head, bias, checkAtomic) {
    if (!checkAtomic && hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) {
      var filtered = filterSelectionChange(doc, anchor, head);
      head = filtered.head;
      anchor = filtered.anchor;
    }

    var sel = doc.sel;
    sel.goalColumn = null;
    // Skip over atomic spans.
    if (checkAtomic || !posEq(anchor, sel.anchor))
      anchor = skipAtomic(doc, anchor, bias, checkAtomic != "push");
    if (checkAtomic || !posEq(head, sel.head))
      head = skipAtomic(doc, head, bias, checkAtomic != "push");

    if (posEq(sel.anchor, anchor) && posEq(sel.head, head)) return;

    sel.anchor = anchor; sel.head = head;
    var inv = posLess(head, anchor);
    sel.from = inv ? head : anchor;
    sel.to = inv ? anchor : head;

    if (doc.cm)
      doc.cm.curOp.updateInput = doc.cm.curOp.selectionChanged =
        doc.cm.curOp.cursorActivity = true;

    signalLater(doc, "cursorActivity", doc);
  }
365268
def move_up(self):
        
        old_index = self.current_index
        self.current_index -= 1
        self.__wrap_index()
        self.__handle_selections(old_index, self.current_index)
97036
private void updateSelection() {
        Dateitem selectedItem = getSelectedItem();
        
        if (selectedItem == null) {
            addStyle("color", "gray");
        } else {
            addStyle("color", "inherit");
        }
        
        setFocus(false);
    }
245671
protected int updateSelectedKeys() {
        int numKeysUpdated = 0;
        // Skip zeroth entry; it is for interrupts only
        for (int i=channelOffset; i<totalChannels; i++) {
            int rOps = pollWrapper.getReventOps(i);
            if (rOps != 0) {
                SelectionKeyImpl sk = channelArray[i];
                pollWrapper.putReventOps(i, 0);
                if (selectedKeys.contains(sk)) {
                    if (sk.channel.translateAndSetReadyOps(rOps, sk)) {
                        numKeysUpdated++;
                    }
                } else {
                    sk.channel.translateAndSetReadyOps(rOps, sk);
                    if ((sk.nioReadyOps() & sk.nioInterestOps()) != 0) {
                        selectedKeys.add(sk);
                        numKeysUpdated++;
                    }
                }
            }
        }
        return numKeysUpdated;
    }
402218
function updateSimple(newList, oldList, rawNewValue ){

    var nlen = newList.length;
    var olen = oldList.length;
    var mlen = Math.min(nlen, olen);

    updateRange(0, mlen, newList, rawNewValue)
    if(nlen < olen){ //need add
      removeRange(nlen, olen-nlen, children);
    }else if(nlen > olen){
      addRange(olen, nlen, newList, rawNewValue);
    }
  }
594781
def update_line(self, resource_id, data):
        """"""
        return OrderLines(self.client).on(self).update(resource_id, data)
1323797
def update_args(self, override_args):
        
        Link.update_args(self, override_args)
        dry_run = override_args.get('dry_run', False)
        if self.__app is None:
            self.__app = build_gtapp(self.appname, dry_run, **self.args)
#except:
#                raise ValueError("Failed to build link %s %s %s" %
#                                 (self.linkname, self.appname, self.args))
        else:
            update_gtapp(self.__app, **self.args)
205354
def update_selection_self_prior(self):
        """"""
        if self._do_selection_update:
            return
        self._do_selection_update = True
        tree_selection, selected_model_list, sm_selection, sm_selected_model_list = self.get_selections()
        if isinstance(sm_selection, Selection):
            sm_selection.handle_prepared_selection_of_core_class_elements(self.CORE_ELEMENT_CLASS, selected_model_list)
        self._do_selection_update = False
158470
def update(self, **kwargs):
        '''
        '''

        # Backends expect numpy arrays, so make sure all numeric values are
        # represented as such.
        kwargs = {k: (np.array(v) if isinstance(v, (int, float)) else v)
                  for k, v in kwargs.items()}
        self.args.update(kwargs)
492733
private void updateRender() {
		if (inherit.isSelected())
		{
			emitter.usePoints = Particle.INHERIT_POINTS;
			oriented.setEnabled( true );
		}
		if (quads.isSelected())
		{
			emitter.usePoints = Particle.USE_QUADS;
			oriented.setEnabled( true );
		}
		if (points.isSelected())
		{
			emitter.usePoints = Particle.USE_POINTS;
			oriented.setEnabled( false );
			oriented.setSelected( false );
		}
		
		// oriented
		if( oriented.isSelected())
			emitter.useOriented= true;
		else
			emitter.useOriented= false;
		
		// additive blending
		if( additive.isSelected())
			emitter.useAdditive= true;
		else
			emitter.useAdditive= false;
	}
921779
def update_line(self, t, x, y, **kw):
        
        self.panel.update_line(t, x, y, **kw)
791380
def _updateNumbers(self, linenumers):
        
        b = self.blockCount()
        c = b - linenumers
        if c > 0:
            # remove lines numbers
            for _ in range(c):
                # remove last line:
                self.setFocus()
                storeCursorPos = self.textCursor()
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.StartOfLine,
                    QtGui.QTextCursor.MoveAnchor)
                self.moveCursor(
                    QtGui.QTextCursor.End,
                    QtGui.QTextCursor.KeepAnchor)
                self.textCursor().removeSelectedText()
                self.textCursor().deletePreviousChar()
                self.setTextCursor(storeCursorPos)
        elif c < 0:
            # add line numbers
            for i in range(-c):
                self.appendPlainText(str(b + i + 1))
1097124
private void maybeUpdatePicker() {
    List<RoundRobinEntry> pickList;
    ConnectivityState state;
    switch (mode) {
      case ROUND_ROBIN:
        pickList = new ArrayList<>(backendList.size());
        Status error = null;
        boolean hasIdle = false;
        for (BackendEntry entry : backendList) {
          Subchannel subchannel = entry.subchannel;
          Attributes attrs = subchannel.getAttributes();
          ConnectivityStateInfo stateInfo = attrs.get(STATE_INFO).get();
          if (stateInfo.getState() == READY) {
            pickList.add(entry);
          } else if (stateInfo.getState() == TRANSIENT_FAILURE) {
            error = stateInfo.getStatus();
          } else if (stateInfo.getState() == IDLE) {
            hasIdle = true;
          }
        }
        if (pickList.isEmpty()) {
          if (error != null && !hasIdle) {
            pickList.add(new ErrorEntry(error));
            state = TRANSIENT_FAILURE;
          } else {
            pickList.add(BUFFER_ENTRY);
            state = CONNECTING;
          }
        } else {
          state = READY;
        }
        break;
      case PICK_FIRST:
        if (backendList.isEmpty()) {
          pickList = Collections.singletonList(BUFFER_ENTRY);
          // Have not received server addresses
          state = CONNECTING;
        } else {
          checkState(backendList.size() == 1, "Excessive backend entries: %s", backendList);
          BackendEntry onlyEntry = backendList.get(0);
          ConnectivityStateInfo stateInfo =
              onlyEntry.subchannel.getAttributes().get(STATE_INFO).get();
          state = stateInfo.getState();
          switch (state) {
            case READY:
              pickList = Collections.<RoundRobinEntry>singletonList(onlyEntry);
              break;
            case TRANSIENT_FAILURE:
              pickList =
                  Collections.<RoundRobinEntry>singletonList(new ErrorEntry(stateInfo.getStatus()));
              break;
            case CONNECTING:
              pickList = Collections.singletonList(BUFFER_ENTRY);
              break;
            default:
              pickList = Collections.<RoundRobinEntry>singletonList(
                  new IdleSubchannelEntry(onlyEntry.subchannel));
          }
        }
        break;
      default:
        throw new AssertionError("Missing case for " + mode);
    }
    maybeUpdatePicker(state, new RoundRobinPicker(dropList, pickList));
  }
454921
def update_args(self, override_args):
        
        self.args = extract_arguments(override_args, self.args)
        self._map_arguments(self.args)

        scratch_dir = self.args.get('scratch', None)
        if is_not_null(scratch_dir):
            self._file_stage = FileStageManager(scratch_dir, '.')
        for link in self._links.values():
            link._set_file_stage(self._file_stage)
        self._latch_file_info()
960425
public void update() {
        if (polyline != null) {
            if (isDeleted()) {
                remove();
            } else {
                List<LatLng> points = converter.getPointsFromMarkers(markers);
                polyline.setPoints(points);
            }
        }
    }
1316363
def update_selected(self, other, selected):
        

        self.update({k: other[k] for k in selected})
837796
def update(self, **kwargs):
        
        for arg in kwargs:
            if hasattr(self, arg):
                setattr(self, arg, kwargs[arg])
            else:
                raise ValueError("Invalid RayParams parameter in"
                                 " update: %s" % arg)

        self._check_usage()