






"""simple docstring"""






from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


SCREAMING_SNAKE_CASE						:						Dict					   =       {
    '''configuration_efficientnet''': [
        '''EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''EfficientNetConfig''',
        '''EfficientNetOnnxConfig''',
    ]
}

try:
     if not is_vision_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     SCREAMING_SNAKE_CASE						:						Tuple					   =       ['''EfficientNetImageProcessor''']

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     SCREAMING_SNAKE_CASE						:						Any					   =       [
         '''EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST''',
         '''EfficientNetForImageClassification''',
         '''EfficientNetModel''',
         '''EfficientNetPreTrainedModel''',
     ]

if TYPE_CHECKING:
     from .configuration_efficientnet import (
         EFFICIENTNET_PRETRAINED_CONFIG_ARCHIVE_MAP,
         EfficientNetConfig,
         EfficientNetOnnxConfig,
     )

     try:
          if not is_vision_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .image_processing_efficientnet import EfficientNetImageProcessor

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_efficientnet import (
              EFFICIENTNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              EfficientNetForImageClassification,
              EfficientNetModel,
              EfficientNetPreTrainedModel,
          )

else:
     import sys

     SCREAMING_SNAKE_CASE						:						int					   =       _LazyModule(__name__, globals()['''__file__'''], _import_structure)










"""simple docstring"""






from math import factorial, pi



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = 30				):

				if not isinstance(lowerCAmelCase__       ,(int, float)				):
								raise ValueError('maclaurin_sin() requires either an int or float for theta'				)

				if not isinstance(lowerCAmelCase__       ,lowerCAmelCase__				) or accuracy <= 0:
								raise ValueError('maclaurin_sin() requires a positive int for accuracy'				)

				A__							 =       float(lowerCAmelCase__				)
				A__							 =       theta // (2 * pi)
				theta -= 2 * div * pi
				return sum(
				    (-1) ** r * theta ** (2 * r + 1) / factorial(2 * r + 1				) for r in range(lowerCAmelCase__				)				)



def  __lowerCamelCase					(					lowerCAmelCase__       ,lowerCAmelCase__ = 30				):

				if not isinstance(lowerCAmelCase__       ,(int, float)				):
								raise ValueError('maclaurin_cos() requires either an int or float for theta'				)

				if not isinstance(lowerCAmelCase__       ,lowerCAmelCase__				) or accuracy <= 0:
								raise ValueError('maclaurin_cos() requires a positive int for accuracy'				)

				A__							 =       float(lowerCAmelCase__				)
				A__							 =       theta // (2 * pi)
				theta -= 2 * div * pi
				return sum((-1) ** r * theta ** (2 * r) / factorial(2 * r				) for r in range(lowerCAmelCase__				)				)


if __name__ == "__main__":
					import doctest

					doctest.testmod()

					print(maclaurin_sin(10))
					print(maclaurin_sin(-10))
					print(maclaurin_sin(10, 15))
					print(maclaurin_sin(-10, 15))

					print(maclaurin_cos(5))
					print(maclaurin_cos(-5))
					print(maclaurin_cos(10, 15))
					print(maclaurin_cos(-10, 15))


