





'''simple docstring'''
import unittest
from timeit import timeit
def     lowercase__       (       __lowercase						:  int    ,  __lowercase						:  int					)			->				Dict:



							"""simple docstring"""






							__UpperCamelCase	=  first_num if first_num >= second_num else second_num
							__UpperCamelCase	=  max_num
							while (common_mult % first_num > 0) or (common_mult % second_num > 0):
														common_mult += max_num
							return common_mult
def     lowercase__       (       __lowercase						:  int    ,  __lowercase						:  int					)			->				List[str]:



							"""simple docstring"""






							return b if a == 0 else greatest_common_divisor(b % a    ,  _A					)
def     lowercase__       (       __lowercase						:  int    ,  __lowercase						:  int					)			->				Dict:



							"""simple docstring"""






							return first_num // greatest_common_divisor(_A    ,  _A					) * second_num
def     lowercase__       (       )			->				Dict:



							"""simple docstring"""






							__UpperCamelCase	=  (
							    'from __main__ import least_common_multiple_slow, least_common_multiple_fast'
							)
							print(
							    'least_common_multiple_slow():'    ,  timeit('least_common_multiple_slow(1000, 999)'    ,  setup=_A					)    ,  )
							print(
							    'least_common_multiple_fast():'    ,  timeit('least_common_multiple_fast(1000, 999)'    ,  setup=_A					)    ,  )

class 					snake_case					(   unittest.TestCase	):




	"""simple docstring"""



	SCREAMING_SNAKE_CASE_     : List[str]      		=(
	    (10, 20),
	    (13, 15),
	    (4, 31),
	    (10, 42),
	    (43, 34),
	    (5, 12),
	    (12, 25),
	    (10, 25),
	    (6, 9),
	)
	SCREAMING_SNAKE_CASE_     : Optional[Any]      		=(20, 195, 124, 210, 1462, 60, 300, 50, 18)






	def 	_lowerCamelCase (	self	:							Dict     ):






								for i, (first_num, second_num) in enumerate(self.test_inputs     ):
															__UpperCamelCase	=  least_common_multiple_slow(lowercase_							,     lowercase_     )
															__UpperCamelCase	=  least_common_multiple_fast(lowercase_							,     lowercase_     )
															with self.subTest(i=lowercase_     ):
																						self.assertEqual(lowercase_							,     self.expected_results[i]     )
																						self.assertEqual(lowercase_							,     self.expected_results[i]     )


if __name__ == "__main__":
				benchmark()
				unittest.main()







'''simple docstring'''
import numpy as np
from PIL import Image
def     lowercase__       (       __lowercase						:  np.array					)			->				np.array:



       """simple docstring"""






       __UpperCamelCase	,						__UpperCamelCase	,						__UpperCamelCase	=  rgb[:, :, 0], rgb[:, :, 1], rgb[:, :, 2]
       return 0.2_9_8_9 * r + 0.5_8_7_0 * g + 0.1_1_4_0 * b
def     lowercase__       (       __lowercase						:  np.array					)			->				np.array:



       """simple docstring"""






       return (gray > 127) & (gray <= 255)
def     lowercase__       (       __lowercase						:  np.array    ,  __lowercase						:  np.array					)			->				np.array:



       """simple docstring"""






       __UpperCamelCase	=  np.zeros_like(__lowercase					)
       __UpperCamelCase	=  np.zeros(
           (image.shape[0] + kernel.shape[0] - 1, image.shape[1] + kernel.shape[1] - 1)					)

       # Copy image to padded image
       __UpperCamelCase	=  image

       # Iterate over image & apply kernel
       for x in range(image.shape[1]					):
              for y in range(image.shape[0]					):
                     __UpperCamelCase	=  (
                         kernel * image_padded[y : y + kernel.shape[0], x : x + kernel.shape[1]]
                     ).sum()
                     __UpperCamelCase	=  int(summation == 5					)
       return output


# kernel to be applied
a__							:							Dict			=np.array([[0, 1, 0], [1, 1, 1], [0, 1, 0]])

if __name__ == "__main__":
    # read original image
    a__							:							Any			=np.array(Image.open(r'''..\image_data\lena.jpg'''))
    # Apply erosion operation to a binary image
    a__							:							Union[str, Any]			=erosion(grayabinary(rgbagray(image)), structuring_element)
    # Save the output image
    a__							:							Tuple			=Image.fromarray(output).convert('''RGB''')
    pil_img.save('''result_erosion.png''')
