






from __future__ import annotations

UpperCamelCase        =				8.988E9  # units = N * m^s * C^-2




def 				A		(					lowercase__  :  float ,		lowercase__  :  float ,		lowercase__  :  float ,		lowercase__  :  float  )		-> dict[str, float]:
	UpperCamelCase__ :Optional[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:
		UpperCamelCase__ :Any						=      COULOMBS_CONSTANT * charge_product / (distance**2)
		return {"force": force}
	elif chargea == 0:
		UpperCamelCase__ :List[Any]						=      abs(lowercase__  ) * (distance**2) / (COULOMBS_CONSTANT * chargea)
		return {"charge1": chargea}
	elif chargea == 0:
		UpperCamelCase__ :int						=      abs(lowercase__  ) * (distance**2) / (COULOMBS_CONSTANT * chargea)
		return {"charge2": chargea}
	elif distance == 0:
		UpperCamelCase__ :Optional[Any]						=      (COULOMBS_CONSTANT * charge_product / abs(lowercase__  )) ** 0.5
		return {"distance": distance}
	raise ValueError("""Exactly one argument must be 0"""  )


if __name__ == "__main__":
							import doctest

							doctest.testmod()






'''simple docstring'''






from unittest import TestCase

from datasets import Sequence, Value
from datasets.arrow_dataset import Dataset




class  _A (					__lowercase		):

		def 	lowercase__     (   self					:   Any			)					->    str:


					"""simple docstring"""

					return [
					    {"col_1": 3, "col_2": "a"},
					    {"col_1": 2, "col_2": "b"},
					    {"col_1": 1, "col_2": "c"},
					    {"col_1": 0, "col_2": "d"},
					]

		def 	lowercase__     (   self					:   str			)					->    int:


					"""simple docstring"""

					__snake_case					:      Union[str, Any]							      =     {"""col_1""": [3, 2, 1, 0], """col_2""": ["""a""", """b""", """c""", """d"""]}
					return Dataset.from_dict(__magic_name__			)

		def 	lowercase__     (   self					:   str			)					->    List[Any]:


					"""simple docstring"""

					__snake_case					:      Any							      =     self._create_example_records()
					__snake_case					:      str							      =     Dataset.from_list(__magic_name__			)
					self.assertListEqual(dset.column_names  ,      ["""col_1""", """col_2"""]			)
					for i, r in enumerate(__magic_name__			):
								self.assertDictEqual(__magic_name__  ,      example_records[i]			)

		def 	lowercase__     (   self					:   Optional[Any]			)					->    List[Any]:


					"""simple docstring"""

					__snake_case					:      List[Any]							      =     self._create_example_records()
					__snake_case					:      Dict							      =     Dataset.from_list(__magic_name__			)
					__snake_case					:      List[Any]							      =     Dataset.from_dict({k: [r[k] for r in example_records] for k in example_records[0]}			)
					self.assertEqual(dset.info  ,      dset_from_dict.info			)

		def 	lowercase__     (   self					:   str			)					->    List[Any]:  # checks what happens with missing columns


					"""simple docstring"""

					__snake_case					:      Union[str, Any]							      =     [{"""col_1""": 1}, {"""col_2""": """x"""}]
					__snake_case					:      Optional[int]							      =     Dataset.from_list(__magic_name__			)
					self.assertDictEqual(dset[0]  ,      {"""col_1""": 1}			)
					self.assertDictEqual(dset[1]  ,      {"""col_1""": None}			)  # NB: first record is used for columns

		def 	lowercase__     (   self					:   List[str]			)					->    Optional[Any]:  # checks if the type can be inferred from the second record


					"""simple docstring"""

					__snake_case					:      List[Any]							      =     [{"""col_1""": []}, {"""col_1""": [1, 2]}]
					__snake_case					:      int							      =     Dataset.from_list(__magic_name__			)
					self.assertEqual(dset.info.features["""col_1"""]  ,      Sequence(Value("""int64"""			)			)			)

		def 	lowercase__     (   self					:   int			)					->    Union[str, Any]:


					"""simple docstring"""

					__snake_case					:      Tuple							      =     Dataset.from_list([]			)
					self.assertEqual(len(__magic_name__			)  ,      0			)
					self.assertListEqual(dset.column_names  ,      []			)


