





import functools
import operator

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


__lowerCAmelCase :int     =    logging.get_logger(__name__)

__lowerCAmelCase :Optional[Any]     =    {
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}






class        _a(    __lowerCamelCase    ):
		lowerCamelCase__     :str   				=		'''unispeech'''







		def __init__(    self ,						__snake_case=3_2 ,						__snake_case=7_6_8 ,						__snake_case=1_2 ,						__snake_case=1_2 ,						__snake_case=3_0_7_2 ,						__snake_case="gelu" ,						__snake_case=0.1 ,						__snake_case=0.1 ,						__snake_case=0.1 ,						__snake_case=0.0 ,						__snake_case=0.0 ,						__snake_case=0.1 ,						__snake_case=0.1 ,						__snake_case=0.02 ,						__snake_case=1E-5 ,						__snake_case="group" ,						__snake_case="gelu" ,						__snake_case=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2) ,						__snake_case=(5, 2, 2, 2, 2, 2, 2) ,						__snake_case=(1_0, 3, 3, 3, 3, 2, 2) ,						__snake_case=False ,						__snake_case=1_2_8 ,						__snake_case=1_6 ,						__snake_case=False ,						__snake_case=True ,						__snake_case=0.05 ,						__snake_case=1_0 ,						__snake_case=2 ,						__snake_case=0.0 ,						__snake_case=1_0 ,						__snake_case=0 ,						__snake_case=3_2_0 ,						__snake_case=2 ,						__snake_case=0.1 ,						__snake_case=1_0_0 ,						__snake_case=2_5_6 ,						__snake_case=2_5_6 ,						__snake_case=0.1 ,						__snake_case="mean" ,						__snake_case=False ,						__snake_case=False ,						__snake_case=2_5_6 ,						__snake_case=8_0 ,						__snake_case=0 ,						__snake_case=1 ,						__snake_case=2 ,						__snake_case=0.5 ,						**__snake_case ,						)      ->      Tuple:


							'''simple docstring'''

							super().__init__(**a_ ,						pad_token_id=a_ ,						bos_token_id=a_ ,						eos_token_id=a_				)
							_snake_case       :					Union[str, Any]				       =   hidden_size
							_snake_case       :					Any				       =   feat_extract_norm
							_snake_case       :					List[Any]				       =   feat_extract_activation
							_snake_case       :					Optional[int]				       =   list(a_				)
							_snake_case       :					Optional[int]				       =   list(a_				)
							_snake_case       :					List[str]				       =   list(a_				)
							_snake_case       :					Union[str, Any]				       =   conv_bias
							_snake_case       :					Union[str, Any]				       =   num_conv_pos_embeddings
							_snake_case       :					Tuple				       =   num_conv_pos_embedding_groups
							_snake_case       :					List[Any]				       =   len(self.conv_dim				)
							_snake_case       :					str				       =   num_hidden_layers
							_snake_case       :					List[Any]				       =   intermediate_size
							_snake_case       :					Union[str, Any]				       =   hidden_act
							_snake_case       :					int				       =   num_attention_heads
							_snake_case       :					str				       =   hidden_dropout
							_snake_case       :					Union[str, Any]				       =   attention_dropout
							_snake_case       :					List[str]				       =   activation_dropout
							_snake_case       :					int				       =   feat_proj_dropout
							_snake_case       :					Any				       =   final_dropout
							_snake_case       :					Optional[int]				       =   layerdrop
							_snake_case       :					Any				       =   layer_norm_eps
							_snake_case       :					List[str]				       =   initializer_range
							_snake_case       :					Dict				       =   num_ctc_classes
							_snake_case       :					Optional[Any]				       =   vocab_size
							_snake_case       :					Any				       =   do_stable_layer_norm
							_snake_case       :					List[Any]				       =   use_weighted_layer_sum
							_snake_case       :					Union[str, Any]				       =   classifier_proj_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)`, but is `len(config.conv_dim) ="
												    f""" {len(self.conv_dim				)}`, `len(config.conv_stride) = {len(self.conv_stride				)}`,"""
												    f""" `len(config.conv_kernel) = {len(self.conv_kernel				)}`."""				)

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

							# parameters for pretraining with codevector quantized representations
							_snake_case       :					Any				       =   num_codevectors_per_group
							_snake_case       :					List[Any]				       =   num_codevector_groups
							_snake_case       :					Dict				       =   contrastive_logits_temperature
							_snake_case       :					Union[str, Any]				       =   feat_quantizer_dropout
							_snake_case       :					Union[str, Any]				       =   num_negatives
							_snake_case       :					Optional[int]				       =   codevector_dim
							_snake_case       :					Optional[int]				       =   proj_codevector_dim
							_snake_case       :					Any				       =   diversity_loss_weight

							# ctc loss
							_snake_case       :					Optional[Any]				       =   ctc_loss_reduction
							_snake_case       :					int				       =   ctc_zero_infinity

							# pretraining loss
							_snake_case       :					Dict				       =   replace_prob







		@property
		def        lowercase       (    self				)      ->      str:


							'''simple docstring'''

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






import re







def    A				(							UpperCAmelCase				):
					_snake_case       :					Any				       =   re.compile(R"^(\+91[\-\s]?)?[0]?(91)?[789]\d{9}$"				)
					if match := re.search(UpperCAmelCase  ,  UpperCAmelCase				):
										return match.string == phone
					return False


if __name__ == "__main__":
							print(indian_phone_validator('+918827897895'))