code: def _reducer_output_dtype(
      name: str, input_dtype: np.dtype, promote_integers: bool = True
  ) -> np.dtype:
      if name in ["sum", "prod", "nansum", "nanprod"]:
          if input_dtype == bool:
              input_dtype = dtypes.to_numeric_dtype(input_dtype)
          if promote_integers:
              if dtypes.issubdtype(input_dtype, np.integer):
                  default_int = dtypes.canonicalize_dtype(
                      dtypes.uint
                      if dtypes.issubdtype(
                          input_dtype, np.unsignedinteger
                      )
                      else dtypes.int_
                  )
                  if (
                      np.iinfo(input_dtype).bits
                      < np.iinfo(default_int).bits
                  ):
                      return default_int
      return input_dtype
  
imports: import collections
  from functools import partial
  import itertools
  import unittest
  from absl.testing import absltest
  from absl.testing import parameterized
  import numpy
  import jax
  from jax import numpy
  from jax._src import config
  from jax._src import dtypes
  from jax._src import test_util
  from jax._src.util import NumpyComplexWarning
label_desc: Use image node_id 6 for calling a global function with example usage: _reducer_output_dtype(name, input_dtype, promote_integers) and returns: input_dtype, default_int