





import argparse
import hashlib  # hashlib is only used inside the Test class
import struct





class 			lowerCAmelCase__:






       '''simple docstring'''


       def __init__(      self    ,						__lowerCamelCase							)			->     Dict:
            _SCREAMING_SNAKE_CASE       :	List[Any]						    =							data
            _SCREAMING_SNAKE_CASE       :	Union[str, Any]						    =							[0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]




       @staticmethod
       def     UpperCamelCase_			(      __lowerCamelCase    ,						__lowerCamelCase							)			->     Dict:
            return ((n << b) | (n >> (3_2 - b))) & 0xFFFFFFFF




       def     UpperCamelCase_			(      self							)			->     List[str]:
            _SCREAMING_SNAKE_CASE       :	Tuple						    =							b"\x80" + b"\x00" * (6_3 - (len(self.data							) + 8) % 6_4)
            _SCREAMING_SNAKE_CASE       :	Any						    =							self.data + padding + struct.pack(">Q"    ,						8 * len(self.data							)							)
            return padded_data




       def     UpperCamelCase_			(      self							)			->     int:
            return [
                self.padded_data[i : i + 6_4] for i in range(0    ,						len(self.padded_data							)    ,						6_4							)
            ]




       def     UpperCamelCase_			(      self    ,						__lowerCamelCase							)			->     Tuple:
            _SCREAMING_SNAKE_CASE       :	Any						    =							list(struct.unpack(">16L"    ,						__lowerCamelCase							)							) + [0] * 6_4
            for i in range(1_6    ,						8_0							):
                 _SCREAMING_SNAKE_CASE       :	str						    =							self.rotate((w[i - 3] ^ w[i - 8] ^ w[i - 1_4] ^ w[i - 1_6])    ,						1							)
            return w







       def     UpperCamelCase_			(      self							)			->     Union[str, Any]:
            _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							self.padding()
            _SCREAMING_SNAKE_CASE       :	int						    =							self.split_blocks()
            for block in self.blocks:
                 _SCREAMING_SNAKE_CASE       :	int						    =							self.expand_block(__lowerCamelCase							)
                 _SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE       :	int						    =							self.h
                 for i in range(0    ,						8_0							):
                      if 0 <= i < 2_0:
                           _SCREAMING_SNAKE_CASE       :	Dict						    =							(b & c) | ((~b) & d)
                           _SCREAMING_SNAKE_CASE       :	Union[str, Any]						    =							0x5A827999
                      elif 2_0 <= i < 4_0:
                           _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							b ^ c ^ d
                           _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							0x6ED9EBA1
                      elif 4_0 <= i < 6_0:
                           _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							(b & c) | (b & d) | (c & d)
                           _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							0x8F1BBCDC
                      elif 6_0 <= i < 8_0:
                           _SCREAMING_SNAKE_CASE       :	str						    =							b ^ c ^ d
                           _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							0xCA62C1D6
                      _SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE    ,			_SCREAMING_SNAKE_CASE       :	Any						    =							(
                          self.rotate(__lowerCamelCase    ,						5							) + f + e + k + expanded_block[i] & 0xFFFFFFFF,
                          a,
                          self.rotate(__lowerCamelCase    ,						3_0							),
                          c,
                          d,
                      )
                 _SCREAMING_SNAKE_CASE       :	List[Any]						    =							(
                     self.h[0] + a & 0xFFFFFFFF,
                     self.h[1] + b & 0xFFFFFFFF,
                     self.h[2] + c & 0xFFFFFFFF,
                     self.h[3] + d & 0xFFFFFFFF,
                     self.h[4] + e & 0xFFFFFFFF,
                 )
            return ("{:08x}" * 5).format(*self.h							)






def     lowerCamelCase__			():
     _SCREAMING_SNAKE_CASE       :	Union[str, Any]						    =							B"Test String"
     assert SHAaHash(__lowerCamelCase	).final_hash() == hashlib.shaa(__lowerCamelCase	).hexdigest()  # noqa: S324






