nodes: 0, module; 1, function_definition; 2, function_name:sort_dict; 3, parameters; 4, block; 5, identifier:self; 6, identifier:data; 7, identifier:key; 8, expression_statement; 9, return_statement; 10, string; 11, conditional_expression:sorted(data, key=itemgetter(key)) if data else []; 12, string_content:Sort a list of dictionaries by dictionary key; 13, call; 14, identifier:data; 15, list; 16, identifier:sorted; 17, argument_list; 18, identifier:data; 19, keyword_argument; 20, identifier:key; 21, call; 22, identifier:itemgetter; 23, argument_list; 24, identifier:key
code: def sort_dict(self, data, key):
      '''Sort a list of dictionaries by dictionary key'''
      return sorted(data, key=itemgetter(key)) if data else []