code: def _get_kernel_size(sigma: float) -> int:
      ksize = int(2.0 * 4.0 * sigma + 1.0)
  
      #  matches OpenCV, but may cause padding problem for small images
      #  PyTorch does not allow to pad more than original size.
      #  Therefore there is a hack in forward function
  
      if ksize % 2 == 0:
          ksize += 1
      return ksize
  
imports: from typing import Optional, Union
  import torch
  from kornia.core import Module, Tensor, tensor
  from kornia.core.check import KORNIA_CHECK_SHAPE
  from kornia.filters import gaussian_blur2d, spatial_gradient
label_desc: Use image node_id 1 for calling a global function with example usage: _get_kernel_size(sigma) and returns: ksize