
"""simple docstring"""






import unittest

from transformers import load_tool
from transformers.tools.agent_types import AGENT_TYPE_MAPPING

from .test_tools_common import ToolTesterMixin, output_types

class 				__a    (   unittest.TestCase				,      __a					):



							'''simple docstring'''







							def      SCREAMING_SNAKE_CASE	(    self					) ->       List[Any]:




													'''simple docstring'''
													__lowercase						      =					load_tool("translation"					)
													self.tool.setup()
													__lowercase						      =					load_tool("translation"     ,						remote=_lowerCamelCase					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       str:




													'''simple docstring'''
													__lowercase						      =					self.tool("Hey, what's up?"     ,						src_lang="English"     ,						tgt_lang="French"					)
													self.assertEqual(_lowerCamelCase     ,						"- Hé, comment ça va?"					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       List[str]:




													'''simple docstring'''
													__lowercase						      =					self.remote_tool("Hey, what's up?"     ,						src_lang="English"     ,						tgt_lang="French"					)
													self.assertEqual(_lowerCamelCase     ,						"- Hé, comment ça va?"					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       Optional[int]:




													'''simple docstring'''
													__lowercase						      =					self.tool(text="Hey, what's up?"     ,						src_lang="English"     ,						tgt_lang="French"					)
													self.assertEqual(_lowerCamelCase     ,						"- Hé, comment ça va?"					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       str:




													'''simple docstring'''
													__lowercase						      =					self.remote_tool(text="Hey, what's up?"     ,						src_lang="English"     ,						tgt_lang="French"					)
													self.assertEqual(_lowerCamelCase     ,						"- Hé, comment ça va?"					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       int:




													'''simple docstring'''
													__lowercase						      =					["Hey, what's up?", "English", "Spanish"]
													__lowercase						      =					self.tool(*_lowerCamelCase					)

													# There is a single output
													if len(self.tool.outputs					) == 1:
																			__lowercase						      =					[outputs]

													self.assertListEqual(output_types(_lowerCamelCase					)     ,						self.tool.outputs					)
							def      SCREAMING_SNAKE_CASE	(    self					) ->       str:




													'''simple docstring'''
													__lowercase						      =					["Hey, what's up?", "English", "Spanish"]
													__lowercase						      =					self.tool(*_lowerCamelCase					)

													if not isinstance(_lowerCamelCase     ,						_lowerCamelCase					):
																			__lowercase						      =					[outputs]

													self.assertEqual(len(_lowerCamelCase					)     ,						len(self.tool.outputs					)					)

													for output, output_type in zip(_lowerCamelCase     ,						self.tool.outputs					):
																			__lowercase						      =					AGENT_TYPE_MAPPING[output_type]
																			self.assertTrue(isinstance(_lowerCamelCase     ,						_lowerCamelCase					)					)





							def      SCREAMING_SNAKE_CASE	(    self					) ->       int:




													'''simple docstring'''
													__lowercase						      =					["Hey, what's up?", "English", "Spanish"]

													__lowercase						      =					[]

													for _input, input_type in zip(_lowerCamelCase     ,						self.tool.inputs					):
																			if isinstance(_lowerCamelCase     ,						_lowerCamelCase					):
																									_inputs.append([AGENT_TYPE_MAPPING[_input_type](_input					) for _input_type in input_type]					)
																			else:
																									_inputs.append(AGENT_TYPE_MAPPING[input_type](_input					)					)

        # Should not raise an error
													__lowercase						      =					self.tool(*_lowerCamelCase					)

													if not isinstance(_lowerCamelCase     ,						_lowerCamelCase					):
																			__lowercase						      =					[outputs]

													self.assertEqual(len(_lowerCamelCase					)     ,						len(self.tool.outputs					)					)







"""simple docstring"""






from scipy.constants import g



def     lowerCAmelCase__ (		__magic_name__ ,      __magic_name__			)	->float:
			if mass < 0:
						# handling of negative values of mass
						raise ValueError("The mass of a body cannot be negative"			)
			if height < 0:
						# handling of negative values of height
						raise ValueError("The height above the ground cannot be negative"			)
			return mass * g * height


if __name__ == "__main__":
					from doctest import testmod

					testmod(name='''potential_energy''')





