



"""simple docstring"""




from tempfile import TemporaryDirectory
from unittest import TestCase
from unittest.mock import MagicMock, patch

from transformers import AutoModel, TFAutoModel
from transformers.onnx import FeaturesManager
from transformers.testing_utils import SMALL_MODEL_IDENTIFIER, require_tf, require_torch






@require_torch
@require_tf
class      UpperCAmelCase_  (    _UpperCamelCase						):



      def 						snake_case_ (					self					:     Dict						):
           _UpperCAmelCase      :     int        =   SMALL_MODEL_IDENTIFIER
           _UpperCAmelCase      :     Dict        =   "pt"
           _UpperCAmelCase      :     Any        =   "tf"



      def 						snake_case_ (					self					:     Optional[Any]					,     A					:     Optional[int]						):
           _UpperCAmelCase      :     Dict        =   AutoModel.from_pretrained(self.test_model						)
           model_pt.save_pretrained(A						)



      def 						snake_case_ (					self					:     List[Any]					,     A					:     str						):
           _UpperCAmelCase      :     str        =   TFAutoModel.from_pretrained(self.test_model					,     from_pt=A						)
           model_tf.save_pretrained(A						)



      def 						snake_case_ (					self					:     Tuple						):
           _UpperCAmelCase      :     int        =   "mock_framework"

           # Framework provided - return whatever the user provides
           _UpperCAmelCase      :     List[Any]        =   FeaturesManager.determine_framework(self.test_model					,     A						)
           self.assertEqual(A					,     A						)

           # Local checkpoint and framework provided - return provided framework
           # PyTorch checkpoint
           with TemporaryDirectory() as local_pt_ckpt:
                self._setup_pt_ckpt(A						)
                _UpperCAmelCase      :     Dict        =   FeaturesManager.determine_framework(A					,     A						)
                self.assertEqual(A					,     A						)

           # TensorFlow checkpoint
           with TemporaryDirectory() as local_tf_ckpt:
                self._setup_tf_ckpt(A						)
                _UpperCAmelCase      :     Dict        =   FeaturesManager.determine_framework(A					,     A						)
                self.assertEqual(A					,     A						)



      def 						snake_case_ (					self					:     Dict						):
           # PyTorch checkpoint
           with TemporaryDirectory() as local_pt_ckpt:
                self._setup_pt_ckpt(A						)
                _UpperCAmelCase      :     int        =   FeaturesManager.determine_framework(A						)
                self.assertEqual(A					,     self.framework_pt						)

           # TensorFlow checkpoint
           with TemporaryDirectory() as local_tf_ckpt:
                self._setup_tf_ckpt(A						)
                _UpperCAmelCase      :     Dict        =   FeaturesManager.determine_framework(A						)
                self.assertEqual(A					,     self.framework_tf						)

           # Invalid local checkpoint
           with TemporaryDirectory() as local_invalid_ckpt:
                with self.assertRaises(A						):
                     _UpperCAmelCase      :     Tuple        =   FeaturesManager.determine_framework(A						)



      def 						snake_case_ (					self					:     str						):
           _UpperCAmelCase      :     Optional[int]        =   MagicMock(return_value=A						)
           with patch("transformers.onnx.features.is_tf_available"					,     A						):
                _UpperCAmelCase      :     Optional[int]        =   FeaturesManager.determine_framework(self.test_model						)
                self.assertEqual(A					,     self.framework_pt						)

           # PyTorch not in environment -> use TensorFlow
           _UpperCAmelCase      :     int        =   MagicMock(return_value=A						)
           with patch("transformers.onnx.features.is_torch_available"					,     A						):
                _UpperCAmelCase      :     List[Any]        =   FeaturesManager.determine_framework(self.test_model						)
                self.assertEqual(A					,     self.framework_tf						)

           # Both in environment -> use PyTorch
           _UpperCAmelCase      :     Optional[int]        =   MagicMock(return_value=A						)
           _UpperCAmelCase      :     Dict        =   MagicMock(return_value=A						)
           with patch("transformers.onnx.features.is_tf_available"					,     A						), patch(
               "transformers.onnx.features.is_torch_available"					,     A						):
                _UpperCAmelCase      :     Union[str, Any]        =   FeaturesManager.determine_framework(self.test_model						)
                self.assertEqual(A					,     self.framework_pt						)

           # Both not in environment -> raise error
           _UpperCAmelCase      :     int        =   MagicMock(return_value=A						)
           _UpperCAmelCase      :     Tuple        =   MagicMock(return_value=A						)
           with patch("transformers.onnx.features.is_tf_available"					,     A						), patch(
               "transformers.onnx.features.is_torch_available"					,     A						):
                with self.assertRaises(A						):
                     _UpperCAmelCase      :     List[Any]        =   FeaturesManager.determine_framework(self.test_model						)





"""simple docstring"""




def 						__snake_case						(				SCREAMING_SNAKE_CASE__     :						List[str]    )  ->       str:





     '''simple docstring'''

     _UpperCAmelCase    ,	_UpperCAmelCase      :     Dict        =   [], []
     while len(SCREAMING_SNAKE_CASE__    ) > 1:
          _UpperCAmelCase    ,	_UpperCAmelCase      :     int        =   min(SCREAMING_SNAKE_CASE__    ), max(SCREAMING_SNAKE_CASE__    )
          start.append(SCREAMING_SNAKE_CASE__    )
          end.append(SCREAMING_SNAKE_CASE__    )
          collection.remove(SCREAMING_SNAKE_CASE__    )
          collection.remove(SCREAMING_SNAKE_CASE__    )
     end.reverse()
     return start + collection + end


if __name__ == "__main__":
 _lowerCAmelCase    : int							=							input("Enter numbers separated by a comma:\n").strip()
 _lowerCAmelCase    : List[str]							=							[int(item) for item in user_input.split(",")]
 print(*merge_sort(unsorted), sep=",")
