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)