



import random






def      __lowercase       (			a__       )    ->			bool:
							__SCREAMING_SNAKE_CASE									= num - 1
							__SCREAMING_SNAKE_CASE									= 0

							while s % 2 == 0:
														__SCREAMING_SNAKE_CASE									= s // 2
														t += 1

							for _ in range(5       ):
														__SCREAMING_SNAKE_CASE									= random.randrange(2							,       num - 1       )
														__SCREAMING_SNAKE_CASE									= pow(a__							,       a__							,       a__       )
														if v != 1:
																					__SCREAMING_SNAKE_CASE									= 0
																					while v != (num - 1):
																												if i == t - 1:
																																			return False
																												else:
																																			__SCREAMING_SNAKE_CASE									= i + 1
																																			__SCREAMING_SNAKE_CASE									= (v**2) % num
							return True






def      __lowercase       (			a__       )    ->			bool:
							if num < 2:
														return False

							__SCREAMING_SNAKE_CASE									= [
							    2,
							    3,
							    5,
							    7,
							    11,
							    13,
							    17,
							    19,
							    23,
							    29,
							    31,
							    37,
							    41,
							    43,
							    47,
							    53,
							    59,
							    61,
							    67,
							    71,
							    73,
							    79,
							    83,
							    89,
							    97,
							    1_01,
							    1_03,
							    1_07,
							    1_09,
							    1_13,
							    1_27,
							    1_31,
							    1_37,
							    1_39,
							    1_49,
							    1_51,
							    1_57,
							    1_63,
							    1_67,
							    1_73,
							    1_79,
							    1_81,
							    1_91,
							    1_93,
							    1_97,
							    1_99,
							    2_11,
							    2_23,
							    2_27,
							    2_29,
							    2_33,
							    2_39,
							    2_41,
							    2_51,
							    2_57,
							    2_63,
							    2_69,
							    2_71,
							    2_77,
							    2_81,
							    2_83,
							    2_93,
							    3_07,
							    3_11,
							    3_13,
							    3_17,
							    3_31,
							    3_37,
							    3_47,
							    3_49,
							    3_53,
							    3_59,
							    3_67,
							    3_73,
							    3_79,
							    3_83,
							    3_89,
							    3_97,
							    4_01,
							    4_09,
							    4_19,
							    4_21,
							    4_31,
							    4_33,
							    4_39,
							    4_43,
							    4_49,
							    4_57,
							    4_61,
							    4_63,
							    4_67,
							    4_79,
							    4_87,
							    4_91,
							    4_99,
							    5_03,
							    5_09,
							    5_21,
							    5_23,
							    5_41,
							    5_47,
							    5_57,
							    5_63,
							    5_69,
							    5_71,
							    5_77,
							    5_87,
							    5_93,
							    5_99,
							    6_01,
							    6_07,
							    6_13,
							    6_17,
							    6_19,
							    6_31,
							    6_41,
							    6_43,
							    6_47,
							    6_53,
							    6_59,
							    6_61,
							    6_73,
							    6_77,
							    6_83,
							    6_91,
							    7_01,
							    7_09,
							    7_19,
							    7_27,
							    7_33,
							    7_39,
							    7_43,
							    7_51,
							    7_57,
							    7_61,
							    7_69,
							    7_73,
							    7_87,
							    7_97,
							    8_09,
							    8_11,
							    8_21,
							    8_23,
							    8_27,
							    8_29,
							    8_39,
							    8_53,
							    8_57,
							    8_59,
							    8_63,
							    8_77,
							    8_81,
							    8_83,
							    8_87,
							    9_07,
							    9_11,
							    9_19,
							    9_29,
							    9_37,
							    9_41,
							    9_47,
							    9_53,
							    9_67,
							    9_71,
							    9_77,
							    9_83,
							    9_91,
							    9_97,
							]

							if num in low_primes:
														return True

							for prime in low_primes:
														if (num % prime) == 0:
																					return False

							return rabin_miller(a__       )






