


'''simple docstring'''






# coding=utf-8
# Copyright 2020 The HuggingFace Inc. team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# this script dumps information about the environment

import os
import sys

import transformers


__UpperCAmelCase       							=				'''3'''

print('''Python version:''', sys.version)
print('''transformers version:''', transformers.__version__)

try:
		import torch

		print('''Torch version:''', torch.__version__)
		print('''Cuda available:''', torch.cuda.is_available())
		print('''Cuda version:''', torch.version.cuda)
		print('''CuDNN version:''', torch.backends.cudnn.version())
		print('''Number of GPUs available:''', torch.cuda.device_count())
		print('''NCCL version:''', torch.cuda.nccl.version())
except ImportError:
		print('''Torch version:''', None)

try:
		import deepspeed

		print('''DeepSpeed version:''', deepspeed.__version__)
except ImportError:
		print('''DeepSpeed version:''', None)

try:
		import tensorflow as tf

		print('''TensorFlow version:''', tf.__version__)
		print('''TF GPUs available:''', bool(tf.config.list_physical_devices('''GPU''')))
		print('''Number of TF GPUs available:''', len(tf.config.list_physical_devices('''GPU''')))
except ImportError:
		print('''TensorFlow version:''', None)
"""simple docstring"""


from __future__ import annotations

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





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase = False							)				->   list[float]:




						'''simple docstring'''



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





def      lowerCamelCase_					(   __lowerCAmelCase  ,       __lowerCAmelCase  ,       __lowerCAmelCase = 10**-1							)				->   bool:




						'''simple docstring'''



						lowerCamelCase__   =cross(__lowerCAmelCase  ,       __lowerCAmelCase							)
						lowerCamelCase__   =sum(__lowerCAmelCase							)
						return abs(__lowerCAmelCase							) < eps


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

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

	assert in_static_equilibrium(forces, location)

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

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

	assert in_static_equilibrium(forces, location)

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

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

	assert in_static_equilibrium(forces, location)

	import doctest

	doctest.testmod()


