nodes: 0, module; 1, function_definition; 2, function_name:_sort_and_trim; 3, parameters; 4, block; 5, identifier:data; 6, default_parameter; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, expression_statement; 11, return_statement; 12, identifier:reverse; 13, False; 14, comment:"""Sorts a dictionary with at least two fields on each of them sorting
          by the second element.
  
          .. warning::
            Right now is hardcoded to 10 elements, improve the command line
            interface to allow to send parameters to each command or globally.
          """; 15, assignment; 16, assignment; 17, assignment; 18, subscript; 19, identifier:threshold; 20, integer:10; 21, identifier:data_list; 22, call; 23, identifier:data_list; 24, call; 25, identifier:data_list; 26, slice; 27, attribute; 28, argument_list; 29, identifier:sorted; 30, argument_list; 31, identifier:threshold; 32, identifier:data; 33, identifier:items; 34, identifier:data_list; 35, keyword_argument; 36, keyword_argument; 37, identifier:key; 38, lambda; 39, identifier:reverse; 40, identifier:reverse; 41, lambda_parameters; 42, subscript; 43, identifier:data_info; 44, identifier:data_info; 45, integer:1
code: def _sort_and_trim(data, reverse=False):
          """Sorts a dictionary with at least two fields on each of them sorting
          by the second element.
  
          .. warning::
            Right now is hardcoded to 10 elements, improve the command line
            interface to allow to send parameters to each command or globally.
          """
          threshold = 10
          data_list = data.items()
          data_list = sorted(
              data_list,
              key=lambda data_info: data_info[1],
              reverse=reverse,
          )
          return data_list[:threshold]