from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


SCREAMING_SNAKE_CASE__		:					str						=					{
    "configuration_timesformer": ["TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP", "TimesformerConfig"],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE__		:					int						=					[
          "TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
          "TimesformerModel",
          "TimesformerForVideoClassification",
          "TimesformerPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_timesformer import (
                TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                TimesformerForVideoClassification,
                TimesformerModel,
                TimesformerPreTrainedModel,
            )

else:
      import sys

      SCREAMING_SNAKE_CASE__		:					Union[str, Any]						=					_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




import math







def     _a				(      lowercase__  :			int ):







     '''simple docstring'''


     assert isinstance(lowercase__     ,  lowercase__ ) 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

     SCREAMING_SNAKE_CASE__				:				Tuple			=		range(3     ,  int(math.sqrt(lowercase__ ) + 1 )     ,  2 )
     return not any(not number % i for i in odd_numbers )







def     _a				(      lowercase__  :			List[str]     ,  lowercase__  :			Any=1     ,  **lowercase__  :			Any ):







     '''simple docstring'''


     SCREAMING_SNAKE_CASE__				:				int			=		factor * value
     SCREAMING_SNAKE_CASE__				:				Dict			=		value

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

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



