
'''simple docstring'''





a__		: dict[str, float]  							=							{
    "kilogram": 1,
    "gram": pow(1_0, 3),
    "milligram": pow(1_0, 6),
    "metric-ton": pow(1_0, -3),
    "long-ton": 0.0009842073,
    "short-ton": 0.0011023122,
    "pound": 2.2046244202,
    "stone": 0.1574731728,
    "ounce": 35.273990723,
    "carrat": 5_0_0_0,
    "atomic-mass-unit": 6.0_22_13_66_52E26,
}

a__		: dict[str, float]  							=							{
    "kilogram": 1,
    "gram": pow(1_0, -3),
    "milligram": pow(1_0, -6),
    "metric-ton": pow(1_0, 3),
    "long-ton": 1_0_1_6.0_4_6_0_8,
    "short-ton": 907.184,
    "pound": 0.453592,
    "stone": 6.35029,
    "ounce": 0.0283495,
    "carrat": 0.0002,
    "atomic-mass-unit": 1.6_60_54_01_99E-27,
}





def 							snake_case				(		UpperCAmelCase   ,	UpperCAmelCase   ,	UpperCAmelCase						)->      List[Any]:







      """simple docstring"""
      if to_type not in KILOGRAM_CHART or from_type not in WEIGHT_TYPE_CHART:
            __A													=      (
                f'Invalid \'from_type\' or \'to_type\' value: {from_type!r}, {to_type!r}\n'
                f'Supported values are: {", ".join(UpperCAmelCase_						)}'
            )
            raise ValueError(UpperCAmelCase_						)
      return value * KILOGRAM_CHART[to_type] * WEIGHT_TYPE_CHART[from_type]


if __name__ == "__main__":
 import doctest

 doctest.testmod()









"""simple docstring"""



from cva import COLOR_BGR2GRAY, cvtColor, imread, imshow, waitKey
from numpy import divide, inta, multiply, ravel, sort, zeros_like





def 			_snake_case  (     UpperCAmelCase_	:       Optional[int]       , UpperCAmelCase_	:       List[Any]=3      ):
     A__				      =	int(mask / 2      )
     # copy image size
     A__				      =	zeros_like(UpperCAmelCase_      )
     for i in range(UpperCAmelCase_       , gray_img.shape[0] - bd      ):
          for j in range(UpperCAmelCase_       , gray_img.shape[1] - bd      ):
               # get mask according with mask
               A__				      =	ravel(gray_img[i - bd : i + bd + 1, j - bd : j + bd + 1]      )
               # calculate mask median
               A__				      =	sort(UpperCAmelCase_      )[inta(divide((multiply(UpperCAmelCase_       , UpperCAmelCase_      ))       , 2      ) + 1      )]
               A__				      =	median
     return median_img


if __name__ == "__main__":
 # read original image
 SCREAMING_SNAKE_CASE_       :						int					=    imread('../image_data/lena.jpg')
 # turn image in gray scale value
 SCREAMING_SNAKE_CASE_       :						str					=    cvtColor(img, COLOR_BGR2GRAY)

 # get values with two different mask size
 SCREAMING_SNAKE_CASE_       :						List[Any]					=    median_filter(gray, 3)
 SCREAMING_SNAKE_CASE_       :						str					=    median_filter(gray, 5)

 # show result images
 imshow('median filter with 3x3 mask', medianaxa)
 imshow('median filter with 5x5 mask', medianaxa)
 waitKey(0)






