code: def _check_target_size(size):
      """
      Common check to enforce type and sanity check on size tuples
      Args:
          size: Should be a tuple of size 2 (width, height)
  
      Returns:
          Raises a ValueError if ``size`` doesn't satisfy the required conditions.
      """
  
      if not isinstance(size, (list, tuple)):
          raise ValueError(
              "`target_size` must be a tuple of length 2 `(width,height)`"
          )
      if len(size) != 2:
          raise ValueError(
              "`target_size` must be a tuple of length 2 `(width,height)`"
          )
      if size[0] < 0 or size[1] < 0:
          raise ValueError("Width and height must be >= 0")
  
      return True
  
file_path: caer/caer/_internal.py
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _check_target_size(size) and returns: True