






from math import factorial, pi






def      _snake_case     (__lowercase     ,   __lowercase = 30):

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

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

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






def      _snake_case     (__lowercase     ,   __lowercase = 30):

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

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

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


if __name__ == "__main__":
 import doctest

 doctest.testmod()

 print(maclaurin_sin(1_0))
 print(maclaurin_sin(-1_0))
 print(maclaurin_sin(1_0, 1_5))
 print(maclaurin_sin(-1_0, 1_5))

 print(maclaurin_cos(5))
 print(maclaurin_cos(-5))
 print(maclaurin_cos(1_0, 1_5))
 print(maclaurin_cos(-1_0, 1_5))












from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


_lowercase		:  Dict			       ={
    """configuration_resnet""": ["""RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ResNetConfig""", """ResNetOnnxConfig"""]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """ResNetForImageClassification""",
		    """ResNetModel""",
		    """ResNetPreTrainedModel""",
		    """ResNetBackbone""",
		]

try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Union[str, Any]			       =[
		    """TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST""",
		    """TFResNetForImageClassification""",
		    """TFResNetModel""",
		    """TFResNetPreTrainedModel""",
		]

try:
		if not is_flax_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		_lowercase		:  Tuple			       =[
		    """FlaxResNetForImageClassification""",
		    """FlaxResNetModel""",
		    """FlaxResNetPreTrainedModel""",
		]

if TYPE_CHECKING:
		from .configuration_resnet import RESNET_PRETRAINED_CONFIG_ARCHIVE_MAP, ResNetConfig, ResNetOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_resnet import (
				    RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ResNetBackbone,
				    ResNetForImageClassification,
				    ResNetModel,
				    ResNetPreTrainedModel,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_resnet import (
				    TF_RESNET_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFResNetForImageClassification,
				    TFResNetModel,
				    TFResNetPreTrainedModel,
				)

		try:
				if not is_flax_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_flax_resnet import FlaxResNetForImageClassification, FlaxResNetModel, FlaxResNetPreTrainedModel


else:
		import sys

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