


'''simple docstring'''

import math






def __UpperCamelCase   (			__lowerCamelCase		: float      ,  __lowerCamelCase		: float				)      ->     float:







     '''simple docstring'''






     if initial_intensity < 0:
          raise ValueError("The value of intensity cannot be negative"				)
          # handling of negative values of initial intensity
     if angle < 0 or angle > 360:
          raise ValueError("In Malus Law, the angle is in the range 0-360 degrees"				)
          # handling of values out of allowed range
     return initial_intensity * (math.cos(math.radians(__lowerCamelCase				)				) ** 2)


if __name__ == "__main__":
   import doctest

   doctest.testmod(name="malus_law")





'''simple docstring'''

from __future__ import annotations

import requests






def __UpperCamelCase   (			__lowerCamelCase		: str				)      ->     dict:







     '''simple docstring'''






     _a						=		F"https://hacker-news.firebaseio.com/v0/item/{story_id}.json?print=pretty"
     return requests.get(__lowerCamelCase				).json()






def __UpperCamelCase   (			__lowerCamelCase		: int = 10				)      ->     list[dict]:







     '''simple docstring'''






     _a						=		"https://hacker-news.firebaseio.com/v0/topstories.json?print=pretty"
     _a						=		requests.get(__lowerCamelCase				).json()[:max_stories]
     return [get_hackernews_story(__lowerCamelCase				) for story_id in story_ids]






def __UpperCamelCase   (			__lowerCamelCase		: int = 10				)      ->     str:







     '''simple docstring'''






     _a						=		hackernews_top_stories(__lowerCamelCase				)
     return "\n".join("* [{title}]({url})".format(**__lowerCamelCase				) for story in stories				)


if __name__ == "__main__":
   print(hackernews_top_stories_as_markdown())

