code: def _check_kernel_size(
      kernel_size: tuple[int, ...] | int,
      min_value: int = 0,
      allow_even: bool = False,
  ) -> None:
      if isinstance(kernel_size, int):
          kernel_size = (kernel_size,)
  
      fmt = "even or odd" if allow_even else "odd"
      for size in kernel_size:
          KORNIA_CHECK(
              isinstance(size, int)
              and (
                  ((size % 2 == 1) or allow_even) and size > min_value
              ),
              f"Kernel size must be an {fmt} integer bigger than {min_value}. Gotcha {size} on {kernel_size}",
          )
  
imports: from __future__ import annotations
  import math
  from math import sqrt
  from typing import Any, Optional
  import torch
  from kornia.core import Device, Dtype, Tensor, concatenate, cos, stack, tensor, where, zeros, zeros_like
  from kornia.core.check import KORNIA_CHECK, KORNIA_CHECK_IS_TENSOR, KORNIA_CHECK_SHAPE
  from kornia.utils import deprecated
label_desc: Use image node_id 1 for calling a global function with example usage: _check_kernel_size(kernel_size, min_value, allow_even) without return types