
"""simple docstring"""


import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_video_inputs


if is_torch_available():
			import torch

if is_vision_available():
			from PIL import Image

			from transformers import VideoMAEImageProcessor







class 		lowerCamelCase__					(					unittest.TestCase				):





			'''simple docstring'''



			def __init__(							self     ,     __UpperCAmelCase     ,     __UpperCAmelCase=7     ,     __UpperCAmelCase=3     ,     __UpperCAmelCase=10     ,     __UpperCAmelCase=18     ,     __UpperCAmelCase=30     ,     __UpperCAmelCase=4_00     ,     __UpperCAmelCase=True     ,     __UpperCAmelCase=None     ,     __UpperCAmelCase=True     ,     __UpperCAmelCase=[0.5, 0.5, 0.5]     ,     __UpperCAmelCase=[0.5, 0.5, 0.5]     ,     __UpperCAmelCase=None     ,     ) ->     str:
				_lowerCAmelCase								=size if size is not None else {"""shortest_edge""": 18}
				_lowerCAmelCase								=crop_size if crop_size is not None else {"""height""": 18, """width""": 18}

				_lowerCAmelCase								=parent
				_lowerCAmelCase								=batch_size
				_lowerCAmelCase								=num_channels
				_lowerCAmelCase								=num_frames
				_lowerCAmelCase								=image_size
				_lowerCAmelCase								=min_resolution
				_lowerCAmelCase								=max_resolution
				_lowerCAmelCase								=do_resize
				_lowerCAmelCase								=size
				_lowerCAmelCase								=do_normalize
				_lowerCAmelCase								=image_mean
				_lowerCAmelCase								=image_std
				_lowerCAmelCase								=crop_size



			def 					_lowerCAmelCase		(							self  ) ->     Union[str, Any]:
				return {
				    "image_mean": self.image_mean,
				    "image_std": self.image_std,
				    "do_normalize": self.do_normalize,
				    "do_resize": self.do_resize,
				    "size": self.size,
				    "crop_size": self.crop_size,
				}







@require_torch
@require_vision
class 		lowerCamelCase__					(					__magic_name__ ,	unittest.TestCase				):





			'''simple docstring'''
			lowerCamelCase  					=		VideoMAEImageProcessor if is_vision_available() else None



			def 					_lowerCAmelCase		(							self  ) ->     List[Any]:
				_lowerCAmelCase								=VideoMAEImageProcessingTester(self  )



			@property
			def 					_lowerCAmelCase		(							self  ) ->     List[Any]:
				return self.image_processor_tester.prepare_image_processor_dict()



			def 					_lowerCAmelCase		(							self  ) ->     List[str]:
				_lowerCAmelCase								=self.image_processing_class(**self.image_processor_dict  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """image_mean"""  )  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """image_std"""  )  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """do_normalize"""  )  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """do_resize"""  )  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """do_center_crop"""  )  )
				self.assertTrue(hasattr(__UpperCAmelCase     ,     """size"""  )  )



			def 					_lowerCAmelCase		(							self  ) ->     Any:
				_lowerCAmelCase								=self.image_processing_class.from_dict(self.image_processor_dict  )
				self.assertEqual(image_processor.size     ,     {"""shortest_edge""": 18}  )
				self.assertEqual(image_processor.crop_size     ,     {"""height""": 18, """width""": 18}  )

				_lowerCAmelCase								=self.image_processing_class.from_dict(self.image_processor_dict     ,     size=42     ,     crop_size=84  )
				self.assertEqual(image_processor.size     ,     {"""shortest_edge""": 42}  )
				self.assertEqual(image_processor.crop_size     ,     {"""height""": 84, """width""": 84}  )



			def 					_lowerCAmelCase		(							self  ) ->     List[Any]:
				pass



			def 					_lowerCAmelCase		(							self  ) ->     Union[str, Any]:
				# Initialize image_processing
				_lowerCAmelCase								=self.image_processing_class(**self.image_processor_dict  )
				# create random PIL videos
				_lowerCAmelCase								=prepare_video_inputs(self.image_processor_tester     ,     equal_resolution=__UpperCAmelCase  )
				for video in video_inputs:
					self.assertIsInstance(__UpperCAmelCase     ,     __UpperCAmelCase  )
					self.assertIsInstance(video[0]     ,     Image.Image  )

				# Test not batched input
				_lowerCAmelCase								=image_processing(video_inputs[0]     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        1,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )

				# Test batched
				_lowerCAmelCase								=image_processing(__UpperCAmelCase     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )



			def 					_lowerCAmelCase		(							self  ) ->     str:
				# Initialize image_processing
				_lowerCAmelCase								=self.image_processing_class(**self.image_processor_dict  )
				# create random numpy tensors
				_lowerCAmelCase								=prepare_video_inputs(self.image_processor_tester     ,     equal_resolution=__UpperCAmelCase     ,     numpify=__UpperCAmelCase  )
				for video in video_inputs:
					self.assertIsInstance(__UpperCAmelCase     ,     __UpperCAmelCase  )
					self.assertIsInstance(video[0]     ,     np.ndarray  )

				# Test not batched input
				_lowerCAmelCase								=image_processing(video_inputs[0]     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        1,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )

				# Test batched
				_lowerCAmelCase								=image_processing(__UpperCAmelCase     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )



			def 					_lowerCAmelCase		(							self  ) ->     Dict:
				# Initialize image_processing
				_lowerCAmelCase								=self.image_processing_class(**self.image_processor_dict  )
				# create random PyTorch tensors
				_lowerCAmelCase								=prepare_video_inputs(self.image_processor_tester     ,     equal_resolution=__UpperCAmelCase     ,     torchify=__UpperCAmelCase  )
				for video in video_inputs:
					self.assertIsInstance(__UpperCAmelCase     ,     __UpperCAmelCase  )
					self.assertIsInstance(video[0]     ,     torch.Tensor  )

				# Test not batched input
				_lowerCAmelCase								=image_processing(video_inputs[0]     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        1,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )

				# Test batched
				_lowerCAmelCase								=image_processing(__UpperCAmelCase     ,     return_tensors="""pt"""  ).pixel_values
				self.assertEqual(
				    encoded_videos.shape     ,     (
				        self.image_processor_tester.batch_size,
				        self.image_processor_tester.num_frames,
				        self.image_processor_tester.num_channels,
				        self.image_processor_tester.crop_size["""height"""],
				        self.image_processor_tester.crop_size["""width"""],
				    )     ,     )





"""simple docstring"""


import itertools



def     _lowerCamelCase(__UpperCamelCase       )				-> List[str]:
	return (
	    int("""""".join(combination[0:2]       )       ) * int("""""".join(combination[2:5]       )       )
	    == int("""""".join(combination[5:9]       )       )
	) or (
	    int("""""".join(combination[0]       )       ) * int("""""".join(combination[1:5]       )       )
	    == int("""""".join(combination[5:9]       )       )
	)



def     _lowerCamelCase()				-> Dict:
	return sum(
	    {
	        int("""""".join(pandigital[5:9]       )       )
	        for pandigital in itertools.permutations("""123456789"""       )
	        if is_combination_valid(__UpperCamelCase       )
	    }       )


if __name__ == "__main__":
			print(solution())



