



"""simple docstring"""






import pickle
import unittest

import torch

from accelerate import Accelerator
from accelerate.state import AcceleratorState
from accelerate.test_utils import require_cpu






@require_cpu
class 	__snake_case	(     unittest.TestCase):




  def 						SCREAMING_SNAKE_CASE    (			self					:						Dict		):






         """simple docstring"""






         _lowerCamelCase						:    int         =			torch.nn.Linear(1_0						, 1_0		)
         _lowerCamelCase						:    Dict         =			torch.optim.SGD(model.parameters()						, 0.1		)
         _lowerCamelCase						:    Dict         =			Accelerator()
         _lowerCamelCase						:    int         =			accelerator.prepare(__lowerCAmelCase		)
         try:
                pickle.loads(pickle.dumps(__lowerCAmelCase		)		)
         except Exception as e:
                self.fail(f'''Accelerated optimizer pickling failed with {e}'''		)
         AcceleratorState._reset_state()







"""simple docstring"""






def 	snake_case_  (				A_ :		list						):


       '''simple docstring'''





       _lowerCamelCase						:    Union[str, Any]         =			len(A_						)
       for i in range(1,    A_						):
              _lowerCamelCase						:    Tuple         =			collection[i]
              _lowerCamelCase						:    Dict         =			0
              _lowerCamelCase						:    Any         =			i - 1

              while low <= high:
                     _lowerCamelCase						:    Optional[int]         =			(low + high) // 2
                     if val < collection[mid]:
                            _lowerCamelCase						:    List[str]         =			mid - 1
                     else:
                            _lowerCamelCase						:    Dict         =			mid + 1
              for j in range(A_,    A_,    -1						):
                     _lowerCamelCase						:    Optional[int]         =			collection[j - 1]
              _lowerCamelCase						:    Tuple         =			val
       return collection


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


