code: def make_combine(
      bases, dshapes, temps, combine_temps, antialias, cuda, partitioned
  ):
      # Lookup of base Reduction to argument index.
      arg_lk = dict((k, v) for (v, k) in enumerate(bases))
      # Also need lookup of by.reduction as the contained reduction is not aware of its wrapper.
      arg_lk.update(
          dict(
              (k.reduction, v)
              for (v, k) in enumerate(bases)
              if isinstance(k, by)
          )
      )
  
      # where._combine() deals with combine of preceding reduction so exclude
      # it from explicit combine calls.
      base_is_where = [b.is_where() for b in bases]
      next_base_is_where = base_is_where[1:] + [False]
      calls = [
          (
              None
              if n
              else b._build_combine(d, antialias, cuda, partitioned),
              [arg_lk[i] for i in (b,) + t + ct],
          )
          for (b, d, t, ct, n) in zip(
              bases, dshapes, temps, combine_temps, next_base_is_where
          )
      ]
  
      def combine(base_tuples):
          bases = tuple(np.stack(bs) for bs in zip(*base_tuples))
          ret = []
          for is_where, (func, inds) in zip(base_is_where, calls):
              if func is None:
                  continue
              call = func(*get(inds, bases))
              if is_where:
                  # Separate aggs of where reduction and its selector,
                  # selector's goes first to match order of bases.
                  ret.extend(call[::-1])
              else:
                  ret.append(call)
          return tuple(ret)
  
      return combine
  
imports: from __future__ import annotations
  from itertools import count
  import logging
  from typing import TYPE_CHECKING
  from toolz import unique, concat, pluck, get, memoize
  from numba import literal_unroll
  import numpy
  import xarray
  from .antialias import AntialiasCombination
  from .reductions import SpecialColumn, UsesCudaMutex, by, category_codes, summary
  from .utils import isnull, ngjit, nanmax_in_place, nanmin_in_place, nansum_in_place, nanfirst_in_place, nanlast_in_place, nanmax_n_in_place_3d, nanmax_n_in_place_4d, nanmin_n_in_place_3d, nanmin_n_in_place_4d, nanfirst_n_in_place_3d, nanfirst_n_in_place_4d, nanlast_n_in_place_3d, nanlast_n_in_place_4d, row_min_in_place, row_min_n_in_place_3d, row_min_n_in_place_4d, row_max_in_place, row_max_n_in_place_3d, row_max_n_in_place_4d
label_desc: Use image node_id 9 for calling a global function with example usage: make_combine(bases, dshapes, temps, combine_temps, antialias, cuda, partitioned) and returns: combine, tuple