



'''simple docstring'''

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      __magic_name__						(   unittest.TestCase       ):







							def 							__lowercase      (							self :	List[Any]		):
									_a					:				Tuple				=							[[1, 2, 4], [1, 2, 3, 4]]
									_a					:				Tuple				=							DisjunctiveConstraint(_UpperCAmelCase		)
									self.assertTrue(isinstance(dc.token_ids     ,_UpperCAmelCase		)		)

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

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







							def 							__lowercase      (							self :	Union[str, Any]		):
									_a					:				List[Any]				=							[[1, 2], [1, 2, 3, 4]]

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







							def 							__lowercase      (							self :	List[Any]		):
									_a					:				List[Any]				=							[[1, 2, 3], [1, 2, 4]]

									_a					:				Dict				=							DisjunctiveConstraint(_UpperCAmelCase		)

									_a	, _a	, _a					:				str				=							dc.update(1		)
									_a					:				Tuple				=							stepped is True and completed is False and reset is False
									self.assertTrue(_UpperCAmelCase		)
									self.assertTrue(not dc.completed		)
									self.assertTrue(dc.current_seq == [1]		)

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

									_a	, _a	, _a					:				Tuple				=							dc.update(3		)
									_a					:				Dict				=							stepped is True and completed is True and reset is False
									self.assertTrue(_UpperCAmelCase		)
									self.assertTrue(dc.completed		)  # Completed!
									self.assertTrue(dc.current_seq == [1, 2, 3]		)







							def 							__lowercase      (							self :	Optional[Any]		):
									_a					:				List[str]				=							[[1, 2, 3], [1, 2, 4, 5], [1, 2, 5]]

									_a					:				Optional[Any]				=							DisjunctiveConstraint(_UpperCAmelCase		)

									_a	, _a	, _a					:				Tuple				=							dc.update(1		)
									self.assertTrue(not dc.completed		)
									self.assertTrue(dc.current_seq == [1]		)

									_a	, _a	, _a					:				str				=							dc.update(2		)
									self.assertTrue(not dc.completed		)
									self.assertTrue(dc.current_seq == [1, 2]		)

									_a	, _a	, _a					:				Union[str, Any]				=							dc.update(4		)
									self.assertTrue(not dc.completed		)
									self.assertTrue(dc.current_seq == [1, 2, 4]		)

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

									dc.reset()

									_a	, _a	, _a					:				Optional[int]				=							dc.update(1		)
									self.assertTrue(not dc.completed		)
									self.assertTrue(dc.remaining() == 3		)
									self.assertTrue(dc.current_seq == [1]		)

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

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









'''simple docstring'''

# Function to print upper half of diamond (pyramid)



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				int:
		for i in range(0						,      lowerCAmelCase_  ):
				for _ in range(0						,      n - i - 1  ):  # printing spaces
						print(' '						,      end=''  )
				for _ in range(0						,      i + 1  ):  # printing stars
						print('* '						,      end=''  )
				print()



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				Union[str, Any]:
		for i in range(lowerCAmelCase_						,      0						,      -1  ):
				for _ in range(lowerCAmelCase_						,      0						,      -1  ):  # printing stars
						print('* '						,      end=''  )
				print()
				for _ in range(n - i + 1						,      0						,      -1  ):  # printing spaces
						print(' '						,      end=''  )



def 					__lowerCamelCase					(				lowerCAmelCase_  )      ->				Tuple:
		if n <= 0:
				print('       ...       ....        nothing printing :('  )
				return
		floyd(lowerCAmelCase_  )  # upper half
		reverse_floyd(lowerCAmelCase_  )  # lower half


if __name__ == "__main__":
							print(r'''| /\ | |- |  |-  |--| |\  /| |-''')
							print(r'''|/  \| |- |_ |_  |__| | \/ | |_''')
							__lowerCAmelCase						      =       1
							while K:
														__lowerCAmelCase						      =       int(input('''enter the number and , and see the magic : '''))
														print()
														pretty_print(user_number)
														__lowerCAmelCase						      =       int(input('''press 0 to exit... and 1 to continue...'''))

							print('''Good Bye...''')




