code: def KORNIA_CHECK_IS_IMAGE(
      x: Tensor,
      msg: Optional[str] = None,
      raises: bool = True,
      bits: int = 8,
  ) -> bool:
      """Check whether an image tensor is ranged properly [0, 1] for float or [0, 2 ** bits] for int.
  
      Args:
          x: image tensor to evaluate.
          msg: message to show in the exception.
          raises: bool indicating whether an exception should be raised upon failure.
          bits: the image bits. The default checks if given integer input image is an
              8-bit image (0-255) or not.
  
      Raises:
          TypeException: if all the input tensor has not 1) a shape :math:`(3,H,W)`,
          2) [0, 1] for float or [0, 255] for int, 3) and raises is True.
  
      Example:
          >>> img = torch.rand(2, 3, 4, 4)
          >>> KORNIA_CHECK_IS_IMAGE(img, "It is not an image")
          True
      """
      res = KORNIA_CHECK_IS_COLOR_OR_GRAY(x, msg, raises=raises)
  
      if not raises and not res:
          return False
  
      err_msg = f"Invalid image value range. Expect [0, 1] but got [{x.min()}, {x.max()}]."
      if msg is not None:
          err_msg += f"\n{msg}"
  
      if x.dtype in [float16, float32, float64] and (
          x.min() < 0.0 or x.max() > 1.0
      ):
          if raises:
              raise ValueError(err_msg)
          return False
      elif x.min() < 0 or x.max() > 2**bits - 1:
          if raises:
              raise ValueError(err_msg)
          return False
      return True
  
imports: from __future__ import annotations
  from typing import Any, Optional, Sequence, TypeVar, cast
  from torch import float16, float32, float64
  from typing_extensions import TypeGuard
  from kornia.core import Tensor
label_desc: Use image node_id 13 for calling a global function with example usage: KORNIA_CHECK_IS_IMAGE(x, msg, raises, bits) and returns: True, False, False, False