
"""simple docstring"""







import unittest

from transformers import is_flax_available
from transformers.testing_utils import require_flax, require_sentencepiece, require_tokenizers, require_torch, slow


if is_flax_available():
		import optax
		from flax.training.common_utils import onehot

		from transformers import AutoTokenizer, FlaxMTaForConditionalGeneration
		from transformers.models.ta.modeling_flax_ta import shift_tokens_right







@require_torch
@require_sentencepiece
@require_tokenizers
@require_flax
class 							__magic_name__     (		unittest.TestCase   ):





					@slow
					def 							lowerCAmelCase      (				self   :							Optional[Any]    ):
												__snake_case     			=       FlaxMTaForConditionalGeneration.from_pretrained("google/mt5-small"    )
												__snake_case     			=       AutoTokenizer.from_pretrained("google/mt5-small"    )

												__snake_case     			=       tokenizer("Hello there"							,						return_tensors="np"    ).input_ids
												__snake_case     			=       tokenizer("Hi I am"							,						return_tensors="np"    ).input_ids

												__snake_case     			=       shift_tokens_right(snake_case_							,						model.config.pad_token_id							,						model.config.decoder_start_token_id    )

												__snake_case     			=       model(snake_case_							,						decoder_input_ids=snake_case_    ).logits
												__snake_case     			=       optax.softmax_cross_entropy(snake_case_							,						onehot(snake_case_							,						logits.shape[-1]    )    ).mean()

												__snake_case     			=       -(labels.shape[-1] * loss.item())

												__snake_case     			=       -84.9127
												self.assertTrue(abs(mtf_score - EXPECTED_SCORE    ) < 1e-4    )


"""simple docstring"""







def   __UpperCamelCase   (					SCREAMING_SNAKE_CASE )  ->     list:







							"""simple docstring"""


							__snake_case     			=       len(SCREAMING_SNAKE_CASE )
							for i in range(1							,    SCREAMING_SNAKE_CASE ):
														__snake_case     			=       collection[i]
														__snake_case     			=       0
														__snake_case     			=       i - 1

														while low <= high:
																					__snake_case     			=       (low + high) // 2
																					if val < collection[mid]:
																												__snake_case     			=       mid - 1
																					else:
																												__snake_case     			=       mid + 1
														for j in range(SCREAMING_SNAKE_CASE							,    SCREAMING_SNAKE_CASE							,    -1 ):
																					__snake_case     			=       collection[j - 1]
														__snake_case     			=       val
							return collection


if __name__ == "__main__":
		_SCREAMING_SNAKE_CASE	       =      input("""Enter numbers separated by a comma:\n""").strip()
		_SCREAMING_SNAKE_CASE	       =      [int(item) for item in user_input.split(""",""")]
		print(binary_insertion_sort(unsorted))
