
import math




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			float						,  _lowerCamelCase :			float)					->    float:






							'''simple docstring'''





							if (
							    not isinstance(_lowerCamelCase						,  (int, float))
							    or power_factor < -1
							    or power_factor > 1
							):
														raise ValueError("power_factor must be a valid float value between -1 and 1.")
							return apparent_power * power_factor




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			float						,  _lowerCamelCase :			float)					->    float:






							'''simple docstring'''





							if (
							    not isinstance(_lowerCamelCase						,  (int, float))
							    or power_factor < -1
							    or power_factor > 1
							):
														raise ValueError("power_factor must be a valid float value between -1 and 1.")
							return apparent_power * math.sqrt(1 - power_factor**2)


if __name__ == "__main__":
		import doctest

		doctest.testmod()

from PIL import Image




def 	_SCREAMING_SNAKE_CASE					(		_lowerCamelCase :			Image						,  _lowerCamelCase :			int)					->    Image:






							'''simple docstring'''





							__UpperCamelCase	:   str			   =					(259 * (level + 255)) / (255 * (259 - level))

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

							return img.point(_lowerCamelCase)


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