nodes: 0, module; 1, function_definition; 2, function_name:_inplace_sort_by_id; 3, parameters; 4, block; 5, identifier:unsorted_list; 6, expression_statement; 7, if_statement; 8, expression_statement; 9, expression_statement; 10, delete_statement; 11, expression_statement; 12, comment:"""Takes a list of dicts each of which has an '@id' key,
      sorts the elements in the list by the value of the @id key.
      Assumes that @id is unique or the dicts have a meaningul < operator
      """; 13, not_operator; 14, block; 15, assignment; 16, call; 17, subscript; 18, call; 19, call; 20, return_statement; 21, identifier:sorted_list; 22, list_comprehension; 23, attribute; 24, argument_list; 25, identifier:unsorted_list; 26, slice; 27, attribute; 28, argument_list; 29, identifier:isinstance; 30, argument_list; 31, tuple; 32, for_in_clause; 33, identifier:sorted_list; 34, identifier:sort; 35, identifier:unsorted_list; 36, identifier:extend; 37, list_comprehension; 38, identifier:unsorted_list; 39, identifier:list; 40, call; 41, identifier:i; 42, identifier:i; 43, identifier:unsorted_list; 44, subscript; 45, for_in_clause; 46, attribute; 47, argument_list; 48, identifier:i; 49, integer:1; 50, identifier:i; 51, identifier:sorted_list; 52, identifier:i; 53, identifier:get; 54, string; 55, string_content:@id
code: def _inplace_sort_by_id(unsorted_list):
      """Takes a list of dicts each of which has an '@id' key,
      sorts the elements in the list by the value of the @id key.
      Assumes that @id is unique or the dicts have a meaningul < operator
      """
      if not isinstance(unsorted_list, list):
          return
      sorted_list = [(i.get('@id'), i) for i in unsorted_list]
      sorted_list.sort()
      del unsorted_list[:]
      unsorted_list.extend([i[1] for i in sorted_list])