


from __future__ import annotations






def 				UpperCamelCase      (			__magic_name__  :							List[Any]					,					__magic_name__  :							Union[str, Any]  )     ->						int:
		"""simple docstring"""




		lowercase__      =	0
		lowercase__      =	len(__magic_name__  ) - 1
		while left <= right:
				lowercase__      =	(left + right) // 2
				if left == right:
						if sorted_list[middle] < item:
								lowercase__      =	middle + 1
						break
				elif sorted_list[middle] < item:
						lowercase__      =	middle + 1
				else:
						lowercase__      =	middle - 1
		sorted_list.insert(__magic_name__					,					__magic_name__  )
		return sorted_list






def 				UpperCamelCase      (			__magic_name__  :							Dict					,					__magic_name__  :							str  )     ->						Any:
		"""simple docstring"""




		lowercase__      =	[]
		while left and right:
				if left[0][0] < right[0][0]:
						result.append(left.pop(0  )  )
				else:
						result.append(right.pop(0  )  )
		return result + left + right






def 				UpperCamelCase      (			__magic_name__  :							Union[str, Any]  )     ->						Union[str, Any]:
		"""simple docstring"""




		lowercase__      =	len(__magic_name__  )
		if length <= 1:
				return list_ad
		lowercase__      =	length // 2
		return merge(sortlist_ad(list_ad[:middle]  )					,					sortlist_ad(list_ad[middle:]  )  )






def 				UpperCamelCase      (			__magic_name__  :							list[int]  )     ->						list[int]:
		"""simple docstring"""




		if len(__magic_name__  ) <= 1:
				return collection
		lowercase__      =	[]
		lowercase__      =	False
		for i in range(0					,					len(__magic_name__  )					,					2  ):
				if i == len(__magic_name__  ) - 1:
						lowercase__      =	True
				else:
						if collection[i] < collection[i + 1]:
								two_paired_list.append([collection[i], collection[i + 1]]  )
						else:
								two_paired_list.append([collection[i + 1], collection[i]]  )
		lowercase__      =	sortlist_ad(__magic_name__  )
		lowercase__      =	[i[0] for i in sorted_list_ad]
		result.append(sorted_list_ad[-1][1]  )
		if has_last_odd_item:
				lowercase__      =	collection[-1]
				lowercase__      =	binary_search_insertion(__magic_name__					,					__magic_name__  )
		lowercase__      =	False
		for i in range(len(__magic_name__  ) - 1  ):
				if result[i] == collection[-1] and has_last_odd_item:
						lowercase__      =	True
				lowercase__      =	sorted_list_ad[i][1]
				# If last_odd_item is inserted before the item's index,
				# you should forward index one more.
				if is_last_odd_item_inserted_before_this_index:
						lowercase__      =	result[: i + 2] + binary_search_insertion(result[i + 2 :]					,					__magic_name__  )
				else:
						lowercase__      =	result[: i + 1] + binary_search_insertion(result[i + 1 :]					,					__magic_name__  )

		return result


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





import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging


A :	Optional[Any]												=     logging.get_logger(__name__)

A :	Union[str, Any]												=     {
    'facebook/sam-vit-huge': 'https://huggingface.co/facebook/sam-vit-huge/resolve/main/config.json',
    'facebook/sam-vit-large': 'https://huggingface.co/facebook/sam-vit-large/resolve/main/config.json',
    'facebook/sam-vit-base': 'https://huggingface.co/facebook/sam-vit-base/resolve/main/config.json',
}



class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					def __init__(self					:		Dict   ,      _UpperCAmelCase					:		List[str]=256   ,      _UpperCAmelCase					:		Tuple=1024   ,      _UpperCAmelCase					:		List[str]=16   ,      _UpperCAmelCase					:		Optional[Any]=16   ,      _UpperCAmelCase					:		Union[str, Any]=4   ,      _UpperCAmelCase					:		str="gelu"   ,      _UpperCAmelCase					:		List[str]=1E-6   ,      **_UpperCAmelCase					:		List[Any]   ,      )		->     Tuple:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase	)
							lowercase__      =	hidden_size
							lowercase__      =	image_size
							lowercase__      =	patch_size
							lowercase__      =	image_size // patch_size
							lowercase__      =	mask_input_channels
							lowercase__      =	num_point_embeddings
							lowercase__      =	hidden_act
							lowercase__      =	layer_norm_eps






