




'''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 			_snake_case		(     unittest.TestCase							):
			lowerCAmelCase_					:				Tuple							=   MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING




			def        lowerCAmelCase__    ( self    ,							a__    ,							a__    ,							a__							)    ->    List[str]:

										'''simple docstring'''




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




			def        lowerCAmelCase__    ( self    ,							a__    ,							a__							)    ->    Tuple:

										'''simple docstring'''




										for example in examples:
																	snake_case_      =				video_classifier(_UpperCamelCase							)

																	self.assertEqual(
																	    _UpperCamelCase    ,							[
																	        {"score": ANY(_UpperCamelCase							), "label": ANY(_UpperCamelCase							)},
																	        {"score": ANY(_UpperCamelCase							), "label": ANY(_UpperCamelCase							)},
																	    ]    ,							)




			@require_torch
			def        lowerCAmelCase__    ( self							)    ->    Any:

										'''simple docstring'''




										snake_case_      =				"""hf-internal-testing/tiny-random-VideoMAEForVideoClassification"""
										snake_case_      =				VideoMAEFeatureExtractor(
										    size={"shortest_edge": 10}    ,							crop_size={"height": 10, "width": 10}							)
										snake_case_      =				pipeline(
										    "video-classification"    ,							model=_UpperCamelCase    ,							feature_extractor=_UpperCamelCase    ,							frame_sampling_rate=4							)

										snake_case_      =				hf_hub_download(repo_id="nateraw/video-demo"    ,							filename="archery.mp4"    ,							repo_type="dataset"							)
										snake_case_      =				video_classifier(_UpperCamelCase    ,							top_k=2							)
										self.assertEqual(
										    nested_simplify(_UpperCamelCase    ,							decimals=4							)    ,							[{"score": 0.5_1_9_9, "label": "LABEL_0"}, {"score": 0.4_8_0_1, "label": "LABEL_1"}]    ,							)

										snake_case_      =				video_classifier(
										    [
										        video_file_path,
										        video_file_path,
										    ]    ,							top_k=2    ,							)
										self.assertEqual(
										    nested_simplify(_UpperCamelCase    ,							decimals=4							)    ,							[
										        [{"score": 0.5_1_9_9, "label": "LABEL_0"}, {"score": 0.4_8_0_1, "label": "LABEL_1"}],
										        [{"score": 0.5_1_9_9, "label": "LABEL_0"}, {"score": 0.4_8_0_1, "label": "LABEL_1"}],
										    ]    ,							)




			@require_tf
			def        lowerCAmelCase__    ( self							)    ->    Any:

										'''simple docstring'''




										pass










'''simple docstring'''





def 					UpperCamelCase_(     snake_case							:	int = 1_0_0_0					):

							'''simple docstring'''






							snake_case_      =				3
							snake_case_      =				0
							while a < n:
														if a % 3 == 0 or a % 5 == 0:
																					result += a
														elif a % 1_5 == 0:
																					result -= a
														a += 1
							return result


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




