nodes: 0, module; 1, function_definition; 2, function_name:sort_data; 3, parameters; 4, block; 5, identifier:self; 6, identifier:data; 7, identifier:sort_key; 8, default_parameter; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, return_statement; 14, identifier:reverse; 15, False; 16, comment:"""Sort dataset."""; 17, assignment; 18, assignment; 19, identifier:line; 20, identifier:lines; 21, block; 22, identifier:sorted_data; 23, identifier:sorted_data; 24, list; 25, identifier:lines; 26, call; 27, expression_statement; 28, identifier:sorted; 29, argument_list; 30, call; 31, identifier:data; 32, keyword_argument; 33, keyword_argument; 34, attribute; 35, argument_list; 36, identifier:key; 37, lambda; 38, identifier:reverse; 39, identifier:reverse; 40, identifier:sorted_data; 41, identifier:append; 42, identifier:line; 43, lambda_parameters; 44, subscript; 45, identifier:k; 46, identifier:k; 47, identifier:sort_key
code: async def sort_data(self, data, sort_key, reverse=False):
          """Sort dataset."""
          sorted_data = []
          lines = sorted(data, key=lambda k: k[sort_key], reverse=reverse)
          for line in lines:
              sorted_data.append(line)
          return sorted_data