Have no idea why wrong params order can't get data.
        So, use `OrderedDict` here.
490164
def _build_params(self):
        
        d = OrderedDict()
        d['purpose_codes'] = 'ADULT'
        d['queryDate'] = self._valid_date
        d['from_station'] = self._from_station_telecode
        d['to_station'] = self._to_station_telecode
        return d
914217
def sort_dict_by_key(obj):
    
    sort_func = lambda x: x[0]
    return OrderedDict(sorted(obj.items(), key=sort_func))
1178959
function orderByParam(query) {
  const value = query[orderedBy];

  switch (value) {
  case orderByKey:
    return;

  case orderByValue:
    return '$value';

  case orderByPriority:
    return '$priority';

  default:
    return value;
  }
}
562499
def get_fields(self, request, obj=None):
        
        fields = super(BaseDynamicInlineAdmin, self).get_fields(request, obj)
        if issubclass(self.model, Orderable):
            fields = list(fields)
            try:
                fields.remove("_order")
            except ValueError:
                pass
            fields.append("_order")
        return fields
124202
def fetch_order(self, order_id: str) -> Order:
        """"""
        return self._fetch(f'order id={order_id}', exc=OrderNotFound)(self._order)(order_id)
1352925
def _get_order_by(order, orderby, order_by_fields):
    
    try:
        # Find the actual database fieldnames for the keyword.
        db_fieldnames = order_by_fields[orderby]
    except KeyError:
        raise ValueError("Invalid value for 'orderby': '{0}', supported values are: {1}".format(orderby, ', '.join(sorted(order_by_fields.keys()))))

    # Default to descending for some fields, otherwise be ascending
    is_desc = (not order and orderby in ORDER_BY_DESC) \
        or (order or 'asc').lower() in ('desc', 'descending')

    if is_desc:
        return map(lambda name: '-' + name, db_fieldnames)
    else:
        return db_fieldnames
1057868
def to_param_dict(self):
        
        param_dict = {}
        for index, dictionary in enumerate(self.value):
            for key, value in dictionary.items():
                param_name = '{param_name}[{index}][{key}]'.format(
                                                    param_name=self.param_name,
                                                    index=index,
                                                    key=key)
                param_dict[param_name] = value
        return OrderedDict(sorted(param_dict.items()))
21719
def all(self, data={}, **kwargs):
        "
        return super(Order, self).all(data, **kwargs)
1156623
def _process_params(self, params):
        
        new_params = OrderedDict()
        for param_name, param_value in sorted(params.items()):
            param_value = params[param_name]
            ParamClass = AirtableParams._get(param_name)
            new_params.update(ParamClass(param_value).to_param_dict())
        return new_params
992100
def get_from_params(request, key):
    
    data = getattr(request, 'json', None) or request.values
    value = data.get(key)
    return to_native(value)
1350400
def pprint_for_ordereddict():
    
    od_saved = OrderedDict.__repr__
    try:
        OrderedDict.__repr__ = dict.__repr__
        yield
    finally:
        OrderedDict.__repr__ = od_saved
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))
1130581
def query_order(self, status=None, begintime=None, endtime=None):
        
        return self._post(
            'merchant/order/getbyfilter',
            data={
                'status': status,
                'begintime': begintime,
                'endtime': endtime
            }
        )
524735
def order_by(self, *args):
        
        if self._solr_locked:
            raise Exception("Query already executed, no changes can be made."
                            "%s %s" % (self._solr_query, self._solr_params)
                            )

        for arg in args:
            if arg.startswith('-'):
                self._solr_params['sort'][arg[1:]] = 'desc'
            else:
                self._solr_params['sort'][arg] = 'asc'
671144
def params_sorted_by_key(params)
      case params
      when Hash
        params.map     { |k, v| [k.to_s, params_sorted_by_key(v)] }
              .sort_by { |k, v| k }
              .to_h
      when Array
        params.map { |val| params_sorted_by_key(val) }
      else
        params.to_s
      end
    end
353440
def all(self, order_by=None, limit=0):
        
        with rconnect() as conn:
            try:
                query = self._base()
                if order_by is not None:
                    query = self._order_by(query, order_by)
                if limit > 0:
                    query = self._limit(query, limit)

                log.debug(query)
                rv = query.run(conn)
            except Exception as e:
                log.warn(e)
                raise
            else:
                data = [self._model(_) for _ in rv]
                return data
532786
def get_order(self, order_id, **params):
        """"""
        response = self._get('v2', 'orders', order_id, params=params)
        return self._make_api_object(response, Order)