expects order
 either as instance variables or in options
519598
def url_for_order(options = { })
      trolley = options.delete(:trolley) || @trolley
      trolley = @order.trolley if @order

      order = options.delete(:order) || @order || trolley.selected_order
      
      options[:id] = order
      options[:controller] = 'orders'
      options[:action] = 'show'
      options[:urlified_name] = Basket.site_basket.urlified_name

      url_for options
    end
337948
def order_link(order, options = {})
      link_to t("#{options[:i18n_scope]}.#{order}"), url_for(params.to_unsafe_h.merge(page: nil, order: order)), data: { order: order }, remote: true
    end
1059348
function SortOrderComparator(sortOrder, options) {
        this.sortOrder = sortOrder;
        this.options = {
            casesensitive: false
        };
        if (options) {
            _.extend(this.options, options);
        }
        this.expressions = new Array(sortOrder.sortFields.length);
        for (var i = 0; i < this.expressions.length; ++i) {
            this.expressions[i] = new JsonPath_1.JsonPath(sortOrder.sortFields[i].name);
        }
    }
192508
def as_unordered(self, inplace=False):
        
        inplace = validate_bool_kwarg(inplace, 'inplace')
        return self.set_ordered(False, inplace=inplace)
691191
function prepareSortOrder ( pkg ) {
	const index = SORT_ORDER.indexOf('repository');
	const unknownKeys = difference(Object.keys(pkg), SORT_ORDER).sort();
	return flatten(insert(SORT_ORDER, index, unknownKeys));
}
277882
def get_ordered_options(self, hidden=False):
        
        return [opt.as_dict() for opt in self.options.values() \
                                            if hidden or (not opt.hidden)]
246593
def orders(order_uuid = nil)
      if order_uuid
        Endpoints::SpecificOrder.new(order_uuid)
      else
        Endpoints::Orders.new
      end
    end
235897
def _get_order_by(self, request):
        
        attr = request.params.get('sort', request.params.get('order_by'))
        if attr is None or not hasattr(self.mapped_class, attr):
            return None
        if request.params.get('dir', '').upper() == 'DESC':
            return desc(getattr(self.mapped_class, attr))
        else:
            return asc(getattr(self.mapped_class, attr))
346341
def openOrder(self, orderId, arg0, arg1, arg2):
        """"""
        return _swigibpy.EWrapper_openOrder(self, orderId, arg0, arg1, arg2)
702272
def p_opt_order(self, p):
        ''''''
        if len(p) > 1:
            if p[3] not in 'CF':
                raise PythranSyntaxError("Invalid Pythran spec. "
                                         "Unknown order '{}'".format(p[3]))
            p[0] = p[3]
        else:
            p[0] = None
320021
def list_order(f, attribute, options)
      if is_association?(f, attribute) && !options[:collection]
        begin
          options[:collection] = to_class(attribute).for_fae_index
        rescue NameError
          raise "Fae::MissingCollection: `#{attribute}` isn't an orderable class, define your order using the `collection` option."
        end
      end
    end
1314335
function _parse_select_order(ObjType, document_type, order, q, traits) {

	debug.assert(ObjType).is('function');
	debug.assert(document_type).ignore(undefined).is('object');
	debug.assert(order).is('array');

	return ARRAY(order).map(function(o) {
		var key, type, rest;
		if(is.array(o)) {
			key = parse_operator_name(o[0]);
			type = parse_operator_type(o[0], 'text');
			rest = o.slice(1);
		} else {
			key = parse_operator_name(o);
			type = parse_operator_type(o, 'text');
			rest = [];
		}

		if(key === 'BIND') {
			return _parse_function_predicate(ObjType, q, undefined, rest, type, traits);
		}

		//debug.log('key = ', key);
		var parsed_key = _parse_predicate_key(ObjType, {'traits': traits, 'epoch':true}, key);
		//debug.log('parsed_key = ', parsed_key);
		var pgcast = parse_predicate_pgcast(ObjType, document_type, key);
		//debug.log('pgcast = ', pgcast);

		return new Predicate( [pgcast(parsed_key.getString())].concat(rest).join(' '), parsed_key.getParams(), parsed_key.getMetaObject() );
	}).valueOf();
}
1133083
def order_by(self, *props):
        
        should_remove = len(props) == 1 and props[0] is None
        if not hasattr(self, '_order_by') or should_remove:
            self._order_by = []
            if should_remove:
                return self
        if '?' in props:
            self._order_by.append('?')
        else:
            for prop in props:
                prop = prop.strip()
                if prop.startswith('-'):
                    prop = prop[1:]
                    desc = True
                else:
                    desc = False

                if prop not in self.source_class.defined_properties(rels=False):
                    raise ValueError("No such property {0} on {1}".format(
                        prop, self.source_class.__name__))

                property_obj = getattr(self.source_class, prop)
                if isinstance(property_obj, AliasProperty):
                    prop = property_obj.aliased_to()

                self._order_by.append(prop + (' DESC' if desc else ''))

        return self
1292322
def get_options(self, hidden=False):
        
        return dict((opt['name'], opt) for opt in self.get_ordered_options(hidden=hidden))
1197807
def order fields
      by_num = { 1 => 'asc', -1 => 'desc' }
      ordering = []
      fields.each_pair do |key, value|
        ordering << [key.to_s, by_num[value] || value]
      end
      @ordering = ordering
      self
    end
259851
def assert_valid_order(order, fields)
      Array(order).each do |order_entry|
        case order_entry
          when Symbol, String
            unless @properties.named?(order_entry)
              raise ArgumentError, "+options[:order]+ entry #{order_entry.inspect} does not map to a property in #{model}"
            end
        end
      end
    end
357702
def creation_ordered(class_to_decorate):
    

    next_index = functools.partial(next, itertools.count())

    __init__orig = class_to_decorate.__init__

    @functools.wraps(__init__orig, assigned=['__doc__'])
    def __init__(self, *args, **kwargs):
        object.__setattr__(self, '_index', next_index())
        __init__orig(self, *args, **kwargs)

    setattr(class_to_decorate, '__init__', __init__)

    # noinspection PyProtectedMember
    def __lt__(self, other):
        return self._index < other._index  # pragma: no mutate

    setattr(class_to_decorate, '__lt__', __lt__)

    class_to_decorate = functools.total_ordering(class_to_decorate)

    return class_to_decorate