




def 			_a   (		SCREAMING_SNAKE_CASE_							:       Tuple  ):
					# if the collection is empty, returns empty
					if collection == []:
										return []

					# get some information about the collection
					__lowerCAmelCase            = len(SCREAMING_SNAKE_CASE_  )
					__lowerCAmelCase            = max(SCREAMING_SNAKE_CASE_  )
					__lowerCAmelCase            = min(SCREAMING_SNAKE_CASE_  )

					# create the counting array
					__lowerCAmelCase            = coll_max + 1 - coll_min
					__lowerCAmelCase            = [0] * counting_arr_length

					# count how much a number appears in the collection
					for number in collection:
										counting_arr[number - coll_min] += 1

					# sum each position with it's predecessors. now, counting_arr[i] tells
					# us how many elements <= i has in the collection
					for i in range(1   ,   SCREAMING_SNAKE_CASE_  ):
										__lowerCAmelCase            = counting_arr[i] + counting_arr[i - 1]

					# create the output collection
					__lowerCAmelCase            = [0] * coll_len

					# place the elements in the output, respecting the original order (stable
					# sort) from end to begin, updating counting_arr
					for i in reversed(range(0   ,   SCREAMING_SNAKE_CASE_  )  ):
										__lowerCAmelCase            = collection[i]
										counting_arr[collection[i] - coll_min] -= 1

					return ordered







def 			_a   (		SCREAMING_SNAKE_CASE_							:       Optional[Any]  ):
					return "".join([chr(SCREAMING_SNAKE_CASE_  ) for i in counting_sort([ord(SCREAMING_SNAKE_CASE_  ) for c in string]  )]  )


if __name__ == "__main__":
					# Test string sort
					assert counting_sort_string("""thisisthestring""") == "eghhiiinrsssttt"

					UpperCamelCase__					    =    input("""Enter numbers separated by a comma:\n""").strip()
					UpperCamelCase__					    =    [int(item) for item in user_input.split(""",""")]
					print(counting_sort(unsorted))










import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel
class     a__					(      snake_case__   ):
						_a							:					Optional[Any]      =					"""M-CLIP"""






						def __init__(     self	,    _A=1_0_2_4	,    _A=7_6_8	,    **_A    ):




											"""simple docstring"""



											__lowerCAmelCase            = transformerDimSize
											__lowerCAmelCase            = imageDimSize
											super().__init__(**_A    )






class     a__					(      snake_case__   ):
						_a							:					Tuple      =					MCLIPConfig






						def __init__(     self	,    _A	,    *_A	,    **_A    ):




											"""simple docstring"""



											super().__init__(_A	,    *_A	,    **_A    )
											__lowerCAmelCase            = XLMRobertaModel(_A    )
											__lowerCAmelCase            = torch.nn.Linear(
											    in_features=config.transformerDimensions	,    out_features=config.numDims    )






						def        __SCREAMING_SNAKE_CASE(     self	,    _A	,    _A    ):




											"""simple docstring"""



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




