"""simple docstring"""




import functools
import operator

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


_a   :	Tuple 					=     logging.get_logger(__name__)

_a   :	str 					=     {
    "microsoft/unispeech-sat-base-100h-libri-ft": (
        "https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json"
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}
class 		__A							(				_lowerCamelCase	):
     _UpperCamelCase							:    Optional[int]	      =	"unispeech-sat"






     def __init__(	self       ,  a__=32       ,  a__=768       ,  a__=12       ,  a__=12       ,  a__=3072       ,  a__="gelu"       ,  a__=0.1       ,  a__=0.1       ,  a__=0.1       ,  a__=0.0       ,  a__=0.0       ,  a__=0.1       ,  a__=0.1       ,  a__=0.0_2       ,  a__=1e-5       ,  a__="group"       ,  a__="gelu"       ,  a__=(512, 512, 512, 512, 512, 512, 512)       ,  a__=(5, 2, 2, 2, 2, 2, 2)       ,  a__=(10, 3, 3, 3, 3, 2, 2)       ,  a__=False       ,  a__=128       ,  a__=16       ,  a__=False       ,  a__=True       ,  a__=0.0_5       ,  a__=10       ,  a__=2       ,  a__=0.0       ,  a__=10       ,  a__=0       ,  a__=320       ,  a__=2       ,  a__=0.1       ,  a__=100       ,  a__=256       ,  a__=256       ,  a__=0.1       ,  a__="mean"       ,  a__=False       ,  a__=False       ,  a__=256       ,  a__=(512, 512, 512, 512, 1500)       ,  a__=(5, 3, 3, 1, 1)       ,  a__=(1, 2, 3, 1, 1)       ,  a__=512       ,  a__=0       ,  a__=1       ,  a__=2       ,  a__=504       ,  **a__       ,  ):
       super().__init__(**A__       ,  pad_token_id=A__       ,  bos_token_id=A__       ,  eos_token_id=A__						)
       _lowerCAmelCase		: List[str]						    =  hidden_size
       _lowerCAmelCase		: Tuple						    =  feat_extract_norm
       _lowerCAmelCase		: int						    =  feat_extract_activation
       _lowerCAmelCase		: List[Any]						    =  list(A__						)
       _lowerCAmelCase		: List[str]						    =  list(A__						)
       _lowerCAmelCase		: List[Any]						    =  list(A__						)
       _lowerCAmelCase		: Any						    =  conv_bias
       _lowerCAmelCase		: str						    =  num_conv_pos_embeddings
       _lowerCAmelCase		: Any						    =  num_conv_pos_embedding_groups
       _lowerCAmelCase		: int						    =  len(self.conv_dim						)
       _lowerCAmelCase		: Dict						    =  num_hidden_layers
       _lowerCAmelCase		: Tuple						    =  intermediate_size
       _lowerCAmelCase		: Optional[Any]						    =  hidden_act
       _lowerCAmelCase		: Union[str, Any]						    =  num_attention_heads
       _lowerCAmelCase		: Optional[Any]						    =  hidden_dropout
       _lowerCAmelCase		: List[Any]						    =  attention_dropout
       _lowerCAmelCase		: Union[str, Any]						    =  activation_dropout
       _lowerCAmelCase		: str						    =  feat_proj_dropout
       _lowerCAmelCase		: Any						    =  final_dropout
       _lowerCAmelCase		: int						    =  layerdrop
       _lowerCAmelCase		: Any						    =  layer_norm_eps
       _lowerCAmelCase		: Union[str, Any]						    =  initializer_range
       _lowerCAmelCase		: Any						    =  vocab_size
       _lowerCAmelCase		: List[Any]						    =  num_clusters
       _lowerCAmelCase		: str						    =  do_stable_layer_norm
       _lowerCAmelCase		: int						    =  use_weighted_layer_sum

       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
       _lowerCAmelCase		: Any						    =  apply_spec_augment
       _lowerCAmelCase		: List[Any]						    =  mask_time_prob
       _lowerCAmelCase		: List[Any]						    =  mask_time_length
       _lowerCAmelCase		: List[Any]						    =  mask_time_min_masks
       _lowerCAmelCase		: List[Any]						    =  mask_feature_prob
       _lowerCAmelCase		: Union[str, Any]						    =  mask_feature_length
       _lowerCAmelCase		: Any						    =  mask_feature_min_masks

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

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

       # SequenceClassification-specific parameter. Feel free to ignore for other classes.
       _lowerCAmelCase		: Dict						    =  classifier_proj_size

       # XVector-specific parameters. Feel free to ignore for other classes.
       _lowerCAmelCase		: Any						    =  list(A__						)
       _lowerCAmelCase		: Optional[int]						    =  list(A__						)
       _lowerCAmelCase		: int						    =  list(A__						)
       _lowerCAmelCase		: Union[str, Any]						    =  xvector_output_dim






     @property
     def 					__A						(	self						):
       return functools.reduce(operator.mul       ,  self.conv_stride       ,  1						)





"""simple docstring"""




from PIL import Image





def 							SCREAMING_SNAKE_CASE  (    _lowerCamelCase		: Image    ,_lowerCamelCase		: int			) ->   Image:
  _lowerCAmelCase		: Any						    =  (259 * (level + 255)) / (255 * (259 - level))

  def contrast(_lowerCamelCase		: int			) -> int:
    return int(128 + factor * (c - 128)			)

  return img.point(_lowerCamelCase			)


if __name__ == "__main__":
     # Load image
     with Image.open('image_data/lena.jpg') as img:
          # Change contrast to 170
          _a   :	str 					=     change_contrast(img, 170)
          cont_img.save('image_data/lena_high_contrast.png', format='png')




