"""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_image_inputs


if is_torch_available():
    import torch

if is_vision_available():
    from PIL import Image

    from transformers import ViTImageProcessor
class  _snake_case     (					unittest.TestCase		):






      def __init__(       self      :			Dict							,					UpperCAmelCase      :			List[str]							,					UpperCAmelCase      :			Tuple=13							,					UpperCAmelCase      :			List[str]=3							,					UpperCAmelCase      :			str=224							,					UpperCAmelCase      :			Tuple=30							,					UpperCAmelCase      :			Optional[int]=400							,					UpperCAmelCase      :			int=True							,					UpperCAmelCase      :			Tuple=None							,					UpperCAmelCase      :			Tuple=True							,					UpperCAmelCase      :			Optional[Any]=[0.5, 0.5, 0.5]							,					UpperCAmelCase      :			int=[0.5, 0.5, 0.5]							,					):
             __lowerCamelCase					:		Dict		   =     size if size is not None else {'''height''': 18, '''width''': 18}
             __lowerCamelCase					:		Any		   =     parent
             __lowerCamelCase					:		int		   =     batch_size
             __lowerCamelCase					:		Union[str, Any]		   =     num_channels
             __lowerCamelCase					:		Any		   =     image_size
             __lowerCamelCase					:		int		   =     min_resolution
             __lowerCamelCase					:		int		   =     max_resolution
             __lowerCamelCase					:		Optional[Any]		   =     do_resize
             __lowerCamelCase					:		List[str]		   =     size
             __lowerCamelCase					:		int		   =     do_normalize
             __lowerCamelCase					:		Dict		   =     image_mean
             __lowerCamelCase					:		int		   =     image_std







      def       lowerCamelCase__     (       self      :			Optional[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,
             }

@require_torch
@require_vision
class  _snake_case     (					lowerCamelCase__				, unittest.TestCase		):
      snake_case__			  =			ViTImageProcessor if is_vision_available() else None






      def       lowerCamelCase__     (       self      :			Any    ):
             __lowerCamelCase					:		Dict		   =     EfficientFormerImageProcessorTester(self    )






      @property
      def       lowerCamelCase__     (       self      :			Tuple    ):
             return self.image_proc_tester.prepare_image_processor_dict()






      def       lowerCamelCase__     (       self      :			Optional[Any]    ):
             __lowerCamelCase					:		int		   =     self.image_processing_class(**self.image_processor_dict    )
             self.assertTrue(hasattr(__lowerCamelCase							,					"image_mean"    )    )
             self.assertTrue(hasattr(__lowerCamelCase							,					"image_std"    )    )
             self.assertTrue(hasattr(__lowerCamelCase							,					"do_normalize"    )    )
             self.assertTrue(hasattr(__lowerCamelCase							,					"do_resize"    )    )
             self.assertTrue(hasattr(__lowerCamelCase							,					"size"    )    )






      def       lowerCamelCase__     (       self      :			Tuple    ):
             pass






      def       lowerCamelCase__     (       self      :			int    ):
             __lowerCamelCase					:		int		   =     self.image_processing_class(**self.image_processor_dict    )
             # create random PIL images
             __lowerCamelCase					:		List[str]		   =     prepare_image_inputs(self.image_proc_tester							,					equal_resolution=__lowerCamelCase    )
             for image in image_inputs:
                    self.assertIsInstance(__lowerCamelCase							,					Image.Image    )

             # Test not batched input
             __lowerCamelCase					:		Tuple		   =     image_processor(image_inputs[0]							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     1,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)

             # Test batched
             __lowerCamelCase					:		List[Any]		   =     image_processor(__lowerCamelCase							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     self.image_proc_tester.batch_size,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)






      def       lowerCamelCase__     (       self      :			List[Any]    ):
             __lowerCamelCase					:		Union[str, Any]		   =     self.image_processing_class(**self.image_processor_dict    )
             # create random numpy tensors
             __lowerCamelCase					:		Union[str, Any]		   =     prepare_image_inputs(self.image_proc_tester							,					equal_resolution=__lowerCamelCase							,					numpify=__lowerCamelCase    )
             for image in image_inputs:
                    self.assertIsInstance(__lowerCamelCase							,					np.ndarray    )

             # Test not batched input
             __lowerCamelCase					:		int		   =     image_processor(image_inputs[0]							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     1,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)

             # Test batched
             __lowerCamelCase					:		int		   =     image_processor(__lowerCamelCase							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     self.image_proc_tester.batch_size,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)







      def       lowerCamelCase__     (       self      :			Optional[Any]    ):
             __lowerCamelCase					:		Optional[Any]		   =     self.image_processing_class(**self.image_processor_dict    )
             # create random PyTorch tensors
             __lowerCamelCase					:		List[str]		   =     prepare_image_inputs(self.image_proc_tester							,					equal_resolution=__lowerCamelCase							,					torchify=__lowerCamelCase    )
             for image in image_inputs:
                    self.assertIsInstance(__lowerCamelCase							,					torch.Tensor    )

             # Test not batched input
             __lowerCamelCase					:		Tuple		   =     image_processor(image_inputs[0]							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     1,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)

             # Test batched
             __lowerCamelCase					:		Union[str, Any]		   =     image_processor(__lowerCamelCase							,					return_tensors="pt"    ).pixel_values
             self.assertEqual(
                 encoded_images.shape							,					(
                     self.image_proc_tester.batch_size,
                     self.image_proc_tester.num_channels,
                     self.image_proc_tester.size["height"],
                     self.image_proc_tester.size["width"],
                 )							,					)
"""simple docstring"""





from functools import lru_cache


def    lowercase_   (   _lowerCamelCase:	int      ) ->      set:



							'''simple docstring'''

							__lowerCamelCase					:		Optional[Any]		   =     2
							__lowerCamelCase					:		Tuple		   =     set()
							while i * i <= n:
														if n % i:
																					i += 1
														else:
																					n //= i
																					factors.add(_lowerCamelCase      )
							if n > 1:
														factors.add(_lowerCamelCase      )
							return factors


@lru_cache
def    lowercase_   (   _lowerCamelCase:	int      ) ->      int:



							'''simple docstring'''

							return len(unique_prime_factors(_lowerCamelCase      )      )


def    lowercase_   (   _lowerCamelCase:	list      ) ->      bool:



							'''simple docstring'''

							return len(set(_lowerCamelCase      )      ) in (0, 1)


def    lowercase_   (   _lowerCamelCase:	int      ) ->      list:



							'''simple docstring'''

							__lowerCamelCase					:		str		   =     2

							while True:
														# Increment each value of a generated range
														__lowerCamelCase					:		int		   =     [base + i for i in range(_lowerCamelCase      )]

														# Run elements through out unique_prime_factors function
														# Append our target number to the end.
														__lowerCamelCase					:		Dict		   =     [upf_len(_lowerCamelCase      ) for x in group]
														checker.append(_lowerCamelCase      )

														# If all numbers in the list are equal, return the group variable.
														if equality(_lowerCamelCase      ):
																					return group

														# Increment our base variable by 1
														base += 1


def    lowercase_   (   _lowerCamelCase:	int = 4      ) ->      int:



							'''simple docstring'''

							__lowerCamelCase					:		Any		   =     run(_lowerCamelCase      )
							return results[0] if len(_lowerCamelCase      ) else None


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