nodes: 0, module; 1, function_definition; 2, function_name:sort_values; 3, parameters; 4, block; 5, identifier:self; 6, identifier:by; 7, default_parameter; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, if_statement; 13, expression_statement; 14, expression_statement; 15, expression_statement; 16, expression_statement; 17, expression_statement; 18, expression_statement; 19, expression_statement; 20, expression_statement; 21, return_statement; 22, identifier:ascending; 23, True; 24, comment:"""Sort the DataFrame based on a column.
  
          Unlike Pandas, one can sort by data from both index and regular columns.
  
          Currently possible to sort only on a single column since Weld is missing multiple-column sort.
          Note this is an expensive operation (brings all data to Weld).
  
          Parameters
          ----------
          by : str or list of str
              Column names to sort.
          ascending : bool, optional
  
          Returns
          -------
          DataFrame
              DataFrame sorted according to the column.
  
          """; 25, call; 26, call; 27, assignment; 28, comparison_operator:len(by) > 1; 29, block; 30, assignment; 31, assignment; 32, assignment; 33, assignment; 34, assignment; 35, assignment; 36, assignment; 37, assignment; 38, call; 39, identifier:check_type; 40, argument_list; 41, identifier:check_str_or_list_str; 42, argument_list; 43, identifier:by; 44, call; 45, call; 46, integer:1; 47, raise_statement; 48, identifier:all_data; 49, call; 50, identifier:by_data; 51, subscript; 52, identifier:sorted_indices; 53, call; 54, identifier:new_index; 55, call; 56, identifier:new_columns; 57, call; 58, identifier:new_column_names; 59, list_comprehension; 60, identifier:new_columns; 61, list_comprehension; 62, identifier:new_data; 63, call; 64, identifier:DataFrame; 65, argument_list; 66, identifier:ascending; 67, identifier:bool; 68, identifier:by; 69, identifier:as_list; 70, argument_list; 71, identifier:len; 72, argument_list; 73, call; 74, attribute; 75, argument_list; 76, identifier:all_data; 77, identifier:by; 78, identifier:weld_sort; 79, argument_list; 80, attribute; 81, argument_list; 82, identifier:list; 83, argument_list; 84, attribute; 85, for_in_clause; 86, call; 87, for_in_clause; 88, identifier:OrderedDict; 89, argument_list; 90, identifier:new_data; 91, identifier:new_index; 92, identifier:by; 93, identifier:by; 94, identifier:NotImplementedError; 95, argument_list; 96, identifier:self; 97, identifier:reset_index; 98, call; 99, call; 100, string; 101, keyword_argument; 102, attribute; 103, identifier:_iloc_indices; 104, identifier:sorted_indices; 105, call; 106, identifier:column; 107, identifier:name; 108, identifier:column; 109, identifier:new_columns; 110, identifier:_series_iloc; 111, argument_list; 112, identifier:column; 113, identifier:new_columns; 114, call; 115, string; 116, attribute; 117, argument_list; 118, attribute; 119, argument_list; 120, string_content:sort_index; 121, identifier:ascending; 122, identifier:ascending; 123, identifier:self; 124, identifier:index; 125, attribute; 126, argument_list; 127, identifier:column; 128, identifier:sorted_indices; 129, identifier:new_index; 130, identifier:zip; 131, argument_list; 132, string_content:Weld does not yet support sorting on multiple columns; 133, identifier:by_data; 134, identifier:_gather_data_for_weld; 135, identifier:by_data; 136, identifier:_gather_weld_types; 137, identifier:self; 138, identifier:_iter; 139, identifier:new_column_names; 140, identifier:new_columns
code: def sort_values(self, by, ascending=True):
          """Sort the DataFrame based on a column.
  
          Unlike Pandas, one can sort by data from both index and regular columns.
  
          Currently possible to sort only on a single column since Weld is missing multiple-column sort.
          Note this is an expensive operation (brings all data to Weld).
  
          Parameters
          ----------
          by : str or list of str
              Column names to sort.
          ascending : bool, optional
  
          Returns
          -------
          DataFrame
              DataFrame sorted according to the column.
  
          """
          check_type(ascending, bool)
          check_str_or_list_str(by)
          by = as_list(by)
  
          if len(by) > 1:
              raise NotImplementedError('Weld does not yet support sorting on multiple columns')
  
          all_data = self.reset_index()
          by_data = all_data[by]
  
          sorted_indices = weld_sort(by_data._gather_data_for_weld(),
                                     by_data._gather_weld_types(),
                                     'sort_index',
                                     ascending=ascending)
  
          new_index = self.index._iloc_indices(sorted_indices)
          new_columns = list(self._iter())
          new_column_names = [column.name for column in new_columns]
          new_columns = [_series_iloc(column, sorted_indices, new_index) for column in new_columns]
          new_data = OrderedDict(zip(new_column_names, new_columns))
  
          return DataFrame(new_data, new_index)