



import functools
import operator

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


_snake_case		=  logging.get_logger(__name__)

_snake_case		=  {
    "asapp/sew-d-tiny-100k": "https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json",
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}



class   UpperCAmelCase_    (       a):
							lowerCamelCase__   			=		'sew-d'







							def __init__(   self,			__a=32,			__a=768,			__a=12,			__a=12,			__a=3072,			__a=2,			__a=512,			__a=256,			__a=True,			__a=True,			__a=("p2c", "c2p"),			__a="layer_norm",			__a="gelu_python",			__a=0.1,			__a=0.1,			__a=0.1,			__a=0.0,			__a=0.1,			__a=0.02,			__a=1E-7,			__a=1E-5,			__a="group",			__a="gelu",			__a=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512),			__a=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1),			__a=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1),			__a=False,			__a=128,			__a=16,			__a=True,			__a=0.05,			__a=10,			__a=2,			__a=0.0,			__a=10,			__a=0,			__a="mean",			__a=False,			__a=False,			__a=256,			__a=0,			__a=1,			__a=2,			**__a,			):

														'''simple docstring'''

														super().__init__(**__a,			pad_token_id=__a,			bos_token_id=__a,			eos_token_id=__a)
														_lowerCAmelCase     :							Tuple    =    hidden_size
														_lowerCAmelCase     :							List[Any]    =    feat_extract_norm
														_lowerCAmelCase     :							Dict    =    feat_extract_activation
														_lowerCAmelCase     :							Dict    =    list(__a)
														_lowerCAmelCase     :							Dict    =    list(__a)
														_lowerCAmelCase     :							List[str]    =    list(__a)
														_lowerCAmelCase     :							Dict    =    conv_bias
														_lowerCAmelCase     :							str    =    num_conv_pos_embeddings
														_lowerCAmelCase     :							int    =    num_conv_pos_embedding_groups
														_lowerCAmelCase     :							Dict    =    len(self.conv_dim)
														_lowerCAmelCase     :							List[str]    =    num_hidden_layers
														_lowerCAmelCase     :							List[Any]    =    intermediate_size
														_lowerCAmelCase     :							Dict    =    squeeze_factor
														_lowerCAmelCase     :							Any    =    max_position_embeddings
														_lowerCAmelCase     :							Optional[Any]    =    position_buckets
														_lowerCAmelCase     :							Optional[int]    =    share_att_key
														_lowerCAmelCase     :							str    =    relative_attention
														_lowerCAmelCase     :							Dict    =    norm_rel_ebd
														_lowerCAmelCase     :							Optional[int]    =    list(__a)
														_lowerCAmelCase     :							List[str]    =    hidden_act
														_lowerCAmelCase     :							Union[str, Any]    =    num_attention_heads
														_lowerCAmelCase     :							Optional[Any]    =    hidden_dropout
														_lowerCAmelCase     :							Dict    =    attention_dropout
														_lowerCAmelCase     :							str    =    activation_dropout
														_lowerCAmelCase     :							Optional[Any]    =    feat_proj_dropout
														_lowerCAmelCase     :							Tuple    =    final_dropout
														_lowerCAmelCase     :							Dict    =    layer_norm_eps
														_lowerCAmelCase     :							Union[str, Any]    =    feature_layer_norm_eps
														_lowerCAmelCase     :							str    =    initializer_range
														_lowerCAmelCase     :							str    =    vocab_size

														if (
														    (len(self.conv_stride) != self.num_feat_extract_layers)
														    or (len(self.conv_kernel) != self.num_feat_extract_layers)
														    or (len(self.conv_dim) != self.num_feat_extract_layers)
														):
																					raise ValueError(
																					    "Configuration for convolutional layers is incorrect."
																					    "It is required that `len(config.conv_dim)` == `len(config.conv_stride)` == `len(config.conv_kernel)`,"
																					    f"but is `len(config.conv_dim) = {len(self.conv_dim)}`, `len(config.conv_stride)"
																					    f"= {len(self.conv_stride)}`, `len(config.conv_kernel) = {len(self.conv_kernel)}`.")

														# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
														_lowerCAmelCase     :							List[Any]    =    apply_spec_augment
														_lowerCAmelCase     :							Optional[int]    =    mask_time_prob
														_lowerCAmelCase     :							Any    =    mask_time_length
														_lowerCAmelCase     :							Tuple    =    mask_time_min_masks
														_lowerCAmelCase     :							List[str]    =    mask_feature_prob
														_lowerCAmelCase     :							List[str]    =    mask_feature_length
														_lowerCAmelCase     :							Tuple    =    mask_feature_min_masks

														# ctc loss
														_lowerCAmelCase     :							Optional[Any]    =    ctc_loss_reduction
														_lowerCAmelCase     :							List[str]    =    ctc_zero_infinity

														# sequence classification
														_lowerCAmelCase     :							Optional[int]    =    use_weighted_layer_sum
														_lowerCAmelCase     :							Union[str, Any]    =    classifier_proj_size







							@property
							def    snake_case__      (   self):

														'''simple docstring'''

														return functools.reduce(operator.mul,			self.conv_stride,			1)





