code: def tree_op_estimate_size(ctx, op):
      chunk = op.outputs[0]
      if not chunk.is_sparse():
          max_inputs = max(ctx[inp.key][0] for inp in op.inputs)
          calc_size = chunk_size = chunk.nbytes
          if np.isnan(calc_size):
              chunk_size = calc_size = max_inputs
      else:
          sum_inputs = sum(ctx[inp.key][0] for inp in op.inputs)
          calc_size = sum_inputs
          chunk_size = min(
              sum_inputs,
              chunk.nbytes
              + np.dtype(np.int64).itemsize
              * np.prod(chunk.shape)
              * chunk.ndim,
          )
          if np.isnan(chunk_size):
              chunk_size = sum_inputs
      ctx[chunk.key] = (chunk_size, calc_size)
  
imports: import numpy
  from ...utils import TreeReductionBuilder
label_desc: Use image node_id 3 for calling a global function with example usage: tree_op_estimate_size(ctx, op) without return types