"""simple docstring"""







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


_a					:					Tuple=			random.Random()

if is_torch_available():
	import torch
def   __UpperCAmelCase    (   UpperCAmelCase_   :    Any      ,							UpperCAmelCase_   :    Dict=1.0      ,							UpperCAmelCase_   :    Tuple=None      ,							UpperCAmelCase_   :    Optional[int]=None  )							->      List[Any]:

	'''simple docstring'''





	if rng is None:
		__snake_case      :							List[Any]						=			global_rng

	__snake_case      :							Optional[Any]						=			[]
	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						):



				def __init__(self    :				int     ,  _A    :				Any     ,  _A    :				int=7     ,  _A    :				int=4_00     ,  _A    :				Any=20_00     ,  _A    :				Tuple=1     ,  _A    :				Tuple=0.0     ,  _A    :				List[str]=1_60_00     ,  _A    :				Tuple=True     ,  _A    :				Optional[int]=True     ,  )   ->     Tuple:
					__snake_case      :							Optional[Any]						=			parent
					__snake_case      :							Tuple						=			batch_size
					__snake_case      :							Optional[Any]						=			min_seq_length
					__snake_case      :							List[str]						=			max_seq_length
					__snake_case      :							int						=			(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
					__snake_case      :							Union[str, Any]						=			feature_size
					__snake_case      :							Optional[Any]						=			padding_value
					__snake_case      :							Optional[int]						=			sampling_rate
					__snake_case      :							Tuple						=			return_attention_mask
					__snake_case      :							Any						=			do_normalize



				def  _lowercase					(self    :				List[Any])   ->     Any:
					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  _lowercase					(self    :				Optional[Any]     ,  _A    :				Any=False     ,  _A    :				int=False)   ->     Union[str, Any]:
					def _flatten(_A    :				int):
						return list(itertools.chain(*_A))

					if equal_length:
						__snake_case      :							str						=			floats_list((self.batch_size, self.max_seq_length))
					else:
						# make sure that inputs increase in size
						__snake_case      :							Union[str, Any]						=			[
						    _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:
						__snake_case      :							Any						=			[np.asarray(_A) for x in speech_inputs]

					return speech_inputs







@require_torch
@require_torchaudio
class 		UpperCamelCase      (   lowercase				,     unittest.TestCase						):
				UpperCAmelCase    :				List[Any]   =		ASTFeatureExtractor



				def  _lowercase					(self    :				Optional[int])   ->     Optional[int]:
					__snake_case      :							int						=			ASTFeatureExtractionTester(self)



				def  _lowercase					(self    :				Dict)   ->     Tuple:
					# Tests that all call wrap to encode_plus and batch_encode_plus
					__snake_case      :							List[Any]						=			self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
					# create three inputs of length 800, 1000, and 1200
					__snake_case      :							Union[str, Any]						=			[floats_list((1, x))[0] for x in range(8_00     ,  14_00     ,  2_00)]
					__snake_case      :							List[str]						=			[np.asarray(_A) for speech_input in speech_inputs]

					# Test not batched input
					__snake_case      :							Union[str, Any]						=			feat_extract(speech_inputs[0]     ,  return_tensors='np').input_values
					__snake_case      :							int						=			feat_extract(np_speech_inputs[0]     ,  return_tensors='np').input_values
					self.assertTrue(np.allclose(_A     ,  _A     ,  atol=1E-3))

					# Test batched
					__snake_case      :							Tuple						=			feat_extract(_A     ,  padding=_A     ,  return_tensors='np').input_values
					__snake_case      :							Union[str, Any]						=			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.
					__snake_case      :							Union[str, Any]						=			[floats_list((1, x))[0] for x in (8_00, 8_00, 8_00)]
					__snake_case      :							Dict						=			np.asarray(_A)
					__snake_case      :							Optional[int]						=			feat_extract(_A     ,  return_tensors='np').input_values
					__snake_case      :							List[str]						=			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  _lowercase					(self    :				List[Any])   ->     str:
					import torch

					__snake_case      :							Optional[Any]						=			self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict())
					__snake_case      :							str						=			np.random.rand(1_00).astype(np.floataa)
					__snake_case      :							Dict						=			np_speech_inputs.tolist()

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



				def  _lowercase					(self    :				List[str]     ,  _A    :				Dict)   ->     List[str]:
					from datasets import load_dataset

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

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






				@require_torch
				def  _lowercase					(self    :				int)   ->     Dict:
					# fmt: off
					__snake_case      :							Tuple						=			torch.tensor(
					    [-0.9_894, -1.2_776, -0.9_066, -1.2_776, -0.9_349, -1.2_609, -1.0_386, -1.2_776,
					     -1.1_561, -1.2_776, -1.2_052, -1.2_723, -1.2_190, -1.2_132, -1.2_776, -1.1_133,
					     -1.1_953, -1.1_343, -1.1_584, -1.2_203, -1.1_770, -1.2_474, -1.2_381, -1.1_936,
					     -0.9_270, -0.8_317, -0.8_049, -0.7_706, -0.7_565, -0.7_869])
					# fmt: on

					__snake_case      :							int						=			self._load_datasamples(1)
					__snake_case      :							Dict						=			ASTFeatureExtractor()
					__snake_case      :							Union[str, Any]						=			feature_extractor(_A     ,  return_tensors='pt').input_values
					self.assertEquals(input_values.shape     ,  (1, 10_24, 1_28))
					self.assertTrue(torch.allclose(input_values[0, 0, :30]     ,  _A     ,  atol=1E-4))






"""simple docstring"""







from __future__ import annotations

import math
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      bool:

	'''simple docstring'''





	if 1 < number < 4:
		# 2 and 3 are primes
		return True
	elif number < 2 or number % 2 == 0 or number % 3 == 0:
		# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
		return False

	# All primes number are in format of 6k +/- 1
	for i in range(5      ,							int(math.sqrt(UpperCAmelCase_  ) + 1  )      ,							6  ):
		if number % i == 0 or number % (i + 2) == 0:
			return False
	return True


_a					:					Any=			[num for num in range(3, 100_001, 2) if not is_prime(num)]
def   __UpperCAmelCase    (   UpperCAmelCase_   :    int  )							->      list[int]:

	'''simple docstring'''





	if not isinstance(UpperCAmelCase_      ,							UpperCAmelCase_  ):
		raise ValueError('n must be an integer'  )
	if n <= 0:
		raise ValueError('n must be >= 0'  )

	__snake_case      :							int						=			[]
	for num in range(len(UpperCAmelCase_  )  ):
		__snake_case      :							List[str]						=			0
		while 2 * i * i <= odd_composites[num]:
			__snake_case      :							List[Any]						=			odd_composites[num] - 2 * i * i
			if is_prime(UpperCAmelCase_  ):
				break
			i += 1
		else:
			list_nums.append(odd_composites[num]  )
			if len(UpperCAmelCase_  ) == n:
				return list_nums

	return []
def   __UpperCAmelCase    (   )							->      int:

	'''simple docstring'''





	return compute_nums(1  )[0]


if __name__ == "__main__":
	print(f'''{solution() = }''')





