


'''simple docstring'''


from __future__ import annotations

from math import pow, sqrt







def 			snake_case_   (  SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__							,      SCREAMING_SNAKE_CASE__     ):







				"""simple docstring"""





				if (resistance, reactance, impedance).count(0     ) != 1:
								raise ValueError("""One and only one argument must be 0"""     )
				if resistance == 0:
								return {"resistance": sqrt(pow(UpperCamelCase__							,      2     ) - pow(UpperCamelCase__							,      2     )     )}
				elif reactance == 0:
								return {"reactance": sqrt(pow(UpperCamelCase__							,      2     ) - pow(UpperCamelCase__							,      2     )     )}
				elif impedance == 0:
								return {"impedance": sqrt(pow(UpperCamelCase__							,      2     ) + pow(UpperCamelCase__							,      2     )     )}
				else:
								raise ValueError("""Exactly one argument must be 0"""     )


if __name__ == "__main__":
				import doctest

				doctest.testmod()







from PIL import Image





def 					__lowerCamelCase	( UpperCamelCase__   ,							UpperCamelCase__      ):







							'''simple docstring'''






							snake_case_							=    (259 * (level + 255)) / (255 * (259 - level))

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

							return img.point(UpperCamelCase__      )


if __name__ == "__main__":
					# Load image
					with Image.open("""image_data/lena.jpg""") as img:
										# Change contrast to 170
										_UpperCAmelCase		:   Tuple										=       change_contrast(img, 170)
										cont_img.save("""image_data/lena_high_contrast.png""", format="""png""")




