nodes: 0, module; 1, function_definition; 2, function_name:_group_by_size_greedy; 3, parameters; 4, block; 5, identifier:obj_list; 6, identifier:tot_groups; 7, expression_statement; 8, expression_statement; 9, expression_statement; 10, for_statement; 11, return_statement; 12, comment:"""Partition a list of objects in even buckets
  
      The idea is to choose the bucket for an object in a round-robin fashion.
      The list of objects is sorted to also try to keep the total size in bytes
      as balanced as possible.
      :param obj_list: a list of dict-like objects with a 'size' property
      :param tot_groups: number of partitions to split the data into.
      :return: a list of lists, one for each partition.
      """; 13, assignment; 14, assignment; 15, pattern_list; 16, call; 17, block; 18, identifier:groups; 19, identifier:sorted_list; 20, call; 21, identifier:groups; 22, list_comprehension; 23, identifier:index; 24, identifier:obj; 25, identifier:enumerate; 26, argument_list; 27, expression_statement; 28, expression_statement; 29, identifier:sorted; 30, argument_list; 31, list; 32, for_in_clause; 33, identifier:sorted_list; 34, assignment; 35, call; 36, identifier:obj_list; 37, keyword_argument; 38, keyword_argument; 39, identifier:_; 40, call; 41, identifier:current_group; 42, subscript; 43, attribute; 44, argument_list; 45, identifier:key; 46, lambda; 47, identifier:reverse; 48, True; 49, identifier:range; 50, argument_list; 51, identifier:groups; 52, binary_operator:index % len(groups); 53, identifier:current_group; 54, identifier:append; 55, identifier:obj; 56, lambda_parameters; 57, subscript; 58, identifier:tot_groups; 59, identifier:index; 60, call; 61, identifier:x; 62, identifier:x; 63, string; 64, identifier:len; 65, argument_list; 66, string_content:size; 67, identifier:groups
code: def _group_by_size_greedy(obj_list, tot_groups):
      """Partition a list of objects in even buckets
  
      The idea is to choose the bucket for an object in a round-robin fashion.
      The list of objects is sorted to also try to keep the total size in bytes
      as balanced as possible.
      :param obj_list: a list of dict-like objects with a 'size' property
      :param tot_groups: number of partitions to split the data into.
      :return: a list of lists, one for each partition.
      """
      sorted_list = sorted(obj_list, key=lambda x: x['size'], reverse=True)
      groups = [[] for _ in range(tot_groups)]
      for index, obj in enumerate(sorted_list):
          current_group = groups[index % len(groups)]
          current_group.append(obj)
      return groups