



'''simple docstring'''



def        UpperCAmelCase (    A	:					dict					):
							SCREAMING_SNAKE_CASE       :   set[int]         =      set()
							# To detect a back edge, keep track of vertices currently in the recursion stack
							SCREAMING_SNAKE_CASE       :   set[int]         =      set()
							return any(
							    node not in visited and depth_first_search(A       ,		A       ,		A       ,		A					)
							    for node in graph					)
def        UpperCAmelCase (    A	:					dict       ,		A	:					int       ,		A	:					set       ,		A	:					set					):
							visited.add(A					)
							rec_stk.add(A					)

							for node in graph[vertex]:
														if node not in visited:
																					if depth_first_search(A       ,		A       ,		A       ,		A					):
																												return True
														elif node in rec_stk:
																					return True

    # The node needs to be removed from recursion stack before function ends
							rec_stk.remove(A					)
							return False


if __name__ == "__main__":
							from doctest import testmod

							testmod()









'''simple docstring'''



def        UpperCAmelCase (    A	:					int					):
							if not isinstance(A       ,		A					):
														SCREAMING_SNAKE_CASE       :   List[str]         =      F"""Input value of [number={number}] must be an integer"""
														raise TypeError(A					)
							if number < 0:
														return False
							SCREAMING_SNAKE_CASE       :   List[str]         =      number * number
							while number > 0:
														if number % 10 != number_square % 10:
																					return False
														number //= 10
														number_square //= 10
							return True


if __name__ == "__main__":
							import doctest

							doctest.testmod()




