nodes: 0, module; 1, function_definition; 2, function_name:ranker; 3, parameters; 4, block; 5, identifier:self; 6, identifier:X; 7, identifier:meta; 8, expression_statement; 9, comment:# total score is just a sum of each row; 10, expression_statement; 11, expression_statement; 12, comment:# matrix to array; 13, expression_statement; 14, expression_statement; 15, comment:# sort the list of dicts according to ranks; 16, expression_statement; 17, expression_statement; 18, return_statement; 19, comment:"""
          Sort the place features list by the score of its relevance.
          """; 20, assignment; 21, assignment; 22, assignment; 23, assignment; 24, assignment; 25, assignment; 26, tuple; 27, identifier:total_score; 28, call; 29, identifier:total_score; 30, call; 31, identifier:ranks; 32, call; 33, identifier:ranks; 34, subscript; 35, identifier:sorted_meta; 36, list_comprehension; 37, identifier:sorted_X; 38, subscript; 39, identifier:sorted_X; 40, identifier:sorted_meta; 41, attribute; 42, argument_list; 43, attribute; 44, argument_list; 45, attribute; 46, argument_list; 47, identifier:ranks; 48, slice; 49, subscript; 50, for_in_clause; 51, identifier:X; 52, identifier:ranks; 53, call; 54, identifier:transpose; 55, identifier:np; 56, identifier:squeeze; 57, call; 58, identifier:total_score; 59, identifier:argsort; 60, unary_operator; 61, identifier:meta; 62, identifier:r; 63, identifier:r; 64, identifier:ranks; 65, attribute; 66, argument_list; 67, attribute; 68, argument_list; 69, integer:1; 70, identifier:X; 71, identifier:sum; 72, keyword_argument; 73, identifier:np; 74, identifier:asarray; 75, identifier:total_score; 76, identifier:axis; 77, integer:1
code: def ranker(self, X, meta):
          """
          Sort the place features list by the score of its relevance.
          """
          # total score is just a sum of each row
          total_score = X.sum(axis=1).transpose()
          total_score = np.squeeze(np.asarray(total_score))  # matrix to array
          ranks = total_score.argsort()
          ranks = ranks[::-1]
          # sort the list of dicts according to ranks
          sorted_meta = [meta[r] for r in ranks]
          sorted_X = X[ranks]
          return (sorted_X, sorted_meta)