'''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 						A   (   unittest.TestCase   ):
							a_        =      MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING





							def       snake_case__						(      self				:							List[str]     ,		__a				:							Tuple     ,		__a				:							List[str]     ,		__a				:							List[Any]	)							->	Optional[Any]:
								__UpperCAmelCase							=			hf_hub_download(
								    repo_id='''nateraw/video-demo'''     ,		filename='''archery.mp4'''     ,		repo_type='''dataset'''	)
								__UpperCAmelCase							=			VideoClassificationPipeline(model=_a     ,		image_processor=_a     ,		top_k=2	)
								__UpperCAmelCase							=			[
								    example_video_filepath,
								    """https://huggingface.co/datasets/nateraw/video-demo/resolve/main/archery.mp4""",
								]
								return video_classifier, examples





							def       snake_case__						(      self				:							int     ,		__a				:							Any     ,		__a				:							Optional[Any]	)							->	str:
								for example in examples:
									__UpperCAmelCase							=			video_classifier(_a	)

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





							@require_torch
							def       snake_case__						(      self				:							str	)							->	Dict:
								__UpperCAmelCase							=			"""hf-internal-testing/tiny-random-VideoMAEForVideoClassification"""
								__UpperCAmelCase							=			VideoMAEFeatureExtractor(
								    size={'''shortest_edge''': 1_0}     ,		crop_size={'''height''': 1_0, '''width''': 1_0}	)
								__UpperCAmelCase							=			pipeline(
								    '''video-classification'''     ,		model=_a     ,		feature_extractor=_a     ,		frame_sampling_rate=4	)

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

								__UpperCAmelCase							=			video_classifier(
								    [
								        video_file_path,
								        video_file_path,
								    ]     ,		top_k=2     ,		)
								self.assertEqual(
								    nested_simplify(_a     ,		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       snake_case__						(      self				:							Union[str, Any]	)							->	Dict:
								pass






'''simple docstring'''


import requests
from bsa import BeautifulSoup





def       lowerCAmelCase					(		UpperCamelCase__				:   str = "AAPL"       ):


	"""simple docstring"""
	__UpperCAmelCase							=			f"""https://in.finance.yahoo.com/quote/{symbol}?s={symbol}"""
	__UpperCAmelCase							=			BeautifulSoup(requests.get(UpperCamelCase__       ).text    ,					'''html.parser'''       )
	__UpperCAmelCase							=			'''My(6px) Pos(r) smartphone_Mt(6px)'''
	return soup.find('''div'''    ,					class_=class_       ).find('''span'''       ).text


if __name__ == "__main__":
					for symbol in "AAPL AMZN IBM GOOG MSFT ORCL".split():
										print(F"""Current {symbol:<4} stock price is {stock_price(symbol):>8}""")
