
'''simple docstring'''



from __future__ import annotations

__A        =     8.9_8_8E9  # units = N * m^s * C^-2





def 			_A		(				lowercase__		,		lowercase__		,		lowercase__		,		lowercase__						):
						lowercase__							=							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__							=							COULOMBS_CONSTANT * charge_product / (distance**2)
												return {"force": force}
						elif chargea == 0:
												lowercase__							=							abs(UpperCAmelCase_						) * (distance**2) / (COULOMBS_CONSTANT * chargea)
												return {"charge1": chargea}
						elif chargea == 0:
												lowercase__							=							abs(UpperCAmelCase_						) * (distance**2) / (COULOMBS_CONSTANT * chargea)
												return {"charge2": chargea}
						elif distance == 0:
												lowercase__							=							(COULOMBS_CONSTANT * charge_product / abs(UpperCAmelCase_						)) ** 0.5
												return {"distance": distance}
						raise ValueError("""Exactly one argument must be 0"""						)


if __name__ == "__main__":
				import doctest

				doctest.testmod()











'''simple docstring'''
import os
from pathlib import Path






def A__       (	):
						from torch.utils.cpp_extension import load

						_UpperCamelCase   :						Optional[Any]												=  Path(UpperCAmelCase_				).resolve().parent.parent.parent / 'kernels' / 'deformable_detr'
						_UpperCamelCase   :						Tuple												=  [
						    root / filename
						    for filename in [
						        'vision.cpp',
						        os.path.join('cpu'    ,    'ms_deform_attn_cpu.cpp'				),
						        os.path.join('cuda'    ,    'ms_deform_attn_cuda.cu'				),
						    ]
						]

						load(
						    'MultiScaleDeformableAttention'    ,    UpperCAmelCase_    ,    with_cuda=UpperCAmelCase_    ,    extra_include_paths=[str(UpperCAmelCase_				)]    ,    extra_cflags=['-DWITH_CUDA=1']    ,    extra_cuda_cflags=[
						        '-DCUDA_HAS_FP16=1',
						        '-D__CUDA_NO_HALF_OPERATORS__',
						        '-D__CUDA_NO_HALF_CONVERSIONS__',
						        '-D__CUDA_NO_HALF2_OPERATORS__',
						    ]    ,    )

						import MultiScaleDeformableAttention as MSDA

						return MSDA


