





"""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 	__a   (  unittest.TestCase		):



     def __init__(       self					,     a__					,     a__=7					,     a__=3					,     a__=10					,     a__=18					,     a__=30					,     a__=4_00					,     a__=True					,     a__=None					,     a__=True					,     a__=[0.5, 0.5, 0.5]					,     a__=[0.5, 0.5, 0.5]					,     a__=None					,     ):
            _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 						snake_case_			(       self   ):
            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 	__a   (  lowerCAmelCase__	,						unittest.TestCase		):
     SCREAMING_SNAKE_CASE__ :      Optional[Any]       		=			VideoMAEImageProcessor if is_vision_available() else None



     def 						snake_case_			(       self   ):
            _lowerCamelCase    	=					VideoMAEImageProcessingTester(self   )



     @property
     def 						snake_case_			(       self   ):
            return self.image_processor_tester.prepare_image_processor_dict()



     def 						snake_case_			(       self   ):
            _lowerCamelCase    	=					self.image_processing_class(**self.image_processor_dict   )
            self.assertTrue(hasattr(a__					,     'image_mean'   )   )
            self.assertTrue(hasattr(a__					,     'image_std'   )   )
            self.assertTrue(hasattr(a__					,     'do_normalize'   )   )
            self.assertTrue(hasattr(a__					,     'do_resize'   )   )
            self.assertTrue(hasattr(a__					,     'do_center_crop'   )   )
            self.assertTrue(hasattr(a__					,     'size'   )   )



     def 						snake_case_			(       self   ):
            _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 						snake_case_			(       self   ):
            pass



     def 						snake_case_			(       self   ):
            # 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=a__   )
            for video in video_inputs:
                   self.assertIsInstance(a__					,     a__   )
                   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(a__					,     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 						snake_case_			(       self   ):
            # 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=a__					,     numpify=a__   )
            for video in video_inputs:
                   self.assertIsInstance(a__					,     a__   )
                   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(a__					,     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 						snake_case_			(       self   ):
            # 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=a__					,     torchify=a__   )
            for video in video_inputs:
                   self.assertIsInstance(a__					,     a__   )
                   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(a__					,     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"""


def SCREAMING_SNAKE_CASE_   (       )->		Tuple:
       _lowerCamelCase    	=					1

       while True:
              if (
                  sorted(str(snake_case		)		)
                  == sorted(str(2 * i		)		)
                  == sorted(str(3 * i		)		)
                  == sorted(str(4 * i		)		)
                  == sorted(str(5 * i		)		)
                  == sorted(str(6 * i		)		)
              ):
                     return i

              i += 1


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