def     lowerCamelCase__			():
     _SCREAMING_SNAKE_CASE       :	Any						    =							argparse.ArgumentParser(description="Process some strings or files"	)
     parser.add_argument(
         "--string",       dest="input_string",       default="Hello World!! Welcome to Cryptography",       help="Hash the string",       )
     parser.add_argument("--file",       dest="input_file",       help="Hash contents of a file"	)
     _SCREAMING_SNAKE_CASE       :	str						    =							parser.parse_args()
     _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							args.input_string
     # In any case hash input should be a bytestring
     if args.input_file:
          with open(args.input_file,       "rb"	) as f:
               _SCREAMING_SNAKE_CASE       :	List[str]						    =							f.read()
     else:
          _SCREAMING_SNAKE_CASE       :	Union[str, Any]						    =							bytes(__lowerCamelCase,       "utf-8"	)
     print(SHAaHash(__lowerCamelCase	).final_hash()	)


if __name__ == "__main__":
       main()
       import doctest

       doctest.testmod()






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


UpperCamelCase__      =logging.get_logger(__name__)

UpperCamelCase__      ={
    'facebook/s2t-wav2vec2-large-en-de': (
        'https://huggingface.co/facebook/s2t-wav2vec2-large-en-de/resolve/main/config.json'
    ),
    # See all Speech2Text models at https://huggingface.co/models?filter=speech2text2
}





class 			lowerCAmelCase__( __lowercase    ):






       '''simple docstring'''


       __snake_case 			=    'speech_to_text_2'
       __snake_case 			=    ['past_key_values']
       __snake_case 			=    {'num_attention_heads': 'decoder_attention_heads', 'hidden_size': 'd_model'}




       def __init__(      self    ,						__lowerCamelCase=1_0_0_0_0    ,						__lowerCamelCase=6    ,						__lowerCamelCase=2_0_4_8    ,						__lowerCamelCase=4    ,						__lowerCamelCase=0.0    ,						__lowerCamelCase=True    ,						__lowerCamelCase="relu"    ,						__lowerCamelCase=2_5_6    ,						__lowerCamelCase=0.1    ,						__lowerCamelCase=0.0    ,						__lowerCamelCase=0.0    ,						__lowerCamelCase=0.02    ,						__lowerCamelCase=2    ,						__lowerCamelCase=True    ,						__lowerCamelCase=1    ,						__lowerCamelCase=0    ,						__lowerCamelCase=2    ,						__lowerCamelCase=1_0_2_4    ,						**__lowerCamelCase    ,						)			->     Optional[int]:
            _SCREAMING_SNAKE_CASE       :	Optional[Any]						    =							vocab_size
            _SCREAMING_SNAKE_CASE       :	List[Any]						    =							d_model
            _SCREAMING_SNAKE_CASE       :	Dict						    =							decoder_ffn_dim
            _SCREAMING_SNAKE_CASE       :	Tuple						    =							decoder_layers
            _SCREAMING_SNAKE_CASE       :	List[str]						    =							decoder_attention_heads
            _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							dropout
            _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							attention_dropout
            _SCREAMING_SNAKE_CASE       :	List[Any]						    =							activation_dropout
            _SCREAMING_SNAKE_CASE       :	Dict						    =							activation_function
            _SCREAMING_SNAKE_CASE       :	Optional[int]						    =							init_std
            _SCREAMING_SNAKE_CASE       :	List[str]						    =							decoder_layerdrop
            _SCREAMING_SNAKE_CASE       :	int						    =							use_cache
            _SCREAMING_SNAKE_CASE       :	int						    =							decoder_layers
            _SCREAMING_SNAKE_CASE       :	Tuple						    =							scale_embedding  # scale factor will be sqrt(d_model) if True
            _SCREAMING_SNAKE_CASE       :	str						    =							max_target_positions

            super().__init__(
                pad_token_id=__lowerCamelCase    ,						bos_token_id=__lowerCamelCase    ,						eos_token_id=__lowerCamelCase    ,						decoder_start_token_id=__lowerCamelCase    ,						**__lowerCamelCase    ,						)