'''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 OwlViTImageProcessor




class _lowerCAmelCase			(	unittest.TestCase					):







      def __init__(  self  ,    lowercase  ,    lowercase=7  ,    lowercase=3  ,    lowercase=18  ,    lowercase=30  ,    lowercase=400  ,    lowercase=True  ,    lowercase=None  ,    lowercase=True  ,    lowercase=None  ,    lowercase=True  ,    lowercase=[0.4814_5466, 0.457_8275, 0.4082_1073]  ,    lowercase=[0.2686_2954, 0.2613_0258, 0.2757_7711]  ,    lowercase=True  ,    ):
        lowercase				:							int									=   parent
        lowercase				:							Tuple									=   batch_size
        lowercase				:							Tuple									=   num_channels
        lowercase				:							str									=   image_size
        lowercase				:							List[Any]									=   min_resolution
        lowercase				:							Union[str, Any]									=   max_resolution
        lowercase				:							List[str]									=   do_resize
        lowercase				:							Optional[Any]									=   size if size is not None else {'''height''': 18, '''width''': 18}
        lowercase				:							Optional[Any]									=   do_center_crop
        lowercase				:							int									=   crop_size if crop_size is not None else {'''height''': 18, '''width''': 18}
        lowercase				:							Union[str, Any]									=   do_normalize
        lowercase				:							Optional[int]									=   image_mean
        lowercase				:							Tuple									=   image_std
        lowercase				:							Tuple									=   do_convert_rgb







      def      lowerCamelCase__      (  self     ):
        return {
            "do_resize": self.do_resize,
            "size": self.size,
            "do_center_crop": self.do_center_crop,
            "crop_size": self.crop_size,
            "do_normalize": self.do_normalize,
            "image_mean": self.image_mean,
            "image_std": self.image_std,
            "do_convert_rgb": self.do_convert_rgb,
        }





@require_torch
@require_vision
class _lowerCAmelCase			(	snake_case							,   unittest.TestCase					):
      UpperCAmelCase_	:						List[Any]	 =       OwlViTImageProcessor if is_vision_available() else None







      def      lowerCamelCase__      (  self     ):
        lowercase				:							int									=   OwlViTImageProcessingTester(self     )







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







      def      lowerCamelCase__      (  self     ):
        lowercase				:							Tuple									=   self.image_processing_class(**self.image_processor_dict     )
        self.assertTrue(hasattr(lowercase  ,    '''do_resize'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''size'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''do_center_crop'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''center_crop'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''do_normalize'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''image_mean'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''image_std'''     )     )
        self.assertTrue(hasattr(lowercase  ,    '''do_convert_rgb'''     )     )







      def      lowerCamelCase__      (  self     ):
        lowercase				:							List[str]									=   self.image_processing_class.from_dict(self.image_processor_dict     )
        self.assertEqual(image_processor.size  ,    {'''height''': 18, '''width''': 18}     )
        self.assertEqual(image_processor.crop_size  ,    {'''height''': 18, '''width''': 18}     )

        lowercase				:							Union[str, Any]									=   self.image_processing_class.from_dict(self.image_processor_dict  ,    size=42  ,    crop_size=84     )
        self.assertEqual(image_processor.size  ,    {'''height''': 42, '''width''': 42}     )
        self.assertEqual(image_processor.crop_size  ,    {'''height''': 84, '''width''': 84}     )







      def      lowerCamelCase__      (  self     ):
        # Initialize image_processing
        lowercase				:							Any									=   self.image_processing_class(**self.image_processor_dict     )
        # create random PIL images
        lowercase				:							Tuple									=   prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=lowercase     )

        for image in image_inputs:
          self.assertIsInstance(lowercase  ,    Image.Image     )

        # Test not batched input
        lowercase				:							List[Any]									=   image_processing(image_inputs[0]  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                1,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )

        # Test batched
        lowercase				:							Optional[int]									=   image_processing(lowercase  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )







      def      lowerCamelCase__      (  self     ):
        # Initialize image_processing
        lowercase				:							Any									=   self.image_processing_class(**self.image_processor_dict     )
        # create random numpy tensors
        lowercase				:							List[Any]									=   prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=lowercase  ,    numpify=lowercase     )
        for image in image_inputs:
          self.assertIsInstance(lowercase  ,    np.ndarray     )

        # Test not batched input
        lowercase				:							Tuple									=   image_processing(image_inputs[0]  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                1,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )

        # Test batched
        lowercase				:							List[str]									=   image_processing(lowercase  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )







      def      lowerCamelCase__      (  self     ):
        # Initialize image_processing
        lowercase				:							Union[str, Any]									=   self.image_processing_class(**self.image_processor_dict     )
        # create random PyTorch tensors
        lowercase				:							Any									=   prepare_image_inputs(self.image_processor_tester  ,    equal_resolution=lowercase  ,    torchify=lowercase     )
        for image in image_inputs:
          self.assertIsInstance(lowercase  ,    torch.Tensor     )

        # Test not batched input
        lowercase				:							Optional[int]									=   image_processing(image_inputs[0]  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                1,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )

        # Test batched
        lowercase				:							int									=   image_processing(lowercase  ,    return_tensors='''pt'''     ).pixel_values
        self.assertEqual(
            encoded_images.shape  ,    (
                self.image_processor_tester.batch_size,
                self.image_processor_tester.num_channels,
                self.image_processor_tester.crop_size['''height'''],
                self.image_processor_tester.crop_size['''width'''],
            )  ,    )
'''simple docstring'''
import math







def 				__UpperCamelCase (					__UpperCAmelCase  :					str			)							->	Optional[int]:
  lowercase				:							Tuple									=   0
  if n % 2 == 0:
    count += 1
    while n % 2 == 0:
      lowercase				:							Optional[int]									=   int(n / 2			)
    # the n input value must be odd so that
    # we can skip one element (ie i += 2)

  lowercase				:							Dict									=   3

  while i <= int(math.sqrt(__UpperCAmelCase			)			):
    if n % i == 0:
      count += 1
      while n % i == 0:
        lowercase				:							Dict									=   int(n / i			)
    lowercase				:							List[Any]									=   i + 2

  # this condition checks the prime
  # number n is greater than 2

  if n > 2:
    count += 1
  return count


if __name__ == "__main__":
 _A		:      List[Any]						   =5_1_2_4_2_1_8_3
 print(f"""The number of distinct prime factors is/are {exact_prime_factor_count(n)}""")
 print(f"""The value of log(log(n)) is {math.log(math.log(n)):.4f}""")