code: def _safe_accumulator_op(op, x, *args, **kwargs):
      """
      This function provides numpy accumulator functions with a float64 dtype
      when used on a floating point input. This prevents accumulator overflow on
      smaller floating point dtypes.
  
      Parameters
      ----------
      op : function
          A numpy accumulator function such as np.mean or np.sum
      x : numpy array
          A numpy array to apply the accumulator function
      *args : positional arguments
          Positional arguments passed to the accumulator function after the
          input x
      **kwargs : keyword arguments
          Keyword arguments passed to the accumulator function
  
      Returns
      -------
      result : The output of the accumulator function passed to this function
      """
      if np.issubdtype(x.dtype, np.floating) and x.dtype.itemsize < 8:
          result = op(x, *args, **kwargs, dtype=np.float64)
      else:
          result = op(x, *args, **kwargs)
      return result
  
imports: from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 3 for calling a global function with example usage: _safe_accumulator_op(op, x) and returns: result