nodes: 0, module; 1, function_definition; 2, function_name:add_property_orders; 3, parameters; 4, block; 5, identifier:query_proto; 6, list_splat_pattern; 7, expression_statement; 8, for_statement; 9, identifier:orders; 10, comment:"""Add ordering constraint for the given datastore.Query proto message.
  
    Args:
      query_proto: datastore.Query proto message.
      orders: list of propertype name string, default to ascending
      order and set descending if prefixed by '-'.
  
    Usage:
      >>> add_property_orders(query_proto, 'foo')  # sort by foo asc
      >>> add_property_orders(query_proto, '-bar')  # sort by bar desc
    """; 11, identifier:order; 12, identifier:orders; 13, block; 14, expression_statement; 15, if_statement; 16, expression_statement; 17, assignment; 18, comparison_operator:order[0] == '-'; 19, block; 20, else_clause; 21, assignment; 22, identifier:proto; 23, call; 24, subscript; 25, string; 26, expression_statement; 27, expression_statement; 28, block; 29, attribute; 30, identifier:order; 31, attribute; 32, argument_list; 33, identifier:order; 34, integer:0; 35, string_content:-; 36, assignment; 37, assignment; 38, expression_statement; 39, attribute; 40, identifier:name; 41, attribute; 42, identifier:add; 43, identifier:order; 44, subscript; 45, attribute; 46, attribute; 47, assignment; 48, identifier:proto; 49, identifier:property; 50, identifier:query_proto; 51, identifier:order; 52, identifier:order; 53, slice; 54, identifier:proto; 55, identifier:direction; 56, attribute; 57, identifier:DESCENDING; 58, attribute; 59, attribute; 60, integer:1; 61, identifier:query_pb2; 62, identifier:PropertyOrder; 63, identifier:proto; 64, identifier:direction; 65, attribute; 66, identifier:ASCENDING; 67, identifier:query_pb2; 68, identifier:PropertyOrder
code: def add_property_orders(query_proto, *orders):
    """Add ordering constraint for the given datastore.Query proto message.
  
    Args:
      query_proto: datastore.Query proto message.
      orders: list of propertype name string, default to ascending
      order and set descending if prefixed by '-'.
  
    Usage:
      >>> add_property_orders(query_proto, 'foo')  # sort by foo asc
      >>> add_property_orders(query_proto, '-bar')  # sort by bar desc
    """
    for order in orders:
      proto = query_proto.order.add()
      if order[0] == '-':
        order = order[1:]
        proto.direction = query_pb2.PropertyOrder.DESCENDING
      else:
        proto.direction = query_pb2.PropertyOrder.ASCENDING
      proto.property.name = order