def      __lowercase       (			a__ = 10_24       )    ->			int:
							while True:
														__SCREAMING_SNAKE_CASE									= random.randrange(2 ** (keysize - 1)							,       2 ** (keysize)       )
														if is_prime_low_num(a__       ):
																					return num


if __name__ == "__main__":
			lowerCAmelCase__		:					Dict							=generate_large_prime()
			print(('''Prime number:''', num))
			print(('''is_prime_low_num:''', is_prime_low_num(num)))











import itertools
import random
import unittest

import numpy as np

from transformers import ASTFeatureExtractor
from transformers.testing_utils import require_torch, require_torchaudio
from transformers.utils.import_utils import is_torch_available

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


lowerCAmelCase__		:					Dict							=random.Random()

if is_torch_available():
			import torch






def      __lowercase       (			a__							,       a__=1.0							,       a__=None							,       a__=None       )    ->			Any:
							if rng is None:
														__SCREAMING_SNAKE_CASE									= global_rng

							__SCREAMING_SNAKE_CASE									= []
							for batch_idx in range(shape[0]       ):
														values.append([]       )
														for _ in range(shape[1]       ):
																					values[-1].append(rng.random() * scale       )

							return values

class        UpperCAmelCase_  (       unittest.TestCase	):

						'''simple docstring'''




						def __init__(   self				,							_A				,							_A=7				,							_A=400				,							_A=2_000				,							_A=1				,							_A=0.0				,							_A=16_000				,							_A=True				,							_A=True				,							):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= parent
													__SCREAMING_SNAKE_CASE									= batch_size
													__SCREAMING_SNAKE_CASE									= min_seq_length
													__SCREAMING_SNAKE_CASE									= max_seq_length
													__SCREAMING_SNAKE_CASE									= (self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
													__SCREAMING_SNAKE_CASE									= feature_size
													__SCREAMING_SNAKE_CASE									= padding_value
													__SCREAMING_SNAKE_CASE									= sampling_rate
													__SCREAMING_SNAKE_CASE									= return_attention_mask
													__SCREAMING_SNAKE_CASE									= do_normalize






						def 	_A     (   self		):







													'''simple docstring'''

													return {
													    "feature_size": self.feature_size,
													    "padding_value": self.padding_value,
													    "sampling_rate": self.sampling_rate,
													    "return_attention_mask": self.return_attention_mask,
													    "do_normalize": self.do_normalize,
													}






						def 	_A     (   self				,							_A=False				,							_A=False		):







													'''simple docstring'''

													def _flatten(_A		):
																				return list(itertools.chain(*_A		)		)

													if equal_length:
																				__SCREAMING_SNAKE_CASE									= floats_list((self.batch_size, self.max_seq_length)		)
													else:
																				# make sure that inputs increase in size
																				__SCREAMING_SNAKE_CASE									= [
																				    _flatten(floats_list((x, self.feature_size)		)		)
																				    for x in range(self.min_seq_length				,							self.max_seq_length				,							self.seq_length_diff		)
																				]

													if numpify:
																				__SCREAMING_SNAKE_CASE									= [np.asarray(_A		) for x in speech_inputs]

													return speech_inputs







@require_torch
@require_torchaudio
class        UpperCAmelCase_  (       UpperCamelCase_   ,   unittest.TestCase	):

						'''simple docstring'''




						UpperCamelCase__      :			Optional[int]      =  ASTFeatureExtractor






						def 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= ASTFeatureExtractionTester(self		)






						def 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()		)
													# create three inputs of length 800, 1000, and 1200
													__SCREAMING_SNAKE_CASE									= [floats_list((1, x)		)[0] for x in range(800				,							1_400				,							200		)]
													__SCREAMING_SNAKE_CASE									= [np.asarray(_A		) for speech_input in speech_inputs]

													# Test not batched input
													__SCREAMING_SNAKE_CASE									= feat_extract(speech_inputs[0]				,							return_tensors='np'		).input_values
													__SCREAMING_SNAKE_CASE									= feat_extract(np_speech_inputs[0]				,							return_tensors='np'		).input_values
													self.assertTrue(np.allclose(_A				,							_A				,							atol=1e-3		)		)

													# Test batched
													__SCREAMING_SNAKE_CASE									= feat_extract(_A				,							padding=_A				,							return_tensors='np'		).input_values
													__SCREAMING_SNAKE_CASE									= feat_extract(_A				,							padding=_A				,							return_tensors='np'		).input_values
													for enc_seq_a, enc_seq_a in zip(_A				,							_A		):
																				self.assertTrue(np.allclose(_A				,							_A				,							atol=1e-3		)		)

													# Test 2-D numpy arrays are batched.
													__SCREAMING_SNAKE_CASE									= [floats_list((1, x)		)[0] for x in (800, 800, 800)]
													__SCREAMING_SNAKE_CASE									= np.asarray(_A		)
													__SCREAMING_SNAKE_CASE									= feat_extract(_A				,							return_tensors='np'		).input_values
													__SCREAMING_SNAKE_CASE									= feat_extract(_A				,							return_tensors='np'		).input_values
													for enc_seq_a, enc_seq_a in zip(_A				,							_A		):
																				self.assertTrue(np.allclose(_A				,							_A				,							atol=1e-3		)		)






						@require_torch
						def 	_A     (   self		):







													'''simple docstring'''

													import torch

													__SCREAMING_SNAKE_CASE									= self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()		)
													__SCREAMING_SNAKE_CASE									= np.random.rand(100		).astype(np.floataa		)
													__SCREAMING_SNAKE_CASE									= np_speech_inputs.tolist()

													for inputs in [py_speech_inputs, np_speech_inputs]:
																				__SCREAMING_SNAKE_CASE									= feature_extractor.pad([{'input_values': inputs}]				,							return_tensors='np'		)
																				self.assertTrue(np_processed.input_values.dtype == np.floataa		)
																				__SCREAMING_SNAKE_CASE									= feature_extractor.pad([{'input_values': inputs}]				,							return_tensors='pt'		)
																				self.assertTrue(pt_processed.input_values.dtype == torch.floataa		)






						def 	_A     (   self				,							_A		):







													'''simple docstring'''

													from datasets import load_dataset

													__SCREAMING_SNAKE_CASE									= load_dataset('hf-internal-testing/librispeech_asr_dummy'				,							'clean'				,							split='validation'		)
													# automatic decoding with librispeech
													__SCREAMING_SNAKE_CASE									= ds.sort('id'		).select(range(_A		)		)[:num_samples]['audio']

													return [x["array"] for x in speech_samples]






						@require_torch
						def 	_A     (   self		):







													'''simple docstring'''

													__SCREAMING_SNAKE_CASE									= torch.tensor(
													    [-0.9_8_9_4, -1.2_7_7_6, -0.9_0_6_6, -1.2_7_7_6, -0.9_3_4_9, -1.2_6_0_9, -1.0_3_8_6, -1.2_7_7_6,
													     -1.1_5_6_1, -1.2_7_7_6, -1.2_0_5_2, -1.2_7_2_3, -1.2_1_9_0, -1.2_1_3_2, -1.2_7_7_6, -1.1_1_3_3,
													     -1.1_9_5_3, -1.1_3_4_3, -1.1_5_8_4, -1.2_2_0_3, -1.1_7_7_0, -1.2_4_7_4, -1.2_3_8_1, -1.1_9_3_6,
													     -0.9_2_7_0, -0.8_3_1_7, -0.8_0_4_9, -0.7_7_0_6, -0.7_5_6_5, -0.7_8_6_9]		)
													# fmt: on

													__SCREAMING_SNAKE_CASE									= self._load_datasamples(1		)
													__SCREAMING_SNAKE_CASE									= ASTFeatureExtractor()
													__SCREAMING_SNAKE_CASE									= feature_extractor(_A				,							return_tensors='pt'		).input_values
													self.assertEquals(input_values.shape				,							(1, 1_024, 128)		)
													self.assertTrue(torch.allclose(input_values[0, 0, :30]				,							_A				,							atol=1e-4		)		)






