

from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
      import accelerate







def 							_lowerCamelCase   (			SCREAMING_SNAKE_CASE   ):
      '''simple docstring'''







      if not is_accelerate_available():
            return method
      A_							       =		version.parse(accelerate.__version__   ).base_version
      if version.parse(SCREAMING_SNAKE_CASE   ) < version.parse('''0.17.0'''   ):
            return method

      def wrapper(self		,				*SCREAMING_SNAKE_CASE		,				**SCREAMING_SNAKE_CASE   ):
            if hasattr(self		,				'''_hf_hook'''   ) and hasattr(self._hf_hook		,				'''pre_forward'''   ):
                  self._hf_hook.pre_forward(self   )
            return method(self		,				*SCREAMING_SNAKE_CASE		,				**SCREAMING_SNAKE_CASE   )

      return wrapper








from math import factorial, radians







def 							_lowerCamelCase   (			SCREAMING_SNAKE_CASE		,				SCREAMING_SNAKE_CASE = 18		,				SCREAMING_SNAKE_CASE = 10   ):
      '''simple docstring'''







      A_							       =		angle_in_degrees - ((angle_in_degrees // 360.0) * 360.0)

      # Converting from degrees to radians
      A_							       =		radians(SCREAMING_SNAKE_CASE   )

      A_							       =		angle_in_radians
      A_							       =		3
      A_							       =		-1

      for _ in range(SCREAMING_SNAKE_CASE   ):
            result += (b * (angle_in_radians**a)) / factorial(SCREAMING_SNAKE_CASE   )

            A_							       =		-b  # One positive term and the next will be negative and so on...
            a += 2  # Increased by 2 for every term.

      return round(SCREAMING_SNAKE_CASE		,				SCREAMING_SNAKE_CASE   )


if __name__ == "__main__":
      __import__("""doctest""").testmod()





