Keep annotaion if it passes potentially modified selection.
432376
def getfnc_qual_ev(self):
        """"""
        fnc_key = (
            self.nd_not2desc[(self._keep_nd, self._keep_not)],
            self.incexc2num[(
                self.include_evcodes is not None,
                self.exclude_evcodes is not None)],
        )
        return self.param2fnc[fnc_key]
1087342
function expandAnnotation (tx, anno, sel) {
  if (!sel || !sel._isSelection) throw new Error('Argument "selection" is required.')
  if (!anno || !anno.isAnnotation()) throw new Error('Argument "anno" is required and must be an annotation.')
  let annoSel = anno.getSelection()
  let newAnnoSel = annoSel.expand(sel)
  anno._updateRange(tx, newAnnoSel)
  return anno
}
915583
public void select(boolean considerSelectableFlag) {
        SelectExtension<Item> selectExtension = mFastAdapter.getExtension(SelectExtension.class);
        if (selectExtension == null) {
            return;
        }
        for (Item item : AdapterUtil.getAllItems(mFastAdapter)) {
            selectExtension.select(item, considerSelectableFlag);
        }
        mFastAdapter.notifyDataSetChanged();
    }
1057055
def remove_selection(self, sel):
        """"""
        self._selections.remove(sel)
        # <artist>.figure will be unset so we save them first.
        figures = {artist.figure for artist in [sel.annotation] + sel.extras}
        # ValueError is raised if the artist has already been removed.
        with suppress(ValueError):
            sel.annotation.remove()
        for artist in sel.extras:
            with suppress(ValueError):
                artist.remove()
        for cb in self._callbacks["remove"]:
            cb(sel)
        for figure in figures:
            figure.canvas.draw_idle()
816126
protected void removeAnnotation(String annotIdentifier) {
		if (m_annotations != null) {
			Iterator it = m_annotations.iterator();
			while (it.hasNext()) {
				Annotation ann = (Annotation) it.next();
				if (ann.getIdentifier().equals(annotIdentifier))
					it.remove();
			}
		}
	}
1238024
public void onFeatureSelected(FeatureSelectedEvent event) {
		Feature feature = event.getFeature();

		// Only select if it is actually deselected:
		boolean selected = false;
		ListGridRecord[] selections = getSelection();
		for (ListGridRecord selection : selections) {
			if (selection.getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
				selected = true;
				break;
			}
		}

		// If deselected, find the correct row and select:
		if (!selected) {
			ListGridRecord[] records = this.getRecords();
			for (int i = 0; i < records.length; i++) {
				if (records[i].getAttribute(FIELD_NAME_FEATURE_ID).equals(feature.getId())) {
					selectRecord(i);
					break;
				}
			}
		}
	}
727196
@MustBeLocked (ELockType.WRITE)
  protected final void markAsChanged ()
  {
    // Just remember that something changed
    internalSetPendingChanges (true);
    if (internalIsAutoSaveEnabled ())
    {
      // Auto save
      if (_writeToFile ().isSuccess ())
        internalSetPendingChanges (false);
      else
      {
        if (LOGGER.isErrorEnabled ())
          LOGGER.error ("The DAO of class " +
                        getClass ().getName () +
                        " still has pending changes after markAsChanged!");
      }
    }
  }
369115
@Override
	public Void visitAnnotation(AnnotationMirror a, String p) {
		if (AnnotationAttributeType.INDEXES.getValue().equals(p)) {
			inTasks = true;
		}

		if (inTasks) {
			currentValue = new Pair<List<String>, Boolean>(new ArrayList<String>(), false);
			for (Map.Entry<? extends ExecutableElement, ? extends AnnotationValue> entry : a.getElementValues().entrySet()) {
				String key = entry.getKey().getSimpleName().toString();
				entry.getValue().accept(this, key);
			}
			indexes.add(currentValue);
		}

		if (AnnotationAttributeType.INDEXES.getValue().equals(p)) {
			inTasks = false;
		}

		return null;
	}
1291332
public static void updateBegin(final Annotation annotation, final int begin)
    {
        annotation.removeFromIndexes();
        annotation.setBegin(begin);
        annotation.addToIndexes();
    }
341987
def _on_select(self, *args):
        
        if callable(self.__callback):
            self.__callback(self.selection)
314919
function (args) {
            if (this._updatesStopped()) {
                return;
            }
            var dataName = args.dataName;
            if (dataName == "selected") {
                var item = args.dataHolder;
                if ((args.newValue && !args.oldValue) // item was just selected
                        || (!args.newValue && args.oldValue) // item was just unselected
                ) {
                    this._selectionChanged(item.index);
                }
            } else if (dataName == "initiallyDisabled") {
                this._updateCurrentlyDisabled([args.dataHolder]);
            }
        }
999742
private static void inspectRecursively(Class<?> c, List<Method> s, Class<? extends Annotation> annotationType) {

      for (Method m : c.getDeclaredMethods()) {
         // don't bother if this method has already been overridden by a subclass
         if (notFound(m, s) && m.isAnnotationPresent(annotationType)) {
            s.add(m);
         }
      }

      if (!c.equals(Object.class)) {
         if (!c.isInterface()) {
            inspectRecursively(c.getSuperclass(), s, annotationType);
         }
         for (Class<?> ifc : c.getInterfaces()) inspectRecursively(ifc, s, annotationType);
      }
   }
1268789
def __restore_selection(self, start_pos, end_pos):
        """"""
        cursor = self.textCursor()
        cursor.setPosition(start_pos)
        cursor.setPosition(end_pos, QTextCursor.KeepAnchor)
        self.setTextCursor(cursor)
1330104
public M keep(String attr) {
		if (attrs.containsKey(attr)) {	// prevent put null value to the newColumns
			Object keepIt = attrs.get(attr);
			boolean keepFlag = _getModifyFlag().contains(attr);
			attrs.clear();
			_getModifyFlag().clear();
			attrs.put(attr, keepIt);
			if (keepFlag)
				_getModifyFlag().add(attr);
		}
		else {
			attrs.clear();
			_getModifyFlag().clear();
		}
		return (M)this;
	}
390793
private void storeTagAnnotation(Annotation anno) {
        Class<? extends Annotation> annoType = anno.annotationType();
        Annotation[] tags = annoType.getAnnotations();
        for (Annotation tag : tags) {
            Class<? extends Annotation> tagType = tag.annotationType();
            if (WAIVE_TAG_TYPES.contains(tagType)) {
                continue;
            }
            Set<Annotation> tagged = tagAnnotations.get(tagType);
            if (null == tagged) {
                tagged = new HashSet<>();
                tagAnnotations.put(tagType, tagged);
            }
            tagged.add(anno);
        }
    }
605301
function(annotation) {
			if (!annotation) { return; }
			var annotations = this._annotations;
			var index = binarySearch(annotations, annotation.start);
			annotations.splice(index, 0, annotation);
			annotation._annotationModel = this;
			var e = {
				type: "Changed", //$NON-NLS-0$
				added: [annotation],
				removed: [],
				changed: []
			};
			this.onChanged(e);
		}
1277178
def visit_annassign(self, node):
        """"""

        target = node.target.accept(self)
        annotation = node.annotation.accept(self)
        if node.value is None:
            return "%s: %s" % (target, annotation)
        return "%s: %s = %s" % (target, annotation, node.value.accept(self))