code: def _largest_integer_by_dtype(dt):
      """Helper returning the largest integer exactly representable by dtype."""
      if not _is_known_dtype(dt):
          raise TypeError(
              "Unrecognized dtype: {}".format(dtype_util.name(dt))
          )
      if dtype_util.is_floating(dt):
          return int(
              2 ** (np.finfo(dtype_util.as_numpy_dtype(dt)).nmant + 1)
          )
      if dtype_util.is_integer(dt):
          return np.iinfo(dtype_util.as_numpy_dtype(dt)).max
      if dtype_util.base_dtype(dt) == tf.bool:
          return int(1)
      # We actually can't land here but keep the case for completeness.
      raise TypeError(
          "Unrecognized dtype: {}".format(dtype_util.name(dt))
      )
  
imports: import functools
  import hashlib
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 24 for calling a global function with example usage: _largest_integer_by_dtype(dt) and returns: int, np, int