






from PIL import Image

def     snake_case   (UpperCAmelCase__      ,       UpperCAmelCase__    )			->							Image:
  UpperCamelCase_:   Union[str, Any]        =							(2_5_9 * (level + 2_5_5)) / (2_5_5 * (2_5_9 - level))

  def contrast(UpperCAmelCase__    ) -> int:
    return int(1_2_8 + factor * (c - 1_2_8)    )

  return img.point(UpperCAmelCase__    )


if __name__ == "__main__":
   # Load image
   with Image.open('image_data/lena.jpg') as img:
      # Change contrast to 170
      A_						:						List[Any]						      =					change_contrast(img, 170)
      cont_img.save('image_data/lena_high_contrast.png', format='png')
import numpy as np






def     lowerCAmelCase_			(   _SCREAMING_SNAKE_CASE     :				np.array			):
						return (2 / (1 + np.exp(-2 * vector			))) - 1


if __name__ == "__main__":
	import doctest

	doctest.testmod()






