





import unittest

from transformers import is_torch_available
from transformers.testing_utils import require_torch


if is_torch_available():
					import torch

					from transformers.generation import DisjunctiveConstraint


@require_torch
class 					__a      (unittest.TestCase     ):

							def     UpperCAmelCase__	(							self							:     Optional[Any]   )					->       List[Any]:







													"""simple docstring"""
													UpperCAmelCase_			:      List[str]     						=  [[1, 2, 4], [1, 2, 3, 4]]
													UpperCAmelCase_			:      List[str]     						=  DisjunctiveConstraint(__magic_name__   )
													self.assertTrue(isinstance(dc.token_ids       ,     __magic_name__   )   )

													with self.assertRaises(__magic_name__   ):
																			DisjunctiveConstraint(torch.LongTensor([[1, 2, 4], [1, 2, 3]]   )   )

													with self.assertRaises(__magic_name__   ):
																			DisjunctiveConstraint([torch.LongTensor([1, 2, 4]   ), torch.LongTensor([1, 2, 3, 4, 5]   )]   )

							def     UpperCAmelCase__	(							self							:     List[str]   )					->       Dict:







													"""simple docstring"""
													UpperCAmelCase_			:      Tuple     						=  [[1, 2], [1, 2, 3, 4]]

													with self.assertRaises(__magic_name__   ):
																			DisjunctiveConstraint(__magic_name__   )  # fails here

							def     UpperCAmelCase__	(							self							:     Optional[int]   )					->       Union[str, Any]:







													"""simple docstring"""
													UpperCAmelCase_			:      Optional[int]     						=  [[1, 2, 3], [1, 2, 4]]

													UpperCAmelCase_			:      List[str]     						=  DisjunctiveConstraint(__magic_name__   )

													UpperCAmelCase_			:      List[Any]     						=  dc.update(1   )
													UpperCAmelCase_			:      Dict     						=  stepped is True and completed is False and reset is False
													self.assertTrue(__magic_name__   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.current_seq == [1]   )

													UpperCAmelCase_			:      str     						=  dc.update(2   )
													UpperCAmelCase_			:      Optional[Any]     						=  stepped is True and completed is False and reset is False
													self.assertTrue(__magic_name__   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.current_seq == [1, 2]   )

													UpperCAmelCase_			:      List[Any]     						=  dc.update(3   )
													UpperCAmelCase_			:      Dict     						=  stepped is True and completed is True and reset is False
													self.assertTrue(__magic_name__   )
													self.assertTrue(dc.completed   )  # Completed!
													self.assertTrue(dc.current_seq == [1, 2, 3]   )



							def     UpperCAmelCase__	(							self							:     int   )					->       Dict:







													"""simple docstring"""
													UpperCAmelCase_			:      Any     						=  [[1, 2, 3], [1, 2, 4, 5], [1, 2, 5]]

													UpperCAmelCase_			:      Tuple     						=  DisjunctiveConstraint(__magic_name__   )

													UpperCAmelCase_			:      List[Any]     						=  dc.update(1   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.current_seq == [1]   )

													UpperCAmelCase_			:      Optional[int]     						=  dc.update(2   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.current_seq == [1, 2]   )

													UpperCAmelCase_			:      int     						=  dc.update(4   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.current_seq == [1, 2, 4]   )

													UpperCAmelCase_			:      int     						=  dc.update(5   )
													self.assertTrue(dc.completed   )  # Completed!
													self.assertTrue(dc.current_seq == [1, 2, 4, 5]   )

													dc.reset()

													UpperCAmelCase_			:      List[Any]     						=  dc.update(1   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.remaining() == 3   )
													self.assertTrue(dc.current_seq == [1]   )

													UpperCAmelCase_			:      Optional[Any]     						=  dc.update(2   )
													self.assertTrue(not dc.completed   )
													self.assertTrue(dc.remaining() == 2   )
													self.assertTrue(dc.current_seq == [1, 2]   )

													UpperCAmelCase_			:      Optional[int]     						=  dc.update(5   )
													self.assertTrue(dc.completed   )  # Completed!
													self.assertTrue(dc.remaining() == 0   )
													self.assertTrue(dc.current_seq == [1, 2, 5]   )












'''simple docstring'''







import sys
import turtle





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			tuple[float, float],			SCREAMING_SNAKE_CASE__      :			tuple[float, float]   ) ->	tuple[float, float]:
						return (pa[0] + pa[0]) / 2, (pa[1] + pa[1]) / 2





def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			tuple[float, float],			SCREAMING_SNAKE_CASE__      :			tuple[float, float],			SCREAMING_SNAKE_CASE__      :			tuple[float, float],			SCREAMING_SNAKE_CASE__      :			int,			) ->	None:
						my_pen.up()
						my_pen.goto(vertexa[0],			vertexa[1]   )
						my_pen.down()
						my_pen.goto(vertexa[0],			vertexa[1]   )
						my_pen.goto(vertexa[0],			vertexa[1]   )
						my_pen.goto(vertexa[0],			vertexa[1]   )

						if depth == 0:
												return

						triangle(SCREAMING_SNAKE_CASE__,			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			depth - 1   )
						triangle(SCREAMING_SNAKE_CASE__,			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			depth - 1   )
						triangle(SCREAMING_SNAKE_CASE__,			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			get_mid(SCREAMING_SNAKE_CASE__,			SCREAMING_SNAKE_CASE__   ),			depth - 1   )


if __name__ == "__main__":
					if len(sys.argv) != 2:
										raise ValueError(
										    "Correct format for using this script: "
										    "python fractals.py <int:depth_for_fractal>"
										)
					snake_case_     :       Any						=  turtle.Turtle()
					my_pen.ht()
					my_pen.speed(5)
					my_pen.pencolor("red")

					snake_case_     :       Tuple						=  [(-1_75, -1_25), (0, 1_75), (1_75, -1_25)]  # vertices of triangle
					triangle(vertices[0], vertices[1], vertices[2], int(sys.argv[1]))





