


import random







def        lowerCAmelCase_  (      __lowerCamelCase							,			__lowerCamelCase							,			__lowerCamelCase = False			):
							__snake_case	:    dict											=     {i: [] for i in range(__lowerCamelCase			)}

							# if probability is greater or equal than 1, then generate a complete graph
							if probability >= 1:
														return complete_graph(__lowerCamelCase			)
							# if probability is lower or equal than 0, then return a graph without edges
							if probability <= 0:
														return graph

							# for each couple of nodes, add an edge from u to v
							# if the number randomly generated is greater than probability probability
							for i in range(__lowerCamelCase			):
														for j in range(i + 1							,			__lowerCamelCase			):
																					if random.random() < probability:
																												graph[i].append(__lowerCamelCase			)
																												if not directed:
																																			# if the graph is undirected, add an edge in from j to i, either
																																			graph[j].append(__lowerCamelCase			)
							return graph







def        lowerCAmelCase_  (      __lowerCamelCase			):
							return {
							    i: [j for j in range(__lowerCamelCase			) if i != j] for i in range(__lowerCamelCase			)
							}


if __name__ == "__main__":
			import doctest

			doctest.testmod()





import math







def        lowerCAmelCase_  (      __lowerCamelCase							,			__lowerCamelCase			):

							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 > 3_6_0:
														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")

