"""simple docstring"""





def      lowerCamelCase_(__SCREAMING_SNAKE_CASE  )->    str:
							_SCREAMING_SNAKE_CASE		:						Any			  =    int(lowerCamelCase__  )
							if decimal in (0, 1):  # Exit cases for the recursion
														return str(lowerCamelCase__  )
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    divmod(lowerCamelCase__     ,	2  )
							return binary_recursive(lowerCamelCase__  ) + str(lowerCamelCase__  )



def      lowerCamelCase_(__SCREAMING_SNAKE_CASE  )->    str:
							_SCREAMING_SNAKE_CASE		:						str			  =    str(lowerCamelCase__  ).strip()
							if not number:
														raise ValueError("""No input value was provided"""  )
							_SCREAMING_SNAKE_CASE		:						List[str]			  =    "-" if number.startswith("""-"""  ) else ""
							_SCREAMING_SNAKE_CASE		:						List[Any]			  =    number.lstrip("""-"""  )
							if not number.isnumeric():
														raise ValueError("""Input value is not an integer"""  )
							return F"""{negative}0b{binary_recursive(int(lowerCamelCase__  )  )}"""


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

						testmod()



"""simple docstring"""





import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel




class  _snake_case		(    __snake_case ):







				"""simple docstring"""






				a			=						"M-CLIP"





				def __init__(      self							:							Optional[Any]      ,    _A							:							List[str]=1_0_2_4      ,    _A							:							Union[str, Any]=7_6_8      ,    **_A							:							Optional[Any]):



											"""simple docstring"""







											_SCREAMING_SNAKE_CASE		:						Tuple			  =    transformerDimSize
											_SCREAMING_SNAKE_CASE		:						List[str]			  =    imageDimSize
											super().__init__(**_A)




class  _snake_case		(    __snake_case ):







				"""simple docstring"""






				a			=						MCLIPConfig





				def __init__(      self							:							Dict      ,    _A							:							Optional[Any]      ,    *_A							:							Any      ,    **_A							:							Dict):



											"""simple docstring"""







											super().__init__(_A      ,    *_A      ,    **_A)
											_SCREAMING_SNAKE_CASE		:						Tuple			  =    XLMRobertaModel(_A)
											_SCREAMING_SNAKE_CASE		:						List[Any]			  =    torch.nn.Linear(
											    in_features=config.transformerDimensions      ,    out_features=config.numDims)





				def 		_lowerCAmelCase		(      self							:							Union[str, Any]      ,    _A							:							str      ,    _A							:							int):



											"""simple docstring"""







											_SCREAMING_SNAKE_CASE		:						str			  =    self.transformer(input_ids=_A      ,    attention_mask=_A)[0]
											_SCREAMING_SNAKE_CASE		:						Optional[Any]			  =    (embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
											return self.LinearTransformation(_A), embs


