


"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_flax_available, is_torch_available


UpperCAmelCase				=						{
    """configuration_gpt_neo""": ["""GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP""", """GPTNeoConfig""", """GPTNeoOnnxConfig"""],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase				=						[
     """GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """GPTNeoForCausalLM""",
     """GPTNeoForQuestionAnswering""",
     """GPTNeoForSequenceClassification""",
     """GPTNeoForTokenClassification""",
     """GPTNeoModel""",
     """GPTNeoPreTrainedModel""",
     """load_tf_weights_in_gpt_neo""",
 ]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 UpperCAmelCase				=						[
     """FlaxGPTNeoForCausalLM""",
     """FlaxGPTNeoModel""",
     """FlaxGPTNeoPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_gpt_neo import GPT_NEO_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTNeoConfig, GPTNeoOnnxConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_gpt_neo import (
      GPT_NEO_PRETRAINED_MODEL_ARCHIVE_LIST,
      GPTNeoForCausalLM,
      GPTNeoForQuestionAnswering,
      GPTNeoForSequenceClassification,
      GPTNeoForTokenClassification,
      GPTNeoModel,
      GPTNeoPreTrainedModel,
      load_tf_weights_in_gpt_neo,
  )

 try:
  if not is_flax_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_flax_gpt_neo import FlaxGPTNeoForCausalLM, FlaxGPTNeoModel, FlaxGPTNeoPreTrainedModel


else:
 import sys

 UpperCAmelCase				=						_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





"""simple docstring"""
from __future__ import annotations

from numpy import array, cos, cross, floataa, radians, sin
from numpy.typing import NDArray

def 				_snake_case      (   __snake_case							:      float						, __snake_case							:      float						, __snake_case							:      bool = False   ):




   """simple docstring"""







   if radian_mode:
      return [magnitude * cos(__snake_case   ), magnitude * sin(__snake_case   )]
   return [magnitude * cos(radians(__snake_case   )   ), magnitude * sin(radians(__snake_case   )   )]

def 				_snake_case      (   __snake_case							:      NDArray[floataa]						, __snake_case							:      NDArray[floataa]						, __snake_case							:      float = 10**-1   ):




   """simple docstring"""







   _lowerCamelCase	:					NDArray[floataa]   =		cross(__snake_case						, __snake_case   )
   _lowerCamelCase	:					float   =		sum(__snake_case   )
   return abs(__snake_case   ) < eps


if __name__ == "__main__":
 # Test to check if it works
 UpperCAmelCase				=						array(
     [
         polar_force(718.4, 180 - 30),
         polar_force(879.54, 45),
         polar_force(100, -90),
     ]
 )

 UpperCAmelCase				=						array([[0, 0], [0, 0], [0, 0]])

 assert in_static_equilibrium(forces, location)

 # Problem 1 in image_data/2D_problems.jpg
 UpperCAmelCase				=						array(
     [
         polar_force(30 * 9.81, 15),
         polar_force(215, 180 - 45),
         polar_force(264, 90 - 30),
     ]
 )

 UpperCAmelCase				=						array([[0, 0], [0, 0], [0, 0]])

 assert in_static_equilibrium(forces, location)

 # Problem in image_data/2D_problems_1.jpg
 UpperCAmelCase				=						array([[0, -2000], [0, -1200], [0, 1_5600], [0, -1_2400]])

 UpperCAmelCase				=						array([[0, 0], [6, 0], [10, 0], [12, 0]])

 assert in_static_equilibrium(forces, location)

 import doctest

 doctest.testmod()

