
'''simple docstring'''







_lowercase			:  dict[str, float]   							=	{
    "km/h": 1.0,
    "m/s": 3.6,
    "mph": 1.6_0_9_3_4_4,
    "knot": 1.8_5_2,
}

_lowercase			:  dict[str, float]   							=	{
    "km/h": 1.0,
    "m/s": 0.2_7_7_7_7_7_7_7_8,
    "mph": 0.6_2_1_3_7_1_1_9_2,
    "knot": 0.5_3_9_9_5_6_8_0_3,
}
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			float				,				__SCREAMING_SNAKE_CASE :			str				,				__SCREAMING_SNAKE_CASE :			str							):



						"""simple docstring"""





						if unit_to not in speed_chart or unit_from not in speed_chart_inverse:
												lowercase_     :					Optional[Any]													=	(
												    F'''Incorrect \'from_type\' or \'to_type\' value: {unit_from!r}, {unit_to!r}\n'''
												    F'''Valid values are: {', '.join(__SCREAMING_SNAKE_CASE							)}'''
												)
												raise ValueError(__SCREAMING_SNAKE_CASE							)
						return round(speed * speed_chart[unit_from] * speed_chart_inverse[unit_to]				,				3							)


if __name__ == "__main__":
						import doctest

						doctest.testmod()





'''simple docstring'''







from PIL import Image
def  snake_case_		(    __SCREAMING_SNAKE_CASE :			Image				,				__SCREAMING_SNAKE_CASE :			int							):



						"""simple docstring"""





						lowercase_     :					Optional[int]													=	(259 * (level + 255)) / (255 * (259 - level))

						def contrast(__SCREAMING_SNAKE_CASE :			int							) -> int:
												return int(128 + factor * (c - 128)							)

						return img.point(__SCREAMING_SNAKE_CASE							)


if __name__ == "__main__":
							# Load image
							with Image.open("image_data/lena.jpg") as img:
														# Change contrast to 170
														_lowercase			:  Union[str, Any]   							=	change_contrast(img, 1_7_0)
														cont_img.save("image_data/lena_high_contrast.png", format="png")



