Shifting positions of all entities with the same class (maintaining of sequential numbering).
776849
public function shiftPositions()
    {
        $this->owner->updateAllCounters(
            [$this->positionAttribute => -1],
            ['>', $this->positionAttribute, $this->owner->{$this->positionAttribute}]
        );
    }
405282
private void updatePositions(int position) {

        for (int i = position; i < m_subEntries.size(); i++) {
            m_subEntries.get(i).setPosition(i);
        }
    }
802627
function moveLeft( count ) {
    count = count || 1;
    const moveClasses = [
      CLASSES.MOVE_LEFT,
      CLASSES.MOVE_LEFT_2X,
      CLASSES.MOVE_LEFT_3X
    ];

    if ( count < 1 || count > moveClasses.length ) {
      throw new Error( 'MoveTransition: moveLeft count is out of range!' );
    }

    _baseTransition.applyClass( moveClasses[count - 1] );

    return this;
  }
1035951
private void rightShift(
    int           ix)
  {
    for (int j = rightMostIndex(); j >= ix; j--)
      _nodeKey[j+1] = _nodeKey[j];
  }
335447
protected void addSortedModifications(List<DbOperation> flush) {

    // calculate sorted set of all modified entity types
    SortedSet<Class<?>> modifiedEntityTypes = new TreeSet<Class<?>>(MODIFICATION_TYPE_COMPARATOR);
    modifiedEntityTypes.addAll(updates.keySet());
    modifiedEntityTypes.addAll(deletes.keySet());
    modifiedEntityTypes.addAll(bulkOperations.keySet());

    for (Class<?> type : modifiedEntityTypes) {
      // first perform entity UPDATES
      addSortedModificationsForType(type, updates.get(type), flush);
      // next perform entity DELETES
      addSortedModificationsForType(type, deletes.get(type), flush);
      // last perform bulk operations
      SortedSet<DbBulkOperation> bulkOperationsForType = bulkOperations.get(type);
      if(bulkOperationsForType != null) {
        flush.addAll(bulkOperationsForType);
      }
    }

    //the very last perform bulk operations for which the order is important
    if(bulkOperationsInsertionOrder != null) {
      flush.addAll(bulkOperationsInsertionOrder);
    }
  }
1261851
public void setTransitions(int state,
                               I input,
                               Collection<? extends Integer> successors) { // TODO: replace by primitive specialization
        setTransitions(state, getSymbolIndex(input), successors);
    }
630879
def adjust_attribute_sequence(*fields):
	""""""
	
	amount = None
	
	if fields and isinstance(fields[0], int):
		amount, fields = fields[0], fields[1:]
	
	def adjust_inner(cls):
		for field in fields:
			if field not in cls.__dict__:
				# TODO: Copy the field definition.
				raise TypeError("Can only override sequence on non-inherited attributes.")
			
			# Adjust the sequence to re-order the field.
			if amount is None:
				cls.__dict__[field].__sequence__ = ElementMeta.sequence
			else:
				cls.__dict__[field].__sequence__ += amount  # Add the given amount.
		
		# Update the attribute collection.
		cls.__attributes__ = OrderedDict(
					(k, v) for k, v in \
					sorted(cls.__attributes__.items(),
						key=lambda i: i[1].__sequence__)
				)
		
		return cls
	
	return adjust_inner
660939
private void shiftAll()
    {
        shift(PasswordStore.DIGEST);
        shift(PasswordStore.ALGORITHM);
        shift(PasswordStore.ITERATIONS);
        shift(PasswordStore.SALTSIZE);
    }
644301
void switchTwoRows(int rowIndex, int rowToIndex) {
        for (int i = 0; i < getItems().length; i++) {
            Object cellData = getItems()[rowToIndex][i];
            getItems()[rowToIndex][i] = getItems()[rowIndex][i];
            getItems()[rowIndex][i] = cellData;
        }
    }
748965
private void rotateTwiceOrdered() {
		Point2D_F64 a = ordered[0];
		Point2D_F64 b = ordered[1];
		Point2D_F64 c = ordered[2];
		Point2D_F64 d = ordered[3];

		ordered[0] = c;
		ordered[1] = d;
		ordered[2] = a;
		ordered[3] = b;
	}
54470
def shift_ordering_up(cls, parent_id, position, db_session=None, *args, **kwargs):
        
        db_session = get_db_session(db_session)
        query = db_session.query(cls.model)
        query = query.filter(cls.model.parent_id == parent_id)
        query = query.filter(cls.model.ordering >= position)
        query.update(
            {cls.model.ordering: cls.model.ordering + 1}, synchronize_session=False
        )
        db_session.flush()
715989
public void renumberUniqueIDs()
   {
      int uid = firstUniqueID();
      for (T entity : this)
      {
         entity.setUniqueID(Integer.valueOf(uid++));
      }
   }
748334
public void swapLists() {
		FastQueue<Helper> tmp = srcPositive;
		srcPositive = dstPositive;
		dstPositive = tmp;

		tmp = srcNegative;
		srcNegative = dstNegative;
		dstNegative = tmp;
	}
914195
private static void vectorSwap(PagesIndex pagesIndex, int from, int l, int s)
    {
        for (int i = 0; i < s; i++, from++, l++) {
            pagesIndex.swap(from, l);
        }
    }
183988
def every(self, step, offset=0):
        
        new = []

        for position, item in enumerate(self.items):
            if position % step == offset:
                new.append(item)

        return self.__class__(new)
252317
private void overlayRightShift(
    int           ix)
  {
    for (int j = ix; j > 0; j--)
      _nodeKey[j] = _nodeKey[j-1];
  }
671134
public Alignment<S> move(int offset) {
        return new Alignment<>(sequence1, mutations, sequence1Range, sequence2Range.move(offset), score);
    }