nodes: 0, module; 1, function_definition; 2, function_name:sort; 3, parameters; 4, block; 5, identifier:self; 6, identifier:request; 7, default_parameter; 8, expression_statement; 9, return_statement; 10, identifier:reverse; 11, False; 12, comment:"""Sort collection."""; 13, call; 14, identifier:sorted; 15, argument_list; 16, attribute; 17, keyword_argument; 18, keyword_argument; 19, identifier:self; 20, identifier:collection; 21, identifier:key; 22, lambda; 23, identifier:reverse; 24, identifier:reverse; 25, lambda_parameters; 26, call; 27, identifier:o; 28, identifier:getattr; 29, argument_list; 30, identifier:o; 31, attribute; 32, integer:0; 33, identifier:self; 34, identifier:columns_sort
code: async def sort(self, request, reverse=False):
          """Sort collection."""
          return sorted(
              self.collection, key=lambda o: getattr(o, self.columns_sort, 0), reverse=reverse)