


'''simple docstring'''



import torch
from transformers import PreTrainedModel, XLMRobertaConfig, XLMRobertaModel


class 						_snake_case    (   __UpperCAmelCase		):
					lowerCAmelCase					:str            =    '''M-CLIP'''




					def __init__(					self							,							_lowerCamelCase=1024							,							_lowerCamelCase=768							,							**_lowerCamelCase):
								UpperCAmelCase__     :    List[str]         =   transformerDimSize
								UpperCAmelCase__     :    Optional[Any]         =   imageDimSize
								super().__init__(**__SCREAMING_SNAKE_CASE)


class 						_snake_case    (   __UpperCAmelCase		):
					lowerCAmelCase					:Optional[int]            =    MCLIPConfig




					def __init__(					self							,							_lowerCamelCase							,							*_lowerCamelCase							,							**_lowerCamelCase):
								super().__init__(__SCREAMING_SNAKE_CASE							,							*__SCREAMING_SNAKE_CASE							,							**__SCREAMING_SNAKE_CASE)
								UpperCAmelCase__     :    Optional[int]         =   XLMRobertaModel(__SCREAMING_SNAKE_CASE)
								UpperCAmelCase__     :    str         =   torch.nn.Linear(
								    in_features=config.transformerDimensions							,							out_features=config.numDims)




					def  snake_case__  (					self							,							_lowerCamelCase							,							_lowerCamelCase):
								UpperCAmelCase__     :    Dict         =   self.transformer(input_ids=__SCREAMING_SNAKE_CASE							,							attention_mask=__SCREAMING_SNAKE_CASE)[0]
								UpperCAmelCase__     :    Optional[Any]         =   (embs * attention_mask.unsqueeze(2)).sum(dim=1) / attention_mask.sum(dim=1)[:, None]
								return self.LinearTransformation(__SCREAMING_SNAKE_CASE), embs




from collections import defaultdict





def      __snake_case	(			_UpperCAmelCase   , _UpperCAmelCase				):
    __a						       =				first_str.lower().strip()
    __a						       =				second_str.lower().strip()

    # Remove whitespace
    __a						       =				first_str.replace(''' '''   , ''''''				)
    __a						       =				second_str.replace(''' '''   , ''''''				)

    # Strings of different lengths are not anagrams
    if len(_UpperCAmelCase				) != len(_UpperCAmelCase				):
        return False

    # Default values for count should be 0
    __a						       =				defaultdict(_UpperCAmelCase				)

    # For each character in input strings,
    # increment count in the corresponding
    for i in range(len(_UpperCAmelCase				)				):
        count[first_str[i]] += 1
        count[second_str[i]] -= 1

    return all(_count == 0 for _count in count.values()				)


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

 testmod()
 __snake_case						:Any      		=     input('''Enter the first string ''').strip()
 __snake_case						:int      		=     input('''Enter the second string ''').strip()

 __snake_case						:int      		=     check_anagrams(input_a, input_b)
 print(f'{input_a} and {input_b} are {"" if status else "not "}anagrams.')





