



"""simple docstring"""






import math






def 					snake_case__       (		__lowerCamelCase    :   Union[str, Any]     ):
			"""simple docstring"""
			assert isinstance(lowerCAmelCase__							,		lowerCAmelCase__     ) and (
			    number >= 0
			), "'number' must been an int and positive"

			if 1 < number < 4:
						# 2 and 3 are primes
						return True
			elif number < 2 or not number % 2:
						# Negatives, 0, 1 and all even numbers are not primes
						return False

			lowerCamelCase__		:		Union[str, Any]		     =range(3							,		int(math.sqrt(lowerCAmelCase__     ) + 1     )							,		2     )
			return not any(not number % i for i in odd_numbers     )






def 					snake_case__       (		__lowerCamelCase    :   List[str]							,		__lowerCamelCase    :   int=1							,		**__lowerCamelCase    :   Tuple     ):
			"""simple docstring"""
			lowerCamelCase__		:		int		     =factor * value
			lowerCamelCase__		:		Optional[int]		     =value

			while not is_prime(lowerCAmelCase__     ):
						value += 1 if not ("desc" in kwargs and kwargs["desc"] is True) else -1

			if value == first_value_val:
						return next_prime(value + 1							,		**lowerCAmelCase__     )
			return value









"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_speech_available,
    is_torch_available,
)


_lowercase			:			Any										=						{
    "configuration_trocr": ["TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig"],
    "processing_trocr": ["TrOCRProcessor"],
}


try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase			:			List[Any]										=						[
		    "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TrOCRForCausalLM",
		    "TrOCRPreTrainedModel",
		]


if TYPE_CHECKING:
		from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig
		from .processing_trocr import TrOCRProcessor

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel

else:
		import sys

		_lowercase			:			Tuple										=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