from __future__ import annotations

import bisect






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							if hi < 0:
														_lowerCAmelCase     :							int    =    len(_lowerCamelCase  )

							while lo < hi:
														_lowerCAmelCase     :							Optional[Any]    =    lo + (hi - lo) // 2
														if sorted_collection[mid] < item:
																					_lowerCAmelCase     :							Union[str, Any]    =    mid + 1
														else:
																					_lowerCAmelCase     :							str    =    mid

							return lo






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							if hi < 0:
														_lowerCAmelCase     :							str    =    len(_lowerCamelCase  )

							while lo < hi:
														_lowerCAmelCase     :							Tuple    =    lo + (hi - lo) // 2
														if sorted_collection[mid] <= item:
																					_lowerCAmelCase     :							Dict    =    mid + 1
														else:
																					_lowerCAmelCase     :							str    =    mid

							return lo






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							sorted_collection.insert(bisect_left(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  )				, _lowerCamelCase  )






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase = 0				, _lowerCamelCase = -1  ):





							'''simple docstring'''




							sorted_collection.insert(bisect_right(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  )				, _lowerCamelCase  )






def 				A				(					_lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase     :							int    =    0
							_lowerCAmelCase     :							Union[str, Any]    =    len(_lowerCamelCase  ) - 1

							while left <= right:
														_lowerCAmelCase     :							int    =    left + (right - left) // 2
														_lowerCAmelCase     :							int    =    sorted_collection[midpoint]
														if current_item == item:
																					return midpoint
														elif item < current_item:
																					_lowerCAmelCase     :							str    =    midpoint - 1
														else:
																					_lowerCAmelCase     :							Any    =    midpoint + 1
							return None






def 				A				(					_lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							_lowerCAmelCase     :							Tuple    =    bisect.bisect_left(_lowerCamelCase				, _lowerCamelCase  )
							if index != len(_lowerCamelCase  ) and sorted_collection[index] == item:
														return index
							return None






def 				A				(					_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase  ):





							'''simple docstring'''




							if right < left:
														return None

							_lowerCAmelCase     :							Optional[int]    =    left + (right - left) // 2

							if sorted_collection[midpoint] == item:
														return midpoint
							elif sorted_collection[midpoint] > item:
														return binary_search_by_recursion(_lowerCamelCase				, _lowerCamelCase				, _lowerCamelCase				, midpoint - 1  )
							else:
														return binary_search_by_recursion(_lowerCamelCase				, _lowerCamelCase				, midpoint + 1				, _lowerCamelCase  )


if __name__ == "__main__":
						_snake_case		=  input("Enter numbers separated by comma:\n").strip()
						_snake_case		=  sorted(int(item) for item in user_input.split(","))
						_snake_case		=  int(input("Enter a single number to be found in the list:\n"))
						_snake_case		=  binary_search(collection, target)
						if result is None:
												print(f'''{target} was not found in {collection}.''')
						else:
												print(f'''{target} was found at position {result} in {collection}.''')
