



'''simple docstring'''

import json
from typing import Iterator, List, Union

from tokenizers import AddedToken, Regex, Tokenizer, decoders, normalizers, pre_tokenizers, trainers
from tokenizers.implementations.base_tokenizer import BaseTokenizer
from tokenizers.models import Unigram
from tokenizers.processors import TemplateProcessing

class      __magic_name__						(   _UpperCamelCase       ):







							def __init__(							self :	List[Any]     ,_UpperCAmelCase :	str = "▁"     ,_UpperCAmelCase :	bool = True     ,_UpperCAmelCase :	Union[str, AddedToken] = "<unk>"     ,_UpperCAmelCase :	Union[str, AddedToken] = "</s>"     ,_UpperCAmelCase :	Union[str, AddedToken] = "<pad>"     ,):
									_a					:				Union[str, Any]				=							{
									    'pad': {'id': 0, 'token': pad_token},
									    'eos': {'id': 1, 'token': eos_token},
									    'unk': {'id': 2, 'token': unk_token},
									}

									_a					:				Optional[Any]				=							[None] * len(self.special_tokens		)
									for token_dict in self.special_tokens.values():
											_a					:				Optional[Any]				=							token_dict['token']

									_a					:				Optional[int]				=							Tokenizer(Unigram()		)

									_a					:				List[Any]				=							normalizers.Sequence(
									    [
									        normalizers.Nmt(),
									        normalizers.NFKC(),
									        normalizers.Replace(Regex(' {2,}'		)     ,' '		),
									        normalizers.Lowercase(),
									    ]		)
									_a					:				Optional[int]				=							pre_tokenizers.Sequence(
									    [
									        pre_tokenizers.Metaspace(replacement=_UpperCAmelCase     ,add_prefix_space=_UpperCAmelCase		),
									        pre_tokenizers.Digits(individual_digits=_UpperCAmelCase		),
									        pre_tokenizers.Punctuation(),
									    ]		)
									_a					:				int				=							decoders.Metaspace(replacement=_UpperCAmelCase     ,add_prefix_space=_UpperCAmelCase		)

									_a					:				Optional[Any]				=							TemplateProcessing(
									    single=F"""$A {self.special_tokens['eos']['token']}"""     ,special_tokens=[(self.special_tokens['eos']['token'], self.special_tokens['eos']['id'])]     ,)

									_a					:				str				=							{
									    'model': 'SentencePieceUnigram',
									    'replacement': replacement,
									    'add_prefix_space': add_prefix_space,
									}

									super().__init__(_UpperCAmelCase     ,_UpperCAmelCase		)







							def 							__lowercase      (							self :	str     ,_UpperCAmelCase :	Union[str, List[str]]     ,_UpperCAmelCase :	int = 8000     ,_UpperCAmelCase :	bool = True     ,):
									_a					:				int				=							trainers.UnigramTrainer(
									    vocab_size=_UpperCAmelCase     ,special_tokens=self.special_tokens_list     ,show_progress=_UpperCAmelCase     ,)

									if isinstance(_UpperCAmelCase     ,_UpperCAmelCase		):
											_a					:				Union[str, Any]				=							[files]
									self._tokenizer.train(_UpperCAmelCase     ,trainer=_UpperCAmelCase		)

									self.add_unk_id()







							def 							__lowercase      (							self :	Optional[Any]     ,_UpperCAmelCase :	Union[Iterator[str], Iterator[Iterator[str]]]     ,_UpperCAmelCase :	int = 8000     ,_UpperCAmelCase :	bool = True     ,):
									_a					:				Tuple				=							trainers.UnigramTrainer(
									    vocab_size=_UpperCAmelCase     ,special_tokens=self.special_tokens_list     ,show_progress=_UpperCAmelCase     ,)

									self._tokenizer.train_from_iterator(_UpperCAmelCase     ,trainer=_UpperCAmelCase		)

									self.add_unk_id()







							def 							__lowercase      (							self :	Any		):
									_a					:				Optional[Any]				=							json.loads(self._tokenizer.to_str()		)

									_a					:				Any				=							self.special_tokens['unk']['id']

									_a					:				int				=							Tokenizer.from_str(json.dumps(_UpperCAmelCase		)		)









'''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...''')




