code: def in_dtype_range(value, dtype):
      """Test if the value is within the dtype's range of values, Nan, or Inf."""
      # The name of this function is a misnomer. What we're actually
      # testing is whether the value can be represented by the data type.
      kind = numpy.dtype(dtype).kind
  
      # Nan and infinity are special cases.
      if kind == "f" and (numpy.isnan(value) or numpy.isinf(value)):
          return True
  
      info = dtype_info_registry[kind](dtype)
      return info.min <= value <= info.max
  
file_path: rasterio/rasterio/dtypes.py
imports: import numpy
  from rasterio.env import GDALVersion
label_desc: Use image node_id 2 for calling a global function with example usage: in_dtype_range(value, dtype) and returns: unknown, True