


from __future__ import annotations


def      a	(							SCREAMING_SNAKE_CASE_      :		list[int]       ):






       """simple docstring"""





       if len(SCREAMING_SNAKE_CASE_       ) == 0:
              return array

       UpperCamelCase	, UpperCamelCase    :	Union[str, Any]   	=		min(SCREAMING_SNAKE_CASE_       ), max(SCREAMING_SNAKE_CASE_       )

       # Compute the variables
       UpperCamelCase    :	Union[str, Any]   	=		_max - _min + 1
       UpperCamelCase	, UpperCamelCase    :	Optional[Any]   	=		[0] * holes_range, [0] * holes_range

       # Make the sorting.
       for i in array:
              UpperCamelCase    :	Optional[int]   	=		i - _min
              UpperCamelCase    :	Any   	=		i
              holes_repeat[index] += 1

       # Makes the array back by replacing the numbers.
       UpperCamelCase    :	str   	=		0
       for i in range(SCREAMING_SNAKE_CASE_       ):
              while holes_repeat[i] > 0:
                     UpperCamelCase    :	List[Any]   	=		holes[i]
                     index += 1
                     holes_repeat[i] -= 1

    # Returns the sorted array.
       return array


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  __UpperCAmelCase : Any 			=				input("Enter numbers separated by comma:\n")
  __UpperCAmelCase : int 			=				[int(x) for x in user_input.split(",")]
  print(pigeon_sort(unsorted))





from itertools import product

from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import dot, exp, mgrid, pi, ravel, square, uinta, zeros


def      a	(							SCREAMING_SNAKE_CASE_      :		List[Any]							,			SCREAMING_SNAKE_CASE_      :		List[str]       ):






       """simple docstring"""





       UpperCamelCase    :	List[str]   	=		k_size // 2
       UpperCamelCase	, UpperCamelCase    :	Optional[int]   	=		mgrid[0 - center : k_size - center, 0 - center : k_size - center]
       UpperCamelCase    :	Dict   	=		1 / (2 * pi * sigma) * exp(-(square(SCREAMING_SNAKE_CASE_       ) + square(SCREAMING_SNAKE_CASE_       )) / (2 * square(SCREAMING_SNAKE_CASE_       ))       )
       return g


def      a	(							SCREAMING_SNAKE_CASE_      :		Dict							,			SCREAMING_SNAKE_CASE_      :		Optional[int]							,			SCREAMING_SNAKE_CASE_      :		int       ):






       """simple docstring"""





       UpperCamelCase	, UpperCamelCase    :	Tuple   	=		image.shape[0], image.shape[1]
       # dst image height and width
       UpperCamelCase    :	str   	=		height - k_size + 1
       UpperCamelCase    :	Optional[int]   	=		width - k_size + 1

       # im2col, turn the k_size*k_size pixels into a row and np.vstack all rows
       UpperCamelCase    :	List[Any]   	=		zeros((dst_height * dst_width, k_size * k_size)       )
       UpperCamelCase    :	Tuple   	=		0
       for i, j in product(range(SCREAMING_SNAKE_CASE_       )							,			range(SCREAMING_SNAKE_CASE_       )       ):
              UpperCamelCase    :	Dict   	=		ravel(image[i : i + k_size, j : j + k_size]       )
              UpperCamelCase    :	Dict   	=		window
              row += 1

       #  turn the kernel into shape(k*k, 1)
       UpperCamelCase    :	Optional[int]   	=		gen_gaussian_kernel(SCREAMING_SNAKE_CASE_							,			SCREAMING_SNAKE_CASE_       )
       UpperCamelCase    :	List[Any]   	=		ravel(SCREAMING_SNAKE_CASE_       )

       # reshape and get the dst image
       UpperCamelCase    :	Optional[int]   	=		dot(SCREAMING_SNAKE_CASE_							,			SCREAMING_SNAKE_CASE_       ).reshape(SCREAMING_SNAKE_CASE_							,			SCREAMING_SNAKE_CASE_       ).astype(SCREAMING_SNAKE_CASE_       )

       return dst


if __name__ == "__main__":
  # read original image
  __UpperCAmelCase : Union[str, Any] 			=				imread(r"../image_data/lena.jpg")
  # turn image in gray scale value
  __UpperCAmelCase : Optional[Any] 			=				cvtColor(img, COLOR_BGR2GRAY)

  # get values with two different mask size
  __UpperCAmelCase : Optional[int] 			=				gaussian_filter(gray, 3, sigma=1)
  __UpperCAmelCase : List[Any] 			=				gaussian_filter(gray, 5, sigma=0.8)

  # show result images
  imshow("gaussian filter with 3x3 mask", gaussianaxa)
  imshow("gaussian filter with 5x5 mask", gaussianaxa)
  waitKey()

