'Specify how the query results should be sorted.
Result entities will be sorted by the first property argument, then by the
second, and so on. For example, this:
> query = Query(\'Person\')
> query.Order(\'bday\', (\'age\', Query.DESCENDING))
sorts everyone in order of their birthday, starting with January 1.
People with the same birthday are sorted by age, oldest to youngest.
The direction for each sort property may be provided; if omitted, it
defaults to ascending.
Order() may be called multiple times. Each call resets the sort order
from scratch.
If an inequality filter exists in this Query it must be the first property
passed to Order. Any number of sort orders may be used after the
inequality filter property. Without inequality filters, any number of
filters with different orders may be specified.
Entities with multiple values for an order property are sorted by their
lowest value.
Note that a sort order implies an existence filter! In other words,
Entities without the sort order property are filtered out, and *not*
included in the query results.
If the sort order property has different types in different entities - ie,
if bob[\'id\'] is an int and fred[\'id\'] is a string - the entities will be
grouped first by the property type, then sorted within type. No attempt is
made to compare property values across types.
Raises BadArgumentError if any argument is of the wrong format.
Args:
# the properties to sort by, in sort order. each argument may be either a
# string or (string, direction) 2-tuple.
Returns:
# this query
Query'

def Order(self, *orderings):

    orderings = list(orderings)
    for (order, i) in zip(orderings, range(len(orderings))):
        if (not (isinstance(order, basestring) or (isinstance(order, tuple) and (len(order) in [2, 3])))):
            raise datastore_errors.BadArgumentError(('Order()    expects    strings    or    2-    or    3-tuples;    received    %s    (a    %s).    ' % (order, typename(order))))
        if isinstance(order, basestring):
            order = (order,)
        datastore_types.ValidateString(order[0], 'sort    order    property', datastore_errors.BadArgumentError)
        property = order[0]
        direction = order[(-1)]
        if (direction not in (Query.ASCENDING, Query.DESCENDING)):
            if (len(order) == 3):
                raise datastore_errors.BadArgumentError(('Order()    expects    Query.ASCENDING    or    DESCENDING;    received    %s' % str(direction)))
            direction = Query.ASCENDING
        if ((self.__kind is None) and ((property != datastore_types.KEY_SPECIAL_PROPERTY) or (direction != Query.ASCENDING))):
            raise datastore_errors.BadArgumentError(('Only    %s    ascending    orders    are    supported    on    kindless    queries' % datastore_types.KEY_SPECIAL_PROPERTY))
        orderings[i] = (property, direction)
    if (orderings and self.__inequality_prop and (orderings[0][0] != self.__inequality_prop)):
        raise datastore_errors.BadArgumentError(('First    ordering    property    must    be    the    same    as    inequality    filter    property,    if    specified    for    this    query;    received    %s,    expected    %s' % (orderings[0][0], self.__inequality_prop)))
    self.__orderings = orderings
    return self
