nodes: 0, module; 1, function_definition; 2, function_name:sort_values; 3, parameters; 4, block; 5, identifier:expr; 6, identifier:by; 7, default_parameter; 8, expression_statement; 9, if_statement; 10, expression_statement; 11, return_statement; 12, identifier:ascending; 13, True; 14, comment:"""
      Sort the collection by values. `sort` is an alias name for `sort_values`
  
      :param expr: collection
      :param by: the sequence or sequences to sort
      :param ascending: Sort ascending vs. descending. Sepecify list for multiple sort orders.
                        If this is a list of bools, must match the length of the by
      :return: Sorted collection
  
      :Example:
  
      >>> df.sort_values(['name', 'id'])  # 1
      >>> df.sort(['name', 'id'], ascending=False)  # 2
      >>> df.sort(['name', 'id'], ascending=[False, True])  # 3
      >>> df.sort([-df.name, df.id])  # 4, equal to #3
      """; 15, not_operator; 16, block; 17, assignment; 18, call; 19, call; 20, expression_statement; 21, identifier:by; 22, list_comprehension; 23, identifier:SortedCollectionExpr; 24, argument_list; 25, identifier:isinstance; 26, argument_list; 27, assignment; 28, conditional_expression:it(expr) if inspect.isfunction(it) else it; 29, for_in_clause; 30, identifier:expr; 31, keyword_argument; 32, keyword_argument; 33, keyword_argument; 34, identifier:by; 35, identifier:list; 36, identifier:by; 37, list; 38, call; 39, call; 40, identifier:it; 41, identifier:it; 42, identifier:by; 43, identifier:_sorted_fields; 44, identifier:by; 45, identifier:_ascending; 46, identifier:ascending; 47, identifier:_schema; 48, attribute; 49, identifier:by; 50, identifier:it; 51, argument_list; 52, attribute; 53, argument_list; 54, identifier:expr; 55, identifier:_schema; 56, identifier:expr; 57, identifier:inspect; 58, identifier:isfunction; 59, identifier:it
code: def sort_values(expr, by, ascending=True):
      """
      Sort the collection by values. `sort` is an alias name for `sort_values`
  
      :param expr: collection
      :param by: the sequence or sequences to sort
      :param ascending: Sort ascending vs. descending. Sepecify list for multiple sort orders.
                        If this is a list of bools, must match the length of the by
      :return: Sorted collection
  
      :Example:
  
      >>> df.sort_values(['name', 'id'])  # 1
      >>> df.sort(['name', 'id'], ascending=False)  # 2
      >>> df.sort(['name', 'id'], ascending=[False, True])  # 3
      >>> df.sort([-df.name, df.id])  # 4, equal to #3
      """
      if not isinstance(by, list):
          by = [by, ]
      by = [it(expr) if inspect.isfunction(it) else it for it in by]
      return SortedCollectionExpr(expr, _sorted_fields=by, _ascending=ascending,
                                  _schema=expr._schema)