




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


UpperCamelCase__            =     logging.get_logger(__name__)
class      a__       (   snake_case__ ):
						_a				:       Optional[Any]   =       ["""input_values""", """attention_mask"""]






						def __init__(  self						,     _A=1						,     _A=1_6_0_0_0						,     _A=0.0						,     _A=False						,     _A=True						,     **_A						,     ):




											"""simple docstring"""



											super().__init__(feature_size=__lowercase						,     sampling_rate=__lowercase						,     padding_value=__lowercase						,     **__lowercase     )
											__lowerCAmelCase							  =			return_attention_mask
											__lowerCAmelCase							  =			do_normalize






						@staticmethod
						def 							__SCREAMING_SNAKE_CASE(  _A						,     _A						,     _A = 0.0     ):




											"""simple docstring"""



											if attention_mask is not None:
																__lowerCAmelCase							  =			np.array(__lowercase						,     np.intaa     )
																__lowerCAmelCase							  =			[]

																for vector, length in zip(__lowercase						,     attention_mask.sum(-1     )     ):
																					__lowerCAmelCase							  =			(vector - vector[:length].mean()) / np.sqrt(vector[:length].var() + 1E-7     )
																					if length < normed_slice.shape[0]:
																										__lowerCAmelCase							  =			padding_value

																					normed_input_values.append(__lowercase     )
											else:
																__lowerCAmelCase							  =			[(x - x.mean()) / np.sqrt(x.var() + 1E-7     ) for x in input_values]

											return normed_input_values






						def __call__(  self						,     _A						,     _A = False						,     _A = None						,     _A = False						,     _A = None						,     _A = None						,     _A = None						,     _A = None						,     **_A						,     ):




											"""simple docstring"""



											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."     )

											__lowerCAmelCase							  =			isinstance(__lowercase						,     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}"""     )
											__lowerCAmelCase							  =			is_batched_numpy or (
											    isinstance(__lowercase						,     (list, tuple)     ) and (isinstance(raw_speech[0]						,     (np.ndarray, tuple, list)     ))
											)

											# always return batch
											if not is_batched:
																__lowerCAmelCase							  =			[raw_speech]

											# convert into correct format for padding
											__lowerCAmelCase							  =			BatchFeature({"input_values": raw_speech}     )

											__lowerCAmelCase							  =			self.pad(
											    __lowercase						,     padding=__lowercase						,     max_length=__lowercase						,     truncation=__lowercase						,     pad_to_multiple_of=__lowercase						,     return_attention_mask=__lowercase						,     )

											# convert input values to correct format
											__lowerCAmelCase							  =			padded_inputs['input_values']
											if not isinstance(input_values[0]						,     np.ndarray     ):
																__lowerCAmelCase							  =			[np.asarray(__lowercase						,     dtype=np.floataa     ) for array in input_values]
											elif (
											    not isinstance(__lowercase						,     np.ndarray     )
											    and isinstance(input_values[0]						,     np.ndarray     )
											    and input_values[0].dtype is np.dtype(np.floataa     )
											):
																__lowerCAmelCase							  =			[array.astype(np.floataa     ) for array in input_values]
											elif isinstance(__lowercase						,     np.ndarray     ) and input_values.dtype is np.dtype(np.floataa     ):
																__lowerCAmelCase							  =			input_values.astype(np.floataa     )

											# convert attention_mask to correct format
											__lowerCAmelCase							  =			padded_inputs.get("attention_mask"     )
											if attention_mask is not None:
																__lowerCAmelCase							  =			[np.asarray(__lowercase						,     dtype=np.intaa     ) for array in attention_mask]

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

											if return_tensors is not None:
																__lowerCAmelCase							  =			padded_inputs.convert_to_tensors(__lowercase     )

											return padded_inputs










def    snake_case   (				A		,  A     )				->				int:




	'''simple docstring'''


	if a < b:
		return gcd(A		,  A     )
	if a % b == 0:
		return b
	return gcd(A		,  a % b     )






def    snake_case   (				A		,  A		,  A     )				->				int:




	'''simple docstring'''


	if y == 0:
		return 1
	lowerCamelCase_				:						int				  =				power(A		,  y // 2		,  A     ) % mod
	lowerCamelCase_				:						List[Any]				  =				(temp * temp) % mod
	if y % 2 == 1:
		lowerCamelCase_				:						str				  =				(temp * x) % mod
	return temp






def    snake_case   (				A     )				->				bool:




	'''simple docstring'''


	lowerCamelCase_				:						Union[str, Any]				  =				2
	while b < n:
		if gcd(A		,  A     ) == 1 and power(A		,  n - 1		,  A     ) != 1:
			return False
		b += 1
	return True


if __name__ == "__main__":
							UpperCamelCase__						=		int(input('Enter number: ').strip())
							if is_carmichael_number(number):
														print(F'{number} is a Carmichael Number.')
							else:
														print(F'{number} is not a Carmichael Number.')
