parameters: (
          self,
          how: str,
          cython_dtype: np.dtype,
          aggregate: bool = False,
          needs_values: bool = False,
          needs_mask: bool = False,
          needs_ngroups: bool = False,
          result_is_index: bool = False,
          pre_processing=None,
          post_processing=None,
          **kwargs,
      )
docstring: Get result for Cythonized functions.
  
          Parameters
          ----------
          how : str, Cythonized function name to be called
          cython_dtype : np.dtype
              Type of the array that will be modified by the Cython call.
          aggregate : bool, default False
              Whether the result should be aggregated to match the number of
              groups
          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
docstring_summary: Get result for Cythonized functions.
docstring_tokens: Get result for Cythonized functions .
function: def _get_cythonized_result(
          self,
          how: str,
          cython_dtype: np.dtype,
          aggregate: bool = False,
          needs_values: bool = False,
          needs_mask: bool = False,
          needs_ngroups: bool = False,
          result_is_index: bool = False,
          pre_processing=None,
          post_processing=None,
          **kwargs,
      ):
          """
          Get result for Cythonized functions.
  
          Parameters
          ----------
          how : str, Cythonized function name to be called
          cython_dtype : np.dtype
              Type of the array that will be modified by the Cython call.
          aggregate : bool, default False
              Whether the result should be aggregated to match the number of
              groups
          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
          """
          if result_is_index and aggregate:
              raise ValueError("'result_is_index' and 'aggregate' cannot both be True!")
          if post_processing:
              if not callable(pre_processing):
                  raise ValueError("'post_processing' must be a callable!")
          if pre_processing:
              if not callable(pre_processing):
                  raise ValueError("'pre_processing' must be a callable!")
              if not needs_values:
                  raise ValueError(
                      "Cannot use 'pre_processing' without specifying 'needs_values'!"
                  )
  
          grouper = self.grouper
  
          labels, _, ngroups = grouper.group_info
          output: Dict[base.OutputKey, np.ndarray] = {}
          base_func = getattr(libgroupby, how)
  
          for idx, obj in enumerate(self._iterate_slices()):
              name = obj.name
              values = obj._data._values
  
              if aggregate:
                  result_sz = ngroups
              else:
                  result_sz = len(values)
  
              result = np.zeros(result_sz, dtype=cython_dtype)
              func = partial(base_func, result, labels)
              inferences = None
  
              if needs_values:
                  vals = values
                  if pre_processing:
                      vals, inferences = pre_processing(vals)
                  func = partial(func, vals)
  
              if needs_mask:
                  mask = isna(values).view(np.uint8)
                  func = partial(func, mask)
  
              if needs_ngroups:
                  func = partial(func, ngroups)
  
              func(**kwargs)  # Call func to modify indexer values in place
  
              if result_is_index:
                  result = algorithms.take_nd(values, result)
  
              if post_processing:
                  result = post_processing(result, inferences)
  
              key = base.OutputKey(label=name, position=idx)
              output[key] = result
  
          if aggregate:
              return self._wrap_aggregated_output(output)
          else:
              return self._wrap_transformed_output(output)
function_tokens: def _get_cythonized_result ( self , how : str , cython_dtype : np . dtype , aggregate : bool = False , needs_values : bool = False , needs_mask : bool = False , needs_ngroups : bool = False , result_is_index : bool = False , pre_processing = None , post_processing = None , * * kwargs , ) : if result_is_index and aggregate : raise ValueError ( "'result_is_index' and 'aggregate' cannot both be True!" ) if post_processing : if not callable ( pre_processing ) : raise ValueError ( "'post_processing' must be a callable!" ) if pre_processing : if not callable ( pre_processing ) : raise ValueError ( "'pre_processing' must be a callable!" ) if not needs_values : raise ValueError ( "Cannot use 'pre_processing' without specifying 'needs_values'!" ) grouper = self . grouper labels , _ , ngroups = grouper . group_info output : Dict [ base . OutputKey , np . ndarray ] = { } base_func = getattr ( libgroupby , how ) for idx , obj in enumerate ( self . _iterate_slices ( ) ) : name = obj . name values = obj . _data . _values if aggregate : result_sz = ngroups else : result_sz = len ( values ) result = np . zeros ( result_sz , dtype = cython_dtype ) func = partial ( base_func , result , labels ) inferences = None if needs_values : vals = values if pre_processing : vals , inferences = pre_processing ( vals ) func = partial ( func , vals ) if needs_mask : mask = isna ( values ) . view ( np . uint8 ) func = partial ( func , mask ) if needs_ngroups : func = partial ( func , ngroups ) func ( * * kwargs ) # Call func to modify indexer values in place if result_is_index : result = algorithms . take_nd ( values , result ) if post_processing : result = post_processing ( result , inferences ) key = base . OutputKey ( label = name , position = idx ) output [ key ] = result if aggregate : return self . _wrap_aggregated_output ( output ) else : return self . _wrap_transformed_output ( output )