
'''simple docstring'''







from __future__ import annotations

_lowercase :  Tuple    							=       8.988E9  # units = N * m^s * C^-2
def 					snake_case_		(				__SCREAMING_SNAKE_CASE					: float      ,      __SCREAMING_SNAKE_CASE					: float      ,      __SCREAMING_SNAKE_CASE					: float      ,      __SCREAMING_SNAKE_CASE					: float							):



						"""simple docstring"""





						lowercase_	:     int													=       abs(chargea * chargea							)

						if (force, chargea, chargea, distance).count(0							) != 1:
												raise ValueError('''One and only one argument must be 0'''							)
						if distance < 0:
												raise ValueError('''Distance cannot be negative'''							)
						if force == 0:
												lowercase_	:     List[Any]													=       COULOMBS_CONSTANT * charge_product / (distance**2)
												return {"force": force}
						elif chargea == 0:
												lowercase_	:     Union[str, Any]													=       abs(__SCREAMING_SNAKE_CASE							) * (distance**2) / (COULOMBS_CONSTANT * chargea)
												return {"charge1": chargea}
						elif chargea == 0:
												lowercase_	:     Dict													=       abs(__SCREAMING_SNAKE_CASE							) * (distance**2) / (COULOMBS_CONSTANT * chargea)
												return {"charge2": chargea}
						elif distance == 0:
												lowercase_	:     Tuple													=       (COULOMBS_CONSTANT * charge_product / abs(__SCREAMING_SNAKE_CASE							)) ** 0.5
												return {"distance": distance}
						raise ValueError('''Exactly one argument must be 0'''							)


if __name__ == "__main__":
							import doctest

							doctest.testmod()





'''simple docstring'''







import json
import os
import tempfile

from transformers.testing_utils import check_json_file_has_correct_format






class  lowerCAmelCase__   :
					lowerCAmelCase_        =     None






					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     Tuple													=       self.feature_extraction_class(**self.feat_extract_dict		)
											lowercase_	:     Any													=       json.loads(feat_extract.to_json_string()		)
											for key, value in self.feat_extract_dict.items():
																	self.assertEqual(obj[key]				,							__SCREAMING_SNAKE_CASE		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     str													=       self.feature_extraction_class(**self.feat_extract_dict		)

											with tempfile.TemporaryDirectory() as tmpdirname:
																	lowercase_	:     str													=       os.path.join(__SCREAMING_SNAKE_CASE				,							'''feat_extract.json'''		)
																	feat_extract_first.to_json_file(__SCREAMING_SNAKE_CASE		)
																	lowercase_	:     str													=       self.feature_extraction_class.from_json_file(__SCREAMING_SNAKE_CASE		)

											self.assertEqual(feat_extract_second.to_dict()				,							feat_extract_first.to_dict()		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     Tuple													=       self.feature_extraction_class(**self.feat_extract_dict		)

											with tempfile.TemporaryDirectory() as tmpdirname:
																	lowercase_	:     Union[str, Any]													=       feat_extract_first.save_pretrained(__SCREAMING_SNAKE_CASE		)[0]
																	check_json_file_has_correct_format(__SCREAMING_SNAKE_CASE		)
																	lowercase_	:     str													=       self.feature_extraction_class.from_pretrained(__SCREAMING_SNAKE_CASE		)

											self.assertEqual(feat_extract_second.to_dict()				,							feat_extract_first.to_dict()		)






					def 	_snake_case    (   self		):


											"""simple docstring"""





											lowercase_	:     Optional[Any]													=       self.feature_extraction_class()
											self.assertIsNotNone(__SCREAMING_SNAKE_CASE		)



