






'''simple docstring'''

from math import factorial, pi







def    lowercase__			(				__UpperCamelCase		,						__UpperCamelCase = 30   )->			Optional[Any]:

      if not isinstance(__SCREAMING_SNAKE_CASE		,						(int, float)   ):
            raise ValueError("""maclaurin_sin() requires either an int or float for theta"""   )

      if not isinstance(__SCREAMING_SNAKE_CASE		,						__SCREAMING_SNAKE_CASE   ) or accuracy <= 0:
            raise ValueError("""maclaurin_sin() requires a positive int for accuracy"""   )

      UpperCamelCase      = float(__SCREAMING_SNAKE_CASE   )
      UpperCamelCase      = theta // (2 * pi)
      theta -= 2 * div * pi
      return sum(
          (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1   ) for r in range(__SCREAMING_SNAKE_CASE   )   )







def    lowercase__			(				__UpperCamelCase		,						__UpperCamelCase = 30   )->			Any:

      if not isinstance(__SCREAMING_SNAKE_CASE		,						(int, float)   ):
            raise ValueError("""maclaurin_cos() requires either an int or float for theta"""   )

      if not isinstance(__SCREAMING_SNAKE_CASE		,						__SCREAMING_SNAKE_CASE   ) or accuracy <= 0:
            raise ValueError("""maclaurin_cos() requires a positive int for accuracy"""   )

      UpperCamelCase      = float(__SCREAMING_SNAKE_CASE   )
      UpperCamelCase      = theta // (2 * pi)
      theta -= 2 * div * pi
      return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r   ) for r in range(__SCREAMING_SNAKE_CASE   )   )


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   print(maclaurin_sin(1_0))
   print(maclaurin_sin(-1_0))
   print(maclaurin_sin(1_0, 1_5))
   print(maclaurin_sin(-1_0, 1_5))

   print(maclaurin_cos(5))
   print(maclaurin_cos(-5))
   print(maclaurin_cos(1_0, 1_5))
   print(maclaurin_cos(-1_0, 1_5))








'''simple docstring'''

from PIL import Image







def    lowercase__			(				__UpperCamelCase		,						__UpperCamelCase   )->			Image:

      def brightness(__UpperCamelCase   ) -> float:
            return 128 + level + (c - 128)

      if not -255.0 <= level <= 255.0:
            raise ValueError("""level must be between -255.0 (black) and 255.0 (white)"""   )
      return img.point(__UpperCamelCase   )


if __name__ == "__main__":
     # Load image
     with Image.open('image_data/lena.jpg') as img:
          # Change brightness to 100
          SCREAMING_SNAKE_CASE__     =       change_brightness(img, 1_0_0)
          brigt_img.save('image_data/lena_brightness.png', format='png')
