code: def gaussian(
      window_size: int,
      sigma: Tensor | float,
      *,
      device: Optional[Device] = None,
      dtype: Optional[Dtype] = None,
  ) -> Tensor:
      """Compute the gaussian values based on the window and sigma values.
  
      Args:
          window_size: the size which drives the filter amount.
          sigma: gaussian standard deviation. If a tensor, should be in a shape :math:`(B, 1)`
          device: This value will be used if sigma is a float. Device desired to compute.
          dtype: This value will be used if sigma is a float. Dtype desired for compute.
      Returns:
          A tensor withshape :math:`(B, \text{kernel_size})`, with Gaussian values.
      """
  
      if isinstance(sigma, float):
          sigma = tensor([[sigma]], device=device, dtype=dtype)
  
      KORNIA_CHECK_IS_TENSOR(sigma)
      KORNIA_CHECK_SHAPE(sigma, ["B", "1"])
      batch_size = sigma.shape[0]
  
      x = (
          torch.arange(
              window_size, device=sigma.device, dtype=sigma.dtype
          )
          - window_size // 2
      ).expand(batch_size, -1)
  
      if window_size % 2 == 0:
          x = x + 0.5
  
      gauss = torch.exp(-x.pow(2.0) / (2 * sigma.pow(2.0)))
  
      return gauss / gauss.sum(-1, keepdim=True)
  
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 5 for calling a global function with example usage: gaussian(window_size, sigma) and returns: unknown