


"""simple docstring"""


from __future__ import annotations

# Define the Gravitational Constant G and the function
a_											=     6.67_43E-11  # unit of G : m^3 * kg^-1 * s^-2






def   a__			(					__lowercase  ,      __lowercase  ,      __lowercase  ,      __lowercase )						->						str:
				_A       	=      mass_a * mass_a

				if (force, mass_a, mass_a, distance).count(0 ) != 1:
								raise ValueError("One and only one argument must be 0" )
				if force < 0:
								raise ValueError("Gravitational force can not be negative" )
				if distance < 0:
								raise ValueError("Distance can not be negative" )
				if mass_a < 0 or mass_a < 0:
								raise ValueError("Mass can not be negative" )
				if force == 0:
								_A       	=      GRAVITATIONAL_CONSTANT * product_of_mass / (distance**2)
								return {"force": force}
				elif mass_a == 0:
								_A       	=      (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
								return {"mass_1": mass_a}
				elif mass_a == 0:
								_A       	=      (force) * (distance**2) / (GRAVITATIONAL_CONSTANT * mass_a)
								return {"mass_2": mass_a}
				elif distance == 0:
								_A       	=      (GRAVITATIONAL_CONSTANT * product_of_mass / (force)) ** 0.5
								return {"distance": distance}
				raise ValueError("One and only one argument must be 0" )


# Run doctest
if __name__ == "__main__":
		import doctest

		doctest.testmod()





"""simple docstring"""

import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig
from ..clip.configuration_clip import CLIPVisionConfig


UpperCamelCase__			:     Optional[Any]			       =				logging.get_logger(__name__)
class      A__   (   lowercase_  ):
	A_				:					List[str]      =   """vision-text-dual-encoder"""
	A_				:					Tuple      =   True




	def __init__( self	:						Tuple   ,     lowercase	:						List[Any]=512   ,     lowercase	:						Any=2.65_92   ,     **lowercase	:						int						)       ->			int:
						super().__init__(**lowercase						)

						if "vision_config" not in kwargs:
											raise ValueError("""`vision_config` can not be `None`."""						)

						if "text_config" not in kwargs:
											raise ValueError("""`text_config` can not be `None`."""						)

						__snake_case        =						kwargs.pop("""vision_config"""						)
						__snake_case        =						kwargs.pop("""text_config"""						)

						__snake_case        =						vision_config.pop("""model_type"""						)
						__snake_case        =						text_config.pop("""model_type"""						)

						if vision_model_type == "clip":
											__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						).vision_config
						elif vision_model_type == "clip_vision_model":
											__snake_case        =						CLIPVisionConfig(**lowercase						)
						else:
											__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						)

						__snake_case        =						AutoConfig.for_model(lowercase   ,     **lowercase						)

						__snake_case        =						projection_dim
						__snake_case        =						logit_scale_init_value




	@classmethod
	def 				a_		( cls	:						Union[str, Any]   ,     lowercase	:						PretrainedConfig   ,     lowercase	:						PretrainedConfig   ,     **lowercase	:						Optional[int]						)       ->			Dict:
						return cls(vision_config=vision_config.to_dict()   ,     text_config=text_config.to_dict()   ,     **lowercase						)




	def 				a_		( self	:						Dict						)       ->			Dict:
						__snake_case        =						copy.deepcopy(self.__dict__						)
						__snake_case        =						self.vision_config.to_dict()
						__snake_case        =						self.text_config.to_dict()
						__snake_case        =						self.__class__.model_type
						return output


