def _get_cythonized_result(self, how, grouper, aggregate=False,<EOL>cython_dtype=None, needs_values=False,<EOL>needs_mask=False, needs_ngroups=False,<EOL>result_is_index=False,<EOL>pre_processing=None, post_processing=None,<EOL>**kwargs):
if result_is_index and aggregate:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>if post_processing:<EOL><INDENT>if not callable(pre_processing):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT><DEDENT>if pre_processing:<EOL><INDENT>if not callable(pre_processing):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if not needs_values:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT>labels, _, ngroups = grouper.group_info<EOL>output = collections.OrderedDict()<EOL>base_func = getattr(libgroupby, how)<EOL>for name, obj in self._iterate_slices():<EOL><INDENT>if aggregate:<EOL><INDENT>result_sz = ngroups<EOL><DEDENT>else:<EOL><INDENT>result_sz = len(obj.values)<EOL><DEDENT>if not cython_dtype:<EOL><INDENT>cython_dtype = obj.values.dtype<EOL><DEDENT>result = np.zeros(result_sz, dtype=cython_dtype)<EOL>func = partial(base_func, result, labels)<EOL>inferences = None<EOL>if needs_values:<EOL><INDENT>vals = obj.values<EOL>if pre_processing:<EOL><INDENT>vals, inferences = pre_processing(vals)<EOL><DEDENT>func = partial(func, vals)<EOL><DEDENT>if needs_mask:<EOL><INDENT>mask = isna(obj.values).view(np.uint8)<EOL>func = partial(func, mask)<EOL><DEDENT>if needs_ngroups:<EOL><INDENT>func = partial(func, ngroups)<EOL><DEDENT>func(**kwargs)  <EOL>if result_is_index:<EOL><INDENT>result = algorithms.take_nd(obj.values, result)<EOL><DEDENT>if post_processing:<EOL><INDENT>result = post_processing(result, inferences)<EOL><DEDENT>output[name] = result<EOL><DEDENT>if aggregate:<EOL><INDENT>return self._wrap_aggregated_output(output)<EOL><DEDENT>else:<EOL><INDENT>return self._wrap_transformed_output(output)<EOL><DEDENT>
Get result for Cythonized functions.

Parameters
----------
how : str, Cythonized function name to be called
grouper : Grouper object containing pertinent group info
aggregate : bool, default False
    Whether the result should be aggregated to match the number of
    groups
cython_dtype : default None
    Type of the array that will be modified by the Cython call. If
    `None`, the type will be inferred from the values of each slice
needs_values : bool, default False
    Whether the values should be a part of the Cython call
    signature
needs_mask : bool, default False
    Whether boolean mask needs to be part of the Cython call
    signature
needs_ngroups : bool, default False
    Whether number of groups is part of the Cython call signature
result_is_index : bool, default False
    Whether the result of the Cython operation is an index of
    values to be retrieved, instead of the actual values themselves
pre_processing : function, default None
    Function to be applied to `values` prior to passing to Cython.
    Function should return a tuple where the first element is the
    values to be passed to Cython and the second element is an optional
    type which the values should be converted to after being returned
    by the Cython operation. Raises if `needs_values` is False.
post_processing : function, default None
    Function to be applied to result of Cython function. Should accept
    an array of values as the first argument and type inferences as its
    second argument, i.e. the signature should be
    (ndarray, Type).
**kwargs : dict
    Extra arguments to be passed back to Cython funcs

Returns
-------
`Series` or `DataFrame`  with filled values