





'''simple docstring'''

import json
import os
from typing import Optional, Tuple

from ...tokenization_utils import PreTrainedTokenizer
from ...utils import logging


lowercase__		:     List[str]			=							logging.get_logger(__name__)

lowercase__		:     str			=							{'vocab_file': 'vocab.json'}

lowercase__		:     str			=							{
    'vocab_file': {
        'mgp-str': 'https://huggingface.co/alibaba-damo/mgp-str-base/blob/main/vocab.json',
    }
}

lowercase__		:     Union[str, Any]			=							{'mgp-str': 27}
class 							__lowerCAmelCase	(       __magic_name__					):






       """simple docstring"""
       _snake_case      :	Tuple									=       VOCAB_FILES_NAMES
       _snake_case      :	str									=       PRETRAINED_VOCAB_FILES_MAP
       _snake_case      :	Optional[Any]									=       PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES





       def __init__(				self  :						List[Any]			,					lowerCAmelCase__  :						Tuple			,					lowerCAmelCase__  :						str="[GO]"			,					lowerCAmelCase__  :						Union[str, Any]="[GO]"			,					lowerCAmelCase__  :						str="[s]"			,					lowerCAmelCase__  :						Tuple="[GO]"			,					**lowerCAmelCase__  :						List[Any]	)       ->	Optional[int]:

            '''simple docstring'''




            super().__init__(
                unk_token=lowerCAmelCase__			,					bos_token=lowerCAmelCase__			,					eos_token=lowerCAmelCase__			,					pad_token=lowerCAmelCase__			,					**lowerCAmelCase__			,					)

            with open(lowerCAmelCase__			,					encoding='''utf-8'''	) as vocab_handle:
                 _UpperCamelCase							       =			json.load(lowerCAmelCase__	)
            _UpperCamelCase							       =			{v: k for k, v in self.vocab.items()}





       @property
       def snake_case__		(				self  :						Any	)       ->	Dict:

            '''simple docstring'''




            return len(self.vocab	)





       def snake_case__		(				self  :						int	)       ->	Optional[Any]:

            '''simple docstring'''




            return dict(self.vocab			,					**self.added_tokens_encoder	)





       def snake_case__		(				self  :						List[Any]			,					lowerCAmelCase__  :						Any	)       ->	Union[str, Any]:

            '''simple docstring'''




            _UpperCamelCase							       =			[]
            for s in text:
                 char_tokens.extend(lowerCAmelCase__	)
            return char_tokens





       def snake_case__		(				self  :						Any			,					lowerCAmelCase__  :						Tuple	)       ->	Union[str, Any]:

            '''simple docstring'''




            return self.vocab.get(lowerCAmelCase__			,					self.vocab.get(self.unk_token	)	)





       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						str	)       ->	List[str]:

            '''simple docstring'''




            return self.decoder.get(lowerCAmelCase__	)







       def snake_case__		(				self  :						Optional[Any]			,					lowerCAmelCase__  :						str			,					lowerCAmelCase__  :						Optional[str] = None	)       ->	Tuple[str]:

            '''simple docstring'''




            if not os.path.isdir(lowerCAmelCase__	):
                 logger.error('''Vocabulary path ({}) should be a directory'''.format(lowerCAmelCase__	)	)
                 return
            _UpperCamelCase							       =			os.path.join(
                lowerCAmelCase__			,					(filename_prefix + '''-''' if filename_prefix else '''''') + VOCAB_FILES_NAMES['''vocab_file''']	)

            with open(lowerCAmelCase__			,					'''w'''			,					encoding='''utf-8'''	) as f:
                 f.write(json.dumps(self.vocab			,					indent=2			,					sort_keys=lowerCAmelCase__			,					ensure_ascii=lowerCAmelCase__	) + '''\n'''	)

            return (vocab_file,)










'''simple docstring'''

from __future__ import annotations







def    a__							(							lowercase   :	list,   lowercase   :	int )						->						List[Any]:





     """simple docstring"""

     if len(lowercase ) <= 1 or n <= 1:
          return

     insert_next(lowercase,   n - 1 )
     rec_insertion_sort(lowercase,   n - 1 )







def    a__							(							lowercase   :	list,   lowercase   :	int )						->						Optional[Any]:





     """simple docstring"""

     if index >= len(lowercase ) or collection[index - 1] <= collection[index]:
          return

     # Swaps adjacent elements since they are not in ascending order
     _UpperCamelCase       ,							_UpperCamelCase							       =			(
         collection[index],
         collection[index - 1],
     )

     insert_next(lowercase,   index + 1 )


if __name__ == "__main__":
   lowercase__		:     str			=							input('Enter integers separated by spaces: ')
   lowercase__		:     list[int]			=							[int(num) for num in numbers.split()]
   rec_insertion_sort(number_list, len(number_list))
   print(number_list)



