





'''simple docstring'''




def 		__A		(  lowerCamelCase_	):


		"""simple docstring"""



		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(lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_	)
		    for node in graph	)



def 		__A		(  lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		visited.add(lowerCamelCase_	)
		rec_stk.add(lowerCamelCase_	)

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

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


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

							testmod()










'''simple docstring'''




from __future__ import annotations



def 		__A		(  lowerCamelCase_			,			lowerCamelCase_	):


		"""simple docstring"""



		if partitions <= 0:
				raise ValueError("""partitions must be a positive number!"""	)
		if partitions > number_of_bytes:
				raise ValueError("""partitions can not > number_of_bytes!"""	)
		SCREAMING_SNAKE_CASE :				int		=			number_of_bytes // partitions
		SCREAMING_SNAKE_CASE :				int		=			[]
		for i in range(lowerCamelCase_	):
				SCREAMING_SNAKE_CASE :				Optional[Any]		=			i * bytes_per_partition + 1
				SCREAMING_SNAKE_CASE :				Optional[int]		=			(
				    number_of_bytes if i == partitions - 1 else (i + 1) * bytes_per_partition
				)
				allocation_list.append(f'''{start_bytes}-{end_bytes}'''	)
		return allocation_list


if __name__ == "__main__":
							import doctest

							doctest.testmod()



