


class    UpperCAmelCase					:




			def __init__(						self							:		Union[str, Any]						):







						"""simple docstring"""







						UpperCamelCase         =					{}




			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						print(self.vertex						)
						for i in self.vertex:
									print(__magic_name__       ,       """ -> """       ,       """ -> """.join([str(__magic_name__						) for j in self.vertex[i]]						)						)




			def   lowerCamelCase_					(						self							:		Tuple       ,       __magic_name__							:		int       ,       __magic_name__							:		int						):







						"""simple docstring"""







						if from_vertex in self.vertex:
									self.vertex[from_vertex].append(__magic_name__						)
						else:
									# else make a new vertex
									UpperCamelCase         =					[to_vertex]




			def   lowerCamelCase_					(						self							:		Tuple						):







						"""simple docstring"""







						UpperCamelCase         =					[False] * len(self.vertex						)

						# call the recursive helper function
						for i in range(len(self.vertex						)						):
									if not visited[i]:
												self.dfs_recursive(__magic_name__       ,       __magic_name__						)





			def   lowerCamelCase_					(						self							:		Union[str, Any]       ,       __magic_name__							:		int       ,       __magic_name__							:		list						):







						"""simple docstring"""







						UpperCamelCase         =					True

						print(__magic_name__       ,       end=""" """						)

						# Recur for all the vertices that are adjacent to this node
						for i in self.vertex:
									if not visited[i]:
												self.dfs_recursive(__magic_name__       ,       __magic_name__						)


if __name__ == "__main__":
			__snake_case            =   Graph()
			g.add_edge(0, 1)
			g.add_edge(0, 2)
			g.add_edge(1, 2)
			g.add_edge(2, 0)
			g.add_edge(2, 3)
			g.add_edge(3, 3)

			g.print_graph()
			print("DFS:")
			g.dfs()

			# OUTPUT:
			# 0  ->  1 -> 2
			# 1  ->  2
			# 2  ->  0 -> 3
			# 3  ->  3
			# DFS:
			#  0 1 2 3








import math
import unittest






def 							_lowercase    (		SCREAMING_SNAKE_CASE_   :		int	):





			"""simple docstring"""




			assert isinstance(SCREAMING_SNAKE_CASE_       ,  SCREAMING_SNAKE_CASE_	) and (
			    number >= 0
			), "'number' must been an int and positive"

			if 1 < number < 4:
						# 2 and 3 are primes
						return True
			elif number < 2 or number % 2 == 0 or number % 3 == 0:
						# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
						return False

			# All primes number are in format of 6k +/- 1
			for i in range(5       ,  int(math.sqrt(SCREAMING_SNAKE_CASE_	) + 1	)       ,  6	):
						if number % i == 0 or number % (i + 2) == 0:
									return False
			return True




class    UpperCAmelCase					(       unittest.TestCase    ):




			def   lowerCamelCase_					(						self							:		Any						):







						"""simple docstring"""







						self.assertTrue(is_prime(2						)						)
						self.assertTrue(is_prime(3						)						)
						self.assertTrue(is_prime(5						)						)
						self.assertTrue(is_prime(7						)						)
						self.assertTrue(is_prime(1_1						)						)
						self.assertTrue(is_prime(1_3						)						)
						self.assertTrue(is_prime(1_7						)						)
						self.assertTrue(is_prime(1_9						)						)
						self.assertTrue(is_prime(2_3						)						)
						self.assertTrue(is_prime(2_9						)						)





			def   lowerCamelCase_					(						self							:		Dict						):







						"""simple docstring"""







						with self.assertRaises(__magic_name__						):
									is_prime(-1_9						)
						self.assertFalse(
						    is_prime(0						)       ,       """Zero doesn't have any positive factors, primes must have exactly two."""       ,       )
						self.assertFalse(
						    is_prime(1						)       ,       """One only has 1 positive factor, primes must have exactly two."""       ,       )
						self.assertFalse(is_prime(2 * 2						)						)
						self.assertFalse(is_prime(2 * 3						)						)
						self.assertFalse(is_prime(3 * 3						)						)
						self.assertFalse(is_prime(3 * 5						)						)
						self.assertFalse(is_prime(3 * 5 * 7						)						)


if __name__ == "__main__":
			unittest.main()




