def _build_agg_args(spec):
 known_np_funcs = {np.min: 'min', np.max: 'max'}
 chunks = {}
 aggs = {}
 finalizers = []
 for (result_column, func, input_column) in spec:
  func = funcname(known_np_funcs.get(func, func))
  impls = _build_agg_args_single(result_column, func, input_column)
  chunks.update(((spec[0], spec) for spec in impls['chunk_funcs']))
  aggs.update(((spec[0], spec) for spec in impls['aggregate_funcs']))
  finalizers.append(impls['finalizer'])
 chunks = sorted(chunks.values())
 aggs = sorted(aggs.values())
 return (chunks, aggs, finalizers)

def _build_agg_args ( spec ) : known_np_funcs = { np . min : 'min' , np . max : 'max' } chunks = { } aggs = { } finalizers = [ ] for ( result_column , func , input_column ) in spec : func = funcname ( known_np_funcs . get ( func , func ) ) impls = _build_agg_args_single ( result_column , func , input_column ) chunks . update ( ( ( spec [ 0 ] , spec ) for spec in impls [ 'chunk_funcs' ] ) ) aggs . update ( ( ( spec [ 0 ] , spec ) for spec in impls [ 'aggregate_funcs' ] ) ) finalizers . append ( impls [ 'finalizer' ] ) chunks = sorted ( chunks . values ( ) ) aggs = sorted ( aggs . values ( ) ) return ( chunks , aggs , finalizers )
create transformation functions for a normalized aggregate spec .