






"""simple docstring"""





import importlib.metadata
import sys

from transformers.testing_utils import TestCasePlus
from transformers.utils.versions import require_version, require_version_core


UpperCamelCase =			importlib.metadata.version("""numpy""")
UpperCamelCase =			""".""".join([str(x) for x in sys.version_info[:3]])







class 		_a   (						lowercase_    ):





   '''simple docstring'''






   def __lowercase				(    self)       ->					Tuple:




          '''simple docstring'''




          require_version_core("numpy<1000.4.5")
          require_version_core("numpy<1000.4")
          require_version_core("numpy<1000")

          # le
          require_version_core("numpy<=1000.4.5")
          require_version_core(F"""numpy<={numpy_ver}""")

          # eq
          require_version_core(F"""numpy=={numpy_ver}""")

          # ne
          require_version_core("numpy!=1000.4.5")

          # ge
          require_version_core("numpy>=1.0")
          require_version_core("numpy>=1.0.0")
          require_version_core(F"""numpy>={numpy_ver}""")

          # gt
          require_version_core("numpy>1.0.0")

          # mix
          require_version_core("numpy>1.0.0,<1000")

          # requirement w/o version
          require_version_core("numpy")

          # unmet requirements due to version conflict
          for req in ["numpy==1.0.0", "numpy>=1000.0.0", F"""numpy<{numpy_ver}"""]:
                 try:
                        require_version_core(A_)
                 except ImportError as e:
                        self.assertIn(F"""{req} is required""" ,      str(A_))
                        self.assertIn("but found" ,      str(A_))

        # unmet requirements due to missing module
          for req in ["numpipypie>1", "numpipypie2"]:
                 try:
                        require_version_core(A_)
                 except importlib.metadata.PackageNotFoundError as e:
                        self.assertIn(F"""The \'{req}\' distribution was not found and is required by this application""" ,      str(A_))
                        self.assertIn("Try: pip install transformers -U" ,      str(A_))

        # bogus requirements formats:
        # 1. whole thing
          for req in ["numpy??1.0.0", "numpy1.0.0"]:
                 try:
                        require_version_core(A_)
                 except ValueError as e:
                        self.assertIn("requirement needs to be in the pip package format" ,      str(A_))
        # 2. only operators
          for req in ["numpy=1.0.0", "numpy == 1.00", "numpy<>1.0.0", "numpy><1.00", "numpy>>1.0.0"]:
                 try:
                        require_version_core(A_)
                 except ValueError as e:
                        self.assertIn("need one of " ,      str(A_))





   def __lowercase				(    self)       ->					Optional[Any]:




          '''simple docstring'''




          require_version("python>=3.6.0")

          # not matching requirements
          for req in ["python>9.9.9", "python<3.0.0"]:
                 try:
                        require_version_core(A_)
                 except ImportError as e:
                        self.assertIn(F"""{req} is required""" ,      str(A_))
                        self.assertIn(F"""but found python=={python_ver}""" ,      str(A_))









import math

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				list:
				if n <= 0:
								raise ValueError("Only positive integers have prime factors"       )
				_UpperCAmelCase				:						Union[str, Any]       						=			[]
				while n % 2 == 0:
								pf.append(2       )
								_UpperCAmelCase				:						Tuple       						=			int(n / 2       )
				for i in range(3     ,					int(math.sqrt(lowerCAmelCase       )       ) + 1     ,					2       ):
								while n % i == 0:
												pf.append(lowerCAmelCase       )
												_UpperCAmelCase				:						Optional[int]       						=			int(n / i       )
				if n > 2:
								pf.append(lowerCAmelCase       )
				return pf

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				int:
				if n <= 0:
								raise ValueError("Only positive numbers are accepted"       )
				_UpperCAmelCase				:						Dict       						=			1
				_UpperCAmelCase				:						str       						=			1
				while n % 2 == 0:
								temp += 1
								_UpperCAmelCase				:						List[str]       						=			int(n / 2       )
				div *= temp
				for i in range(3     ,					int(math.sqrt(lowerCAmelCase       )       ) + 1     ,					2       ):
								_UpperCAmelCase				:						Any       						=			1
								while n % i == 0:
												temp += 1
												_UpperCAmelCase				:						Any       						=			int(n / i       )
								div *= temp
				if n > 1:
								div *= 2
				return div

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				int:
				if n <= 0:
								raise ValueError("Only positive numbers are accepted"       )
				_UpperCAmelCase				:						Optional[Any]       						=			1
				_UpperCAmelCase				:						Union[str, Any]       						=			1
				while n % 2 == 0:
								temp += 1
								_UpperCAmelCase				:						Optional[Any]       						=			int(n / 2       )
				if temp > 1:
								s *= (2**temp - 1) / (2 - 1)
				for i in range(3     ,					int(math.sqrt(lowerCAmelCase       )       ) + 1     ,					2       ):
								_UpperCAmelCase				:						List[str]       						=			1
								while n % i == 0:
												temp += 1
												_UpperCAmelCase				:						List[Any]       						=			int(n / i       )
								if temp > 1:
												s *= (i**temp - 1) / (i - 1)
				return int(lowerCAmelCase       )

def 							__SCREAMING_SNAKE_CASE							( lowerCAmelCase:     int       )      ->				int:
				_UpperCAmelCase				:						Any       						=			n
				for x in set(prime_factors(lowerCAmelCase       )       ):
								s *= (x - 1) / x
				return int(lowerCAmelCase       )


if __name__ == "__main__":
					import doctest

					doctest.testmod()


