Orders the menu according to their order.
354158
private function applyOrdering()
    {
        if (empty($this->menu)
            || $this->orderingApplied
        ) {
            return;
        }

        uasort($this->menu, array($this, 'menuCompare'));
        foreach ($this->menu as $key => &$element) {
            if (is_null($element)) {
                unset($this->menu[$key]);
            } elseif ($element['_hasSubmenu']) {
                uasort($element, array($this, 'menuCompare'));
            }
        }

        $this->orderingApplied = true;
    }
1017782
def orders(self):
        
        self.account.refresh()
        return [o for o in self.account.openorders if self.bot["market"] == o.market and self.account.openorders]
378859
def OnReorder(self, event):
        """"""
        column = self.columns[event.GetColumn()]
        return self.ReorderByColumn( column )
727694
public function updateAccountMenu($menu)
    {
        $curr_action = $this
            ->owner
            ->getRequest()
            ->param("Action");
        
        $menu->add(ArrayData::create([
            "ID"    => 1,
            "Title" => _t('Orders.OutstandingOrders', 'Outstanding Orders'),
            "Link"  => $this->owner->Link("outstanding"),
            "LinkingMode" => ($curr_action == "outstanding") ? "current" : "link"
        ]));

        $menu->add(ArrayData::create([
            "ID"    => 2,
            "Title" => _t('Orders.OrderHistory', "Order history"),
            "Link"  => $this->owner->Link("history"),
            "LinkingMode" => ($curr_action == "history") ? "current" : "link"
        ]));
    }
409062
def fulfill_order(self, request, pk):
        
        order = Order.objects.get(id=pk)
        order.fulfill()
        return Response(status=status.HTTP_204_NO_CONTENT)
532786
def get_order(self, order_id, **params):
        """"""
        response = self._get('v2', 'orders', order_id, params=params)
        return self._make_api_object(response, Order)
1206538
def placeOrder(self, contract, order, orderId=None, account=None):
        

        # get latest order id before submitting an order
        self.requestOrderIds()

        # continue...
        useOrderId = self.orderId if orderId == None else orderId
        if account:
            order.m_account = account
        self.ibConn.placeOrder(useOrderId, contract, order)

        account_key = order.m_account
        self.orders[useOrderId] = {
            "id":       useOrderId,
            "symbol":   self.contractString(contract),
            "contract": contract,
            "status":   "SENT",
            "reason":   None,
            "avgFillPrice": 0.,
            "parentId": 0,
            "time": datetime.fromtimestamp(int(self.time)),
            "account": None
        }
        if hasattr(order, "m_account"):
            self.orders[useOrderId]["account"] = order.m_account

        # return order id
        return useOrderId
175439
def orders_after(self, other, *, visited=None):
        
        return self.orders_after_any(frozenset([other]), visited=visited)
82871
public void addOrder(Order... orders) {
		if(null != this.orders){
			ArrayUtil.append(this.orders, orders);
		}
		this.orders = orders;
	}
1244118
public function orderTables() {
        $result = $this->orderElements($this->tables);
        if ($result) {
            $this->setTables($result);
            return true;
        } else {
            return false;
        }
    }
1120691
def process_order(self, order):
        
        try:
            dt_orders = self._orders_by_modified[order.dt]
        except KeyError:
            self._orders_by_modified[order.dt] = OrderedDict([
                (order.id, order),
            ])
            self._orders_by_id[order.id] = order
        else:
            self._orders_by_id[order.id] = dt_orders[order.id] = order
            # to preserve the order of the orders by modified date
            move_to_end(dt_orders, order.id, last=True)

        move_to_end(self._orders_by_id, order.id, last=True)
468437
def place_limit_order(self, side: Side, amount: Number, price: Number) -> Order:
        """"""
        return self.place_order(side, OrderType.LIMIT, amount, price)
988444
public function reorder()
    {
        $store = $this->getRepository()->getStore();
        $query = $this->getScopedQuery($this->_mixer);
        $store->execute('SET @order = 0');
        $query->update('@col(ordering) = (@order := @order + 1)')->order('ordering', 'ASC');
        $store->execute($query);
    }
291853
def as_ordered(self, inplace=False):
        
        inplace = validate_bool_kwarg(inplace, 'inplace')
        return self.set_ordered(True, inplace=inplace)
804829
protected function addOrderCheckout()
    {
        $submitted = $this->getSubmittedOrderCheckout();
        $result = $this->order_action->add($submitted, array('admin' => $this->admin));
        $this->finishOrderCheckout($result);
    }
288689
def order_run(backend, kitchen, recipe, variation, node):
    
    err_str, use_kitchen = Backend.get_kitchen_from_user(kitchen)
    if use_kitchen is None:
        raise click.ClickException(err_str)
    if recipe is None:
        recipe = DKRecipeDisk.find_recipe_name()
        if recipe is None:
            raise click.ClickException('You must be in a recipe folder, or provide a recipe name.')

    msg = '%s - Create an Order:\n\tKitchen: %s\n\tRecipe: %s\n\tVariation: %s\n' % (get_datetime(), use_kitchen, recipe, variation)
    if node is not None:
        msg += '\tNode: %s\n' % node

    click.secho(msg, fg='green')
    check_and_print(DKCloudCommandRunner.create_order(backend.dki, use_kitchen, recipe, variation, node))
1291751
def check_order(self, order):
    
    own_order = self.order
    for item in order:
      if item not in own_order:
        raise ValueError(f'Order item {item} not found.')
    return order