"""simple docstring"""




from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: float    ,_lowerCamelCase		: float    ,_lowerCamelCase		: bool = False			) ->   list[float]:
  if radian_mode:
    return [magnitude * cos(_lowerCamelCase			), magnitude * sin(_lowerCamelCase			)]
  return [magnitude * cos(radians(_lowerCamelCase			)			), magnitude * sin(radians(_lowerCamelCase			)			)]





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: NDArray[floataa]    ,_lowerCamelCase		: NDArray[floataa]    ,_lowerCamelCase		: float = 10**-1			) ->   bool:
  _lowerCAmelCase		: NDArray[floataa]						    =  cross(_lowerCamelCase    ,_lowerCamelCase			)
  _lowerCAmelCase		: float						    =  sum(_lowerCamelCase			)
  return abs(_lowerCamelCase			) < eps


if __name__ == "__main__":
     # Test to check if it works
     _a   :	Any 					=     array(
         [
             polar_force(7_18.4, 180 - 30),
             polar_force(8_79.54, 45),
             polar_force(100, -90),
         ]
     )

     _a   :	NDArray[floataa] 					=     array([[0, 0], [0, 0], [0, 0]])

     assert in_static_equilibrium(forces, location)

     # Problem 1 in image_data/2D_problems.jpg
     _a   :	List[str] 					=     array(
         [
             polar_force(30 * 9.81, 15),
             polar_force(215, 180 - 45),
             polar_force(264, 90 - 30),
         ]
     )

     _a   :	str 					=     array([[0, 0], [0, 0], [0, 0]])

     assert in_static_equilibrium(forces, location)

     # Problem in image_data/2D_problems_1.jpg
     _a   :	Tuple 					=     array([[0, -2_000], [0, -1_200], [0, 15_600], [0, -12_400]])

     _a   :	Any 					=     array([[0, 0], [6, 0], [10, 0], [12, 0]])

     assert in_static_equilibrium(forces, location)

     import doctest

     doctest.testmod()





"""simple docstring"""




from PIL import Image





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: Image    ,_lowerCamelCase		: int			) ->   Image:
  _lowerCAmelCase		: Any						    =  (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
          _a   :	str 					=     change_contrast(img, 170)
          cont_img.save('image_data/lena_high_contrast.png', format='png')




