early, later are ordered by ccw order.
347355
private static <T> IntPair findBridgeIndexes(PSArray<Point2D<T>> earlyHull, PSArray<Point2D<T>> laterHull, int earlyStart, int laterStart, MultipliableNumberSystem<T> ns) {
        int early = earlyStart;
        int later = laterStart;
        while (true) {
            int nextEarly = getPreIndex(early, earlyHull.size());
            int nextLater = getNextIndex(later, laterHull.size());
            if (LeftTurn.is(laterHull.get(later), earlyHull.get(early), earlyHull.get(nextEarly), ns))
                early = nextEarly;
            else if (RightTurn.is(earlyHull.get(early), laterHull.get(later), laterHull.get(nextLater), ns))
                later = nextLater;
            else
                break;
        }
        return new IntPair(early, later);
    }
1122786
def apply_order(self):
    ''''''
    self._ensure_modification_is_safe()

    if len(self.query.orders) > 0:
      self._iterable = Order.sorted(self._iterable, self.query.orders)
308989
def create_order(self, order_deets):
        """"""
        request = self._post('transactions/orders', order_deets)
        return self.responder(request)
306697
private void doInterceptBeforeQuery(Class<?> clazz, StringBuilder sql, List<Object> args) {
        for (DBHelperInterceptor interceptor : interceptors) {
            boolean isContinue = interceptor.beforeSelect(clazz, sql.toString(), args);
            if (!isContinue) {
                throw new NotAllowQueryException("interceptor class:" + interceptor.getClass());
            }
        }
    }
936163
public void fireBeforeCaseStarted(String caseId, String deploymentId, String caseDefinitionId, CaseFileInstance caseFile) {
        final Iterator<CaseEventListener> iter = getEventListenersIterator();

        if (iter.hasNext()) {
            final CaseStartEvent event = new CaseStartEvent(identityProvider.getName(), caseId, deploymentId, caseDefinitionId, caseFile);

            do{
                iter.next().beforeCaseStarted(event);
            } while (iter.hasNext());
        }
    }
162621
public static int rotateCCW (int direction, int ticks)
    {
        for (int ii = 0; ii < ticks; ii++) {
            direction = FINE_CCW_ROTATE[direction];
        }
        return direction;
    }
24283
function moveSequenceBefore(slotNext, slotFirst, slotLast) {
                    slotFirst.prev.next = slotLast.next;
                    slotLast.next.prev = slotFirst.prev;

                    slotFirst.prev = slotNext.prev;
                    slotLast.next = slotNext;

                    slotFirst.prev.next = slotFirst;
                    slotNext.prev = slotLast;

                    return true;
                }
531693
def earlier_submission_for_group(submission):
        """"""
        return (Submission
                .query_by(project=submission.project, group=submission.group)
                .filter(Submission.created_at < submission.created_at)
                .order_by(Submission.created_at.desc()).first())
1007089
def before_processing(eng, objects):
        """"""
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .before_processing(eng, objects)
        eng.save(WorkflowStatus.RUNNING)
        db.session.commit()
335974
def _prepare_orders(self, orders):
        

        for detail in PAYU_ORDER_DETAILS:
            if not any([detail in order for order in orders]):
                for order in orders:
                    order[detail] = PAYU_ORDER_DETAILS_DEFAULTS.get(detail, None)

        return orders
1130020
public function onBeforeWrite() {
		parent::onBeforeWrite();
		
		// dummy initial date
		if (!$this->OriginalPublishedDate) {
			// @TODO Fix this to be correctly localized!!
			$this->OriginalPublishedDate = date('Y-m-d 12:00:00');
		}
		
		$parent = $this->Parent();

		// just in case we've been moved, update our section
		$section = $this->findSection();
		$this->NewsSectionID = $section->ID;

		$newlyCreated = $section->ID == $parent->ID;
		$changedPublishDate = $this->isChanged('OriginalPublishedDate', 2);

		if (($changedPublishDate || $newlyCreated) && ($section->AutoFiling || $section->FilingMode)) {
			if (!$this->Created) {
				$this->Created = date('Y-m-d H:i:s');
			}
			$pp = $this->PartitionParent();
			if ($pp->ID != $this->ParentID) {
				$this->ParentID = $pp->ID;
			}
		}

	}
313532
private Order create(
            final String number,
            final String customerName,
            final LocalDate date,
            final String preferences,
            final ExecutionContext executionContext) {
        return executionContext.add(this, orders.create(number, customerName, date, preferences));
    }
1010015
function(d) {
    return d.s || (d.s = later.date.getSec.call(d));
  }
557027
def pre_order(self):
        """"""
        yield self
        for child in self.children:
            for node in child.pre_order():
                yield node
130610
public void captureOrderings(OrderingList<?> ordering) {
        try {
            if (ordering != null) {
                for (OrderedProperty<?> orderedProperty : ordering) {
                    ChainedProperty<?> chained = orderedProperty.getChainedProperty();
                    if (!chained.isDerived()) {
                        mRootJoinNode.addJoin(mRepository, chained, mAliasGenerator);
                    }
                }
            }
        } catch (RepositoryException e) {
            throw new UndeclaredThrowableException(e);
        }
    }
108444
def order(self, *args):
    """"""
    # q.order(Employee.name, -Employee.age)
    if not args:
      return self
    orders = []
    o = self.orders
    if o:
      orders.append(o)
    for arg in args:
      if isinstance(arg, model.Property):
        orders.append(datastore_query.PropertyOrder(arg._name, _ASC))
      elif isinstance(arg, datastore_query.Order):
        orders.append(arg)
      else:
        raise TypeError('order() expects a Property or query Order; '
                        'received %r' % arg)
    if not orders:
      orders = None
    elif len(orders) == 1:
      orders = orders[0]
    else:
      orders = datastore_query.CompositeOrder(orders)
    return self.__class__(kind=self.kind, ancestor=self.ancestor,
                          filters=self.filters, orders=orders,
                          app=self.app, namespace=self.namespace,
                          default_options=self.default_options,
                          projection=self.projection, group_by=self.group_by)
820618
def update_order(uid, order):
        '''
        
        '''
        entry = TabPost.update(
            order=order
        ).where(TabPost.uid == uid)
        entry.execute()