






from typing import List, Optional, Union

import numpy as np

from ...feature_extraction_sequence_utils import SequenceFeatureExtractor
from ...feature_extraction_utils import BatchFeature
from ...utils import PaddingStrategy, TensorType, logging


lowercase     :							Any	     =			logging.get_logger(__name__)




class 						UpperCAmelCase_  (		SCREAMING_SNAKE_CASE__    ):


						'''simple docstring'''




						A   :      Optional[int]						 =    ['input_values', 'attention_mask']






						def __init__(		self						, _SCREAMING_SNAKE_CASE=1						, _SCREAMING_SNAKE_CASE=1_6000						, _SCREAMING_SNAKE_CASE=0.0						, _SCREAMING_SNAKE_CASE=False						, _SCREAMING_SNAKE_CASE=True						, **_SCREAMING_SNAKE_CASE						, )       -> Tuple:
								super().__init__(feature_size=_SCREAMING_SNAKE_CASE						, sampling_rate=_SCREAMING_SNAKE_CASE						, padding_value=_SCREAMING_SNAKE_CASE						, **_SCREAMING_SNAKE_CASE )
								snake_case_ :							str         =				return_attention_mask
								snake_case_ :							str         =				do_normalize






						@staticmethod
						def 					_lowerCAmelCase				(		_SCREAMING_SNAKE_CASE						, _SCREAMING_SNAKE_CASE						, _SCREAMING_SNAKE_CASE = 0.0 )       -> List[np.ndarray]:
								if attention_mask is not None:
										snake_case_ :							List[str]         =				np.array(_SCREAMING_SNAKE_CASE						, np.intaa )
										snake_case_ :							Any         =				[]

										for vector, length in zip(_SCREAMING_SNAKE_CASE						, attention_mask.sum(-1 ) ):
												snake_case_ :							Optional[int]         =				(vector - vector[:length].mean()) / np.sqrt(vector[:length].var() + 1e-7 )
												if length < normed_slice.shape[0]:
														snake_case_ :							List[str]         =				padding_value

												normed_input_values.append(_SCREAMING_SNAKE_CASE )
								else:
										snake_case_ :							List[str]         =				[(x - x.mean()) / np.sqrt(x.var() + 1e-7 ) for x in input_values]

								return normed_input_values






						def __call__(		self						, _SCREAMING_SNAKE_CASE						, _SCREAMING_SNAKE_CASE = False						, _SCREAMING_SNAKE_CASE = None						, _SCREAMING_SNAKE_CASE = False						, _SCREAMING_SNAKE_CASE = None						, _SCREAMING_SNAKE_CASE = None						, _SCREAMING_SNAKE_CASE = None						, _SCREAMING_SNAKE_CASE = None						, **_SCREAMING_SNAKE_CASE						, )       -> BatchFeature:

								if sampling_rate is not None:
										if sampling_rate != self.sampling_rate:
												raise ValueError(
												    f'''The model corresponding to this feature extractor: {self} was trained using a sampling rate of'''
												    f''' {self.sampling_rate}. Please make sure that the provided `raw_speech` input was sampled with'''
												    f''' {self.sampling_rate} and not {sampling_rate}.''' )
								else:
										logger.warning(
										    "It is strongly recommended to pass the ``sampling_rate`` argument to this function. "
										    "Failing to do so can result in silent errors that might be hard to debug." )

								snake_case_ :							Optional[Any]         =				isinstance(_SCREAMING_SNAKE_CASE						, np.ndarray ) and len(raw_speech.shape ) > 1
								if is_batched_numpy and len(raw_speech.shape ) > 2:
										raise ValueError(f'''Only mono-channel audio is supported for input to {self}''' )
								snake_case_ :							Tuple         =				is_batched_numpy or (
								    isinstance(_SCREAMING_SNAKE_CASE						, (list, tuple) ) and (isinstance(raw_speech[0]						, (np.ndarray, tuple, list) ))
								)

								# always return batch
								if not is_batched:
										snake_case_ :							List[str]         =				[raw_speech]

								# convert into correct format for padding
								snake_case_ :							List[Any]         =				BatchFeature({"input_values": raw_speech} )

								snake_case_ :							Dict         =				self.pad(
								    _SCREAMING_SNAKE_CASE						, padding=_SCREAMING_SNAKE_CASE						, max_length=_SCREAMING_SNAKE_CASE						, truncation=_SCREAMING_SNAKE_CASE						, pad_to_multiple_of=_SCREAMING_SNAKE_CASE						, return_attention_mask=_SCREAMING_SNAKE_CASE						, )

								# convert input values to correct format
								snake_case_ :							List[str]         =				padded_inputs["input_values"]
								if not isinstance(input_values[0]						, np.ndarray ):
										snake_case_ :							Union[str, Any]         =				[np.asarray(_SCREAMING_SNAKE_CASE						, dtype=np.floataa ) for array in input_values]
								elif (
								    not isinstance(_SCREAMING_SNAKE_CASE						, np.ndarray )
								    and isinstance(input_values[0]						, np.ndarray )
								    and input_values[0].dtype is np.dtype(np.floataa )
								):
										snake_case_ :							List[str]         =				[array.astype(np.floataa ) for array in input_values]
								elif isinstance(_SCREAMING_SNAKE_CASE						, np.ndarray ) and input_values.dtype is np.dtype(np.floataa ):
										snake_case_ :							Optional[int]         =				input_values.astype(np.floataa )

								# convert attention_mask to correct format
								snake_case_ :							Union[str, Any]         =				padded_inputs.get("attention_mask" )
								if attention_mask is not None:
										snake_case_ :							Tuple         =				[np.asarray(_SCREAMING_SNAKE_CASE						, dtype=np.intaa ) for array in attention_mask]

								# zero-mean and unit-variance normalization
								if self.do_normalize:
										snake_case_ :							Dict         =				(
										    attention_mask
										    if self._get_padding_strategies(_SCREAMING_SNAKE_CASE						, max_length=_SCREAMING_SNAKE_CASE ) is not PaddingStrategy.DO_NOT_PAD
										    else None
										)
										snake_case_ :							List[Any]         =				self.zero_mean_unit_var_norm(
										    padded_inputs["input_values"]						, attention_mask=_SCREAMING_SNAKE_CASE						, padding_value=self.padding_value )

								if return_tensors is not None:
										snake_case_ :							Dict         =				padded_inputs.convert_to_tensors(_SCREAMING_SNAKE_CASE )

								return padded_inputs








def    lowerCAmelCase__		(			_a				:	str     ,					_a				:	int = 13			):
		snake_case_ :							List[Any]         =				""
		for c in s:
				if "A" <= c <= "Z":
						out += chr(ord("A"			) + (ord(_a			) - ord("A"			) + n) % 26			)
				elif "a" <= c <= "z":
						out += chr(ord("a"			) + (ord(_a			) - ord("a"			) + n) % 26			)
				else:
						out += c
		return out

def    lowerCAmelCase__		(			):
		snake_case_ :							int         =				input("Enter message: "			)

		snake_case_ :							List[Any]         =				dencrypt(_a     ,					13			)
		print("Encryption:"     ,					_a			)

		snake_case_ :							int         =				dencrypt(_a     ,					13			)
		print("Decryption: "     ,					_a			)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							main()
