






'''simple docstring'''







def 		_UpperCAmelCase (				__A				: list   ):
				a_		:	List[str]									=   len(__A   )
				for i in range(1    ,		__A   ):
								a_		:	str									=   collection[i]
								a_		:	List[str]									=   0
								a_		:	Any									=   i - 1

								while low <= high:
												a_		:	Optional[Any]									=   (low + high) // 2
												if val < collection[mid]:
																a_		:	Any									=   mid - 1
												else:
																a_		:	List[str]									=   mid + 1
								for j in range(__A    ,		__A    ,		-1   ):
												a_		:	Dict									=   collection[j - 1]
								a_		:	str									=   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))












'''simple docstring'''







import os
import time

import pytest

from datasets.utils.filelock import FileLock, Timeout





def 		_UpperCAmelCase (				__A				: int   ):
				a_		:	Optional[Any]									=   FileLock(str(tmpdir / '''foo.lock'''   )   )
				a_		:	Union[str, Any]									=   FileLock(str(tmpdir / '''foo.lock'''   )   )
				a_		:	List[Any]									=   0.01
				with locka.acquire():
								with pytest.raises(__A   ):
												a_		:	List[Any]									=   time.time()
												locka.acquire(__A   )
												assert time.time() - _start > timeout





def 		_UpperCAmelCase (				__A				: Tuple   ):
				a_		:	Tuple									=   '''a''' * 10_00 + '''.lock'''
				a_		:	List[Any]									=   FileLock(str(tmpdir / filename   )   )
				assert locka._lock_file.endswith('''.lock'''   )
				assert not locka._lock_file.endswith(__A   )
				assert len(os.path.basename(locka._lock_file   )   ) <= 2_55
				a_		:	Optional[int]									=   FileLock(tmpdir / filename   )
				with locka.acquire():
								with pytest.raises(__A   ):
												locka.acquire(0   )




