code: def _agg_choices(ctx, indexer, choices, regenerated_ids, partition):
      """
      indexer: (sample_id, (partition_id, block_offset))
      """
      choice_dict = dict()
      choice_indexer = []
      for idx, choice in enumerate(choices):
          if choice not in choice_dict:
              current_l = len(choice_dict)
              choice_dict[choice] = current_l
              choice_indexer.append([])
  
          choice_indexer[choice_dict[choice]].append(
              regenerated_ids[idx]
          )
  
      for choice, idx in choice_dict.items():
          choice_regenerated_sample_ids = choice_indexer[idx]
          choice_indexer[idx] = (
              indexer[choice][0],
              choice_regenerated_sample_ids,
          )
  
      return ctx.computing.parallelize(
          choice_indexer, include_key=True, partition=partition
      )
  
file_path: FATE/python/fate/arch/dataframe/utils/_sample.py
imports: import functools
  from typing import Union, Dict, Any
  from sklearn.utils import resample
  from ._id_generator import generate_sample_id, generate_sample_id_prefix
  from .._dataframe import DataFrame
label_desc: Use image node_id 7 for calling a global function with example usage: _agg_choices(ctx, indexer, choices, regenerated_ids, partition) and returns: ctx