class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					def __init__(self					:		List[str]   ,      _UpperCAmelCase					:		Optional[int]=256   ,      _UpperCAmelCase					:		int="relu"   ,      _UpperCAmelCase					:		Union[str, Any]=2048   ,      _UpperCAmelCase					:		int=2   ,      _UpperCAmelCase					:		Optional[Any]=8   ,      _UpperCAmelCase					:		Any=2   ,      _UpperCAmelCase					:		Tuple=3   ,      _UpperCAmelCase					:		List[str]=3   ,      _UpperCAmelCase					:		List[str]=256   ,      _UpperCAmelCase					:		Tuple=1E-6   ,      **_UpperCAmelCase					:		int   ,      )		->     Tuple:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase	)
							lowercase__      =	hidden_size
							lowercase__      =	hidden_act
							lowercase__      =	mlp_dim
							lowercase__      =	num_hidden_layers
							lowercase__      =	num_attention_heads
							lowercase__      =	attention_downsample_rate
							lowercase__      =	num_multimask_outputs
							lowercase__      =	iou_head_depth
							lowercase__      =	iou_head_hidden_dim
							lowercase__      =	layer_norm_eps






class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					def __init__(self					:		Optional[int]   ,      _UpperCAmelCase					:		List[Any]=768   ,      _UpperCAmelCase					:		Union[str, Any]=256   ,      _UpperCAmelCase					:		Union[str, Any]=12   ,      _UpperCAmelCase					:		Optional[Any]=12   ,      _UpperCAmelCase					:		Tuple=3   ,      _UpperCAmelCase					:		Optional[int]=1024   ,      _UpperCAmelCase					:		str=16   ,      _UpperCAmelCase					:		Tuple="gelu"   ,      _UpperCAmelCase					:		Any=1E-0_6   ,      _UpperCAmelCase					:		Any=0.0   ,      _UpperCAmelCase					:		str=1E-1_0   ,      _UpperCAmelCase					:		Tuple=True   ,      _UpperCAmelCase					:		Tuple=4.0   ,      _UpperCAmelCase					:		Optional[Any]=True   ,      _UpperCAmelCase					:		Optional[int]=True   ,      _UpperCAmelCase					:		Optional[Any]=14   ,      _UpperCAmelCase					:		Optional[int]=[2, 5, 8, 11]   ,      _UpperCAmelCase					:		List[Any]=128   ,      _UpperCAmelCase					:		int=None   ,      **_UpperCAmelCase					:		int   ,      )		->     Dict:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase	)

							lowercase__      =	hidden_size
							lowercase__      =	output_channels
							lowercase__      =	num_hidden_layers
							lowercase__      =	num_attention_heads
							lowercase__      =	num_channels
							lowercase__      =	image_size
							lowercase__      =	patch_size
							lowercase__      =	hidden_act
							lowercase__      =	layer_norm_eps
							lowercase__      =	attention_dropout
							lowercase__      =	initializer_range
							lowercase__      =	qkv_bias
							lowercase__      =	mlp_ratio
							lowercase__      =	use_abs_pos
							lowercase__      =	use_rel_pos
							lowercase__      =	window_size
							lowercase__      =	global_attn_indexes
							lowercase__      =	num_pos_feats
							lowercase__      =	int(hidden_size * mlp_ratio	) if mlp_dim is None else mlp_dim






class 							A					( UpperCAmelCase__							):
					'''simple docstring'''






					A__    =				'''sam'''
					A__    =				True

					def __init__(self					:		List[str]   ,      _UpperCAmelCase					:		Any=None   ,      _UpperCAmelCase					:		List[Any]=None   ,      _UpperCAmelCase					:		List[Any]=None   ,      _UpperCAmelCase					:		List[Any]=0.02   ,      **_UpperCAmelCase					:		Optional[Any]   ,      )		->     Dict:




							"""simple docstring"""


							super().__init__(**_UpperCAmelCase	)
							lowercase__      =	vision_config if vision_config is not None else {}
							lowercase__      =	prompt_encoder_config if prompt_encoder_config is not None else {}
							lowercase__      =	mask_decoder_config if mask_decoder_config is not None else {}

							if isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
									lowercase__      =	vision_config.to_dict()
							if isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
									lowercase__      =	prompt_encoder_config.to_dict()
							if isinstance(_UpperCAmelCase   ,      _UpperCAmelCase	):
									lowercase__      =	mask_decoder_config.to_dict()

							lowercase__      =	SamVisionConfig(**_UpperCAmelCase	)
							lowercase__      =	SamPromptEncoderConfig(**_UpperCAmelCase	)
							lowercase__      =	SamMaskDecoderConfig(**_UpperCAmelCase	)
							lowercase__      =	initializer_range


					def 						lowerCamelCase__  (self					:		Union[str, Any]	)		->     Tuple:




							"""simple docstring"""


							lowercase__      =	copy.deepcopy(self.__dict__	)
							lowercase__      =	self.vision_config.to_dict()
							lowercase__      =	self.prompt_encoder_config.to_dict()
							lowercase__      =	self.mask_decoder_config.to_dict()
							lowercase__      =	self.__class__.model_type
							return output

