nodes: 0, module; 1, function_definition; 2, function_name:order_by; 3, parameters; 4, block; 5, identifier:self; 6, default_parameter; 7, expression_statement; 8, if_statement; 9, if_statement; 10, return_statement; 11, identifier:key_selector; 12, identifier:identity; 13, string; 14, call; 15, block; 16, not_operator; 17, block; 18, call; 19, string_content:Sorts by a key in ascending order.
  
          Introduces a primary sorting order to the sequence. Additional sort
          criteria should be specified by subsequent calls to then_by() and
          then_by_descending().  Calling order_by() or order_by_descending() on
          the results of a call to order_by() will introduce a new primary
          ordering which will override any already established ordering.
  
          This method performs a stable sort. The order of two elements with the
          same key will be preserved.
  
          Note: This method uses deferred execution.
  
          Args:
              key_selector: A unary function which extracts a key from each
                  element using which the result will be ordered.
  
          Returns:
              An OrderedQueryable over the sorted elements.
  
          Raises:
              ValueError: If the Queryable is closed.
              TypeError: If the key_selector is not callable.; 20, attribute; 21, argument_list; 22, raise_statement; 23, call; 24, raise_statement; 25, attribute; 26, argument_list; 27, identifier:self; 28, identifier:closed; 29, call; 30, identifier:is_callable; 31, argument_list; 32, call; 33, identifier:self; 34, identifier:_create_ordered; 35, call; 36, unary_operator; 37, identifier:key_selector; 38, identifier:ValueError; 39, argument_list; 40, identifier:key_selector; 41, identifier:TypeError; 42, argument_list; 43, identifier:iter; 44, argument_list; 45, integer:1; 46, concatenated_string; 47, call; 48, identifier:self; 49, string:"Attempt to call order_by() on a "; 50, string:"closed Queryable."; 51, attribute; 52, argument_list; 53, concatenated_string; 54, identifier:format; 55, keyword_argument; 56, string:"order_by() parameter key_selector={key_selector} "; 57, string:"is not callable"; 58, identifier:key_selector; 59, call; 60, identifier:repr; 61, argument_list; 62, identifier:key_selector
code: def order_by(self, key_selector=identity):
          '''Sorts by a key in ascending order.
  
          Introduces a primary sorting order to the sequence. Additional sort
          criteria should be specified by subsequent calls to then_by() and
          then_by_descending().  Calling order_by() or order_by_descending() on
          the results of a call to order_by() will introduce a new primary
          ordering which will override any already established ordering.
  
          This method performs a stable sort. The order of two elements with the
          same key will be preserved.
  
          Note: This method uses deferred execution.
  
          Args:
              key_selector: A unary function which extracts a key from each
                  element using which the result will be ordered.
  
          Returns:
              An OrderedQueryable over the sorted elements.
  
          Raises:
              ValueError: If the Queryable is closed.
              TypeError: If the key_selector is not callable.
          '''
          if self.closed():
              raise ValueError("Attempt to call order_by() on a "
                               "closed Queryable.")
  
          if not is_callable(key_selector):
              raise TypeError("order_by() parameter key_selector={key_selector} "
                      "is not callable".format(key_selector=repr(key_selector)))
  
          return self._create_ordered(iter(self), -1, key_selector)