
'''simple docstring'''







import unittest

from huggingface_hub import hf_hub_download

from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VideoMAEFeatureExtractor
from transformers.pipelines import VideoClassificationPipeline, pipeline
from transformers.testing_utils import (
    is_pipeline_test,
    nested_simplify,
    require_decord,
    require_tf,
    require_torch,
    require_torch_or_tf,
    require_vision,
)

from .test_pipelines_common import ANY






@is_pipeline_test
@require_torch_or_tf
@require_vision
@require_decord
class  lowerCAmelCase__   (  unittest.TestCase     ):
					lowerCAmelCase_        =     MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											lowercase_	:     Any													=       hf_hub_download(
											    repo_id='''nateraw/video-demo'''				,							filename='''archery.mp4'''				,							repo_type='''dataset'''		)
											lowercase_	:     Optional[Any]													=       VideoClassificationPipeline(model=__SCREAMING_SNAKE_CASE				,							image_processor=__SCREAMING_SNAKE_CASE				,							top_k=2		)
											lowercase_	:     Optional[Any]													=       [
											    example_video_filepath,
											    '''https://huggingface.co/datasets/nateraw/video-demo/resolve/main/archery.mp4''',
											]
											return video_classifier, examples






					def 	_snake_case    (   self				,							__SCREAMING_SNAKE_CASE				,							__SCREAMING_SNAKE_CASE		):


											"""simple docstring"""





											for example in examples:
																	lowercase_	:     Tuple													=       video_classifier(__SCREAMING_SNAKE_CASE		)

																	self.assertEqual(
																	    __SCREAMING_SNAKE_CASE				,							[
																	        {'''score''': ANY(__SCREAMING_SNAKE_CASE		), '''label''': ANY(__SCREAMING_SNAKE_CASE		)},
																	        {'''score''': ANY(__SCREAMING_SNAKE_CASE		), '''label''': ANY(__SCREAMING_SNAKE_CASE		)},
																	    ]				,							)






					@require_torch
					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     Dict													=       '''hf-internal-testing/tiny-random-VideoMAEForVideoClassification'''
											lowercase_	:     str													=       VideoMAEFeatureExtractor(
											    size={'''shortest_edge''': 10}				,							crop_size={'''height''': 10, '''width''': 10}		)
											lowercase_	:     List[Any]													=       pipeline(
											    '''video-classification'''				,							model=__SCREAMING_SNAKE_CASE				,							feature_extractor=__SCREAMING_SNAKE_CASE				,							frame_sampling_rate=4		)

											lowercase_	:     List[Any]													=       hf_hub_download(repo_id='''nateraw/video-demo'''				,							filename='''archery.mp4'''				,							repo_type='''dataset'''		)
											lowercase_	:     Optional[int]													=       video_classifier(__SCREAMING_SNAKE_CASE				,							top_k=2		)
											self.assertEqual(
											    nested_simplify(__SCREAMING_SNAKE_CASE				,							decimals=4		)				,							[{'''score''': 0.5_199, '''label''': '''LABEL_0'''}, {'''score''': 0.4_801, '''label''': '''LABEL_1'''}]				,							)

											lowercase_	:     Dict													=       video_classifier(
											    [
											        video_file_path,
											        video_file_path,
											    ]				,							top_k=2				,							)
											self.assertEqual(
											    nested_simplify(__SCREAMING_SNAKE_CASE				,							decimals=4		)				,							[
											        [{'''score''': 0.5_199, '''label''': '''LABEL_0'''}, {'''score''': 0.4_801, '''label''': '''LABEL_1'''}],
											        [{'''score''': 0.5_199, '''label''': '''LABEL_0'''}, {'''score''': 0.4_801, '''label''': '''LABEL_1'''}],
											    ]				,							)






					@require_tf
					def 	_snake_case    (   self		):


											"""simple docstring"""





											pass





'''simple docstring'''







from math import isqrt, loga
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int							):



						"""simple docstring"""





						lowercase_	:     Any													=       [True] * max_number
						for i in range(2      ,      isqrt(max_number - 1							) + 1							):
												if is_prime[i]:
																		for j in range(i**2      ,      __SCREAMING_SNAKE_CASE      ,      __SCREAMING_SNAKE_CASE							):
																								lowercase_	:     Optional[Any]													=       False

						return [i for i in range(2      ,      __SCREAMING_SNAKE_CASE							) if is_prime[i]]
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: int = 800800      ,      __SCREAMING_SNAKE_CASE					: int = 800800							):



						"""simple docstring"""





						lowercase_	:     Union[str, Any]													=       degree * loga(__SCREAMING_SNAKE_CASE							)
						lowercase_	:     Any													=       int(__SCREAMING_SNAKE_CASE							)
						lowercase_	:     Optional[Any]													=       calculate_prime_numbers(__SCREAMING_SNAKE_CASE							)

						lowercase_	:     Optional[Any]													=       0
						lowercase_	:     List[Any]													=       0
						lowercase_	:     Union[str, Any]													=       len(__SCREAMING_SNAKE_CASE							) - 1
						while left < right:
												while (
												    prime_numbers[right] * loga(prime_numbers[left]							)
												    + prime_numbers[left] * loga(prime_numbers[right]							)
												    > upper_bound
												):
																		right -= 1
												hybrid_integers_count += right - left
												left += 1

						return hybrid_integers_count


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



