


"""simple docstring"""
import os
from shutil import copyfile
from typing import List, Optional, Tuple

from ...tokenization_utils import AddedToken
from ...tokenization_utils_fast import PreTrainedTokenizerFast
from ...utils import is_sentencepiece_available, logging


if is_sentencepiece_available():
				from .tokenization_fnet import FNetTokenizer
else:
				__SCREAMING_SNAKE_CASE							:      int						=      None

__SCREAMING_SNAKE_CASE							:      List[str]						=      logging.get_logger(__name__)
__SCREAMING_SNAKE_CASE							:      Optional[Any]						=      {'vocab_file': 'spiece.model', 'tokenizer_file': 'tokenizer.json'}

__SCREAMING_SNAKE_CASE							:      List[str]						=      {
    'vocab_file': {
        'google/fnet-base': 'https://huggingface.co/google/fnet-base/resolve/main/spiece.model',
        'google/fnet-large': 'https://huggingface.co/google/fnet-large/resolve/main/spiece.model',
    },
    'tokenizer_file': {
        'google/fnet-base': 'https://huggingface.co/google/fnet-base/resolve/main/tokenizer.json',
        'google/fnet-large': 'https://huggingface.co/google/fnet-large/resolve/main/tokenizer.json',
    },
}

__SCREAMING_SNAKE_CASE							:      Dict						=      {
    'google/fnet-base': 512,
    'google/fnet-large': 512,
}

__SCREAMING_SNAKE_CASE							:      List[str]						=      '▁'





class        __A       (snake_case__):





							'''simple docstring'''

							__lowercase:						Dict							 =      VOCAB_FILES_NAMES
							__lowercase:						int							 =      PRETRAINED_VOCAB_FILES_MAP
							__lowercase:						Union[str, Any]							 =      PRETRAINED_POSITIONAL_EMBEDDINGS_SIZES
							__lowercase:						str							 =      ["""input_ids""", """token_type_ids"""]
							__lowercase:						Optional[int]							 =      FNetTokenizer



							def __init__(			self							: str						,    UpperCAmelCase_							: str=None						,    UpperCAmelCase_							: Tuple=None						,    UpperCAmelCase_							: str=False						,    UpperCAmelCase_							: Tuple=True						,    UpperCAmelCase_							: Dict=True						,    UpperCAmelCase_							: Optional[Any]="<unk>"						,    UpperCAmelCase_							: Tuple="[SEP]"						,    UpperCAmelCase_							: Tuple="<pad>"						,    UpperCAmelCase_							: List[Any]="[CLS]"						,    UpperCAmelCase_							: List[Any]="[MASK]"						,    **UpperCAmelCase_							: Optional[int]						,    )   ->Any:



														"""simple docstring"""



														snake_case_          =						(
														    AddedToken(UpperCAmelCase_						,    lstrip=UpperCAmelCase_						,    rstrip=UpperCAmelCase_						,    normalized=UpperCAmelCase_    )
														    if isinstance(UpperCAmelCase_						,    UpperCAmelCase_    )
														    else mask_token
														)

														super().__init__(
														    UpperCAmelCase_						,    tokenizer_file=UpperCAmelCase_						,    do_lower_case=UpperCAmelCase_						,    remove_space=UpperCAmelCase_						,    keep_accents=UpperCAmelCase_						,    unk_token=UpperCAmelCase_						,    sep_token=UpperCAmelCase_						,    pad_token=UpperCAmelCase_						,    cls_token=UpperCAmelCase_						,    mask_token=UpperCAmelCase_						,    **UpperCAmelCase_						,    )

														snake_case_          =						do_lower_case
														snake_case_          =						remove_space
														snake_case_          =						keep_accents
														snake_case_          =						vocab_file
														snake_case_          =						False if not self.vocab_file else True



							def 						lowerCAmelCase    (			self							: Optional[int]						,    UpperCAmelCase_							: List[int]						,    UpperCAmelCase_							: Optional[List[int]] = None    )   ->List[int]:



														"""simple docstring"""



														snake_case_          =						[self.sep_token_id]
														snake_case_          =						[self.cls_token_id]
														if token_ids_a is None:
																					return cls + token_ids_a + sep
														return cls + token_ids_a + sep + token_ids_a + sep



							def 						lowerCAmelCase    (			self							: Any						,    UpperCAmelCase_							: List[int]						,    UpperCAmelCase_							: Optional[List[int]] = None    )   ->List[int]:



														"""simple docstring"""



														snake_case_          =						[self.sep_token_id]
														snake_case_          =						[self.cls_token_id]

														if token_ids_a is None:
																					return len(cls + token_ids_a + sep    ) * [0]
														return len(cls + token_ids_a + sep    ) * [0] + len(token_ids_a + sep    ) * [1]



							def 						lowerCAmelCase    (			self							: Union[str, Any]						,    UpperCAmelCase_							: str						,    UpperCAmelCase_							: Optional[str] = None    )   ->Tuple[str]:



														"""simple docstring"""



														if not os.path.isdir(UpperCAmelCase_    ):
																					logger.error(F"""Vocabulary path ({save_directory}) should be a directory"""    )
																					return
														snake_case_          =						os.path.join(
														    UpperCAmelCase_						,    (filename_prefix + """-""" if filename_prefix else """""") + VOCAB_FILES_NAMES["""vocab_file"""]    )

														if os.path.abspath(self.vocab_file    ) != os.path.abspath(UpperCAmelCase_    ):
																					copyfile(self.vocab_file						,    UpperCAmelCase_    )

														return (out_vocab_file,)







"""simple docstring"""
def   _a			( _SCREAMING_SNAKE_CASE			)      ->			list:

							if len(_SCREAMING_SNAKE_CASE			) <= 1:
														return [tuple(_SCREAMING_SNAKE_CASE			)]

							snake_case_          =						[]

							def generate(_SCREAMING_SNAKE_CASE			,	_SCREAMING_SNAKE_CASE			):
														if k == 1:
																					res.append(tuple(arr[:]			)			)
																					return

														generate(k - 1			,	_SCREAMING_SNAKE_CASE			)

														for i in range(k - 1			):
																					if k % 2 == 0:  # k is even
																												snake_case_    ,  snake_case_          =						arr[k - 1], arr[i]
																					else:  # k is odd
																												snake_case_    ,  snake_case_          =						arr[k - 1], arr[0]
																					generate(k - 1			,	_SCREAMING_SNAKE_CASE			)

							generate(len(_SCREAMING_SNAKE_CASE			)			,	_SCREAMING_SNAKE_CASE			)
							return res


if __name__ == "__main__":
				__SCREAMING_SNAKE_CASE							:      List[Any]						=      input('Enter numbers separated by a comma:\n').strip()
				__SCREAMING_SNAKE_CASE							:      str						=      [int(item) for item in user_input.split(',')]
				print(heaps(arr))



