

'''simple docstring'''





import unittest

import numpy as np

from transformers.testing_utils import require_flax, require_tf, require_torch
from transformers.utils import (
    expand_dims,
    flatten_dict,
    is_flax_available,
    is_tf_available,
    is_torch_available,
    reshape,
    squeeze,
    transpose,
)


if is_flax_available():
							import jax.numpy as jnp

if is_tf_available():
							import tensorflow as tf

if is_torch_available():
							import torch





class 		__SCREAMING_SNAKE_CASE       ( unittest.TestCase			):







				def    lowerCamelCase_  (					self    :		str      ):
										'''simple docstring'''
										lowercase   :       int								={
										    '''task_specific_params''': {
										        '''summarization''': {'''length_penalty''': 1.0, '''max_length''': 128, '''min_length''': 12, '''num_beams''': 4},
										        '''summarization_cnn''': {'''length_penalty''': 2.0, '''max_length''': 142, '''min_length''': 56, '''num_beams''': 4},
										        '''summarization_xsum''': {'''length_penalty''': 1.0, '''max_length''': 62, '''min_length''': 11, '''num_beams''': 6},
										    }
										}
										lowercase   :       int								={
										    '''task_specific_params.summarization.length_penalty''': 1.0,
										    '''task_specific_params.summarization.max_length''': 128,
										    '''task_specific_params.summarization.min_length''': 12,
										    '''task_specific_params.summarization.num_beams''': 4,
										    '''task_specific_params.summarization_cnn.length_penalty''': 2.0,
										    '''task_specific_params.summarization_cnn.max_length''': 142,
										    '''task_specific_params.summarization_cnn.min_length''': 56,
										    '''task_specific_params.summarization_cnn.num_beams''': 4,
										    '''task_specific_params.summarization_xsum.length_penalty''': 1.0,
										    '''task_specific_params.summarization_xsum.max_length''': 62,
										    '''task_specific_params.summarization_xsum.min_length''': 11,
										    '''task_specific_params.summarization_xsum.num_beams''': 6,
										}

										self.assertEqual(flatten_dict(UpperCAmelCase__      )		,				UpperCAmelCase__      )







				def    lowerCamelCase_  (					self    :		Dict      ):
										'''simple docstring'''
										lowercase   :       Optional[int]								=np.random.randn(3		,				4      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__      )		,				x.transpose()      )      )

										lowercase   :       Dict								=np.random.randn(3		,				4		,				5      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      )		,				x.transpose((1, 2, 0)      )      )      )







				@require_torch
				def    lowerCamelCase_  (					self    :		Dict      ):
										'''simple docstring'''
										lowercase   :       List[str]								=np.random.randn(3		,				4      )
										lowercase   :       Any								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__      )		,				transpose(UpperCAmelCase__      ).numpy()      )      )

										lowercase   :       Optional[int]								=np.random.randn(3		,				4		,				5      )
										lowercase   :       Dict								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      )		,				transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      ).numpy()      )      )







				@require_tf
				def    lowerCamelCase_  (					self    :		List[Any]      ):
										'''simple docstring'''
										lowercase   :       List[Any]								=np.random.randn(3		,				4      )
										lowercase   :       Dict								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__      )		,				transpose(UpperCAmelCase__      ).numpy()      )      )

										lowercase   :       Dict								=np.random.randn(3		,				4		,				5      )
										lowercase   :       int								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      )		,				transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      ).numpy()      )      )







				@require_flax
				def    lowerCamelCase_  (					self    :		Dict      ):
										'''simple docstring'''
										lowercase   :       List[str]								=np.random.randn(3		,				4      )
										lowercase   :       Any								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__      )		,				np.asarray(transpose(UpperCAmelCase__      )      )      )      )

										lowercase   :       Optional[int]								=np.random.randn(3		,				4		,				5      )
										lowercase   :       Optional[Any]								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      )		,				np.asarray(transpose(UpperCAmelCase__		,				axes=(1, 2, 0)      )      )      )      )







				def    lowerCamelCase_  (					self    :		List[Any]      ):
										'''simple docstring'''
										lowercase   :       List[Any]								=np.random.randn(3		,				4      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(4, 3)      )		,				np.reshape(UpperCAmelCase__		,				(4, 3)      )      )      )

										lowercase   :       Optional[int]								=np.random.randn(3		,				4		,				5      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(12, 5)      )		,				np.reshape(UpperCAmelCase__		,				(12, 5)      )      )      )







				@require_torch
				def    lowerCamelCase_  (					self    :		Optional[Any]      ):
										'''simple docstring'''
										lowercase   :       str								=np.random.randn(3		,				4      )
										lowercase   :       Optional[int]								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(4, 3)      )		,				reshape(UpperCAmelCase__		,				(4, 3)      ).numpy()      )      )

										lowercase   :       int								=np.random.randn(3		,				4		,				5      )
										lowercase   :       Tuple								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(12, 5)      )		,				reshape(UpperCAmelCase__		,				(12, 5)      ).numpy()      )      )







				@require_tf
				def    lowerCamelCase_  (					self    :		Optional[Any]      ):
										'''simple docstring'''
										lowercase   :       Tuple								=np.random.randn(3		,				4      )
										lowercase   :       Any								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(4, 3)      )		,				reshape(UpperCAmelCase__		,				(4, 3)      ).numpy()      )      )

										lowercase   :       Any								=np.random.randn(3		,				4		,				5      )
										lowercase   :       Optional[Any]								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(12, 5)      )		,				reshape(UpperCAmelCase__		,				(12, 5)      ).numpy()      )      )







				@require_flax
				def    lowerCamelCase_  (					self    :		int      ):
										'''simple docstring'''
										lowercase   :       Tuple								=np.random.randn(3		,				4      )
										lowercase   :       List[str]								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(4, 3)      )		,				np.asarray(reshape(UpperCAmelCase__		,				(4, 3)      )      )      )      )

										lowercase   :       List[Any]								=np.random.randn(3		,				4		,				5      )
										lowercase   :       Optional[int]								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(reshape(UpperCAmelCase__		,				(12, 5)      )		,				np.asarray(reshape(UpperCAmelCase__		,				(12, 5)      )      )      )      )







				def    lowerCamelCase_  (					self    :		Any      ):
										'''simple docstring'''
										lowercase   :       Union[str, Any]								=np.random.randn(1		,				3		,				4      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__      )		,				np.squeeze(UpperCAmelCase__      )      )      )

										lowercase   :       Optional[int]								=np.random.randn(1		,				4		,				1		,				5      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__		,				axis=2      )		,				np.squeeze(UpperCAmelCase__		,				axis=2      )      )      )







				@require_torch
				def    lowerCamelCase_  (					self    :		Union[str, Any]      ):
										'''simple docstring'''
										lowercase   :       Any								=np.random.randn(1		,				3		,				4      )
										lowercase   :       Union[str, Any]								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__      )		,				squeeze(UpperCAmelCase__      ).numpy()      )      )

										lowercase   :       Any								=np.random.randn(1		,				4		,				1		,				5      )
										lowercase   :       Optional[int]								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__		,				axis=2      )		,				squeeze(UpperCAmelCase__		,				axis=2      ).numpy()      )      )







				@require_tf
				def    lowerCamelCase_  (					self    :		List[str]      ):
										'''simple docstring'''
										lowercase   :       Union[str, Any]								=np.random.randn(1		,				3		,				4      )
										lowercase   :       Tuple								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__      )		,				squeeze(UpperCAmelCase__      ).numpy()      )      )

										lowercase   :       Optional[Any]								=np.random.randn(1		,				4		,				1		,				5      )
										lowercase   :       Optional[int]								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__		,				axis=2      )		,				squeeze(UpperCAmelCase__		,				axis=2      ).numpy()      )      )







				@require_flax
				def    lowerCamelCase_  (					self    :		Any      ):
										'''simple docstring'''
										lowercase   :       List[Any]								=np.random.randn(1		,				3		,				4      )
										lowercase   :       int								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__      )		,				np.asarray(squeeze(UpperCAmelCase__      )      )      )      )

										lowercase   :       int								=np.random.randn(1		,				4		,				1		,				5      )
										lowercase   :       Optional[int]								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(squeeze(UpperCAmelCase__		,				axis=2      )		,				np.asarray(squeeze(UpperCAmelCase__		,				axis=2      )      )      )      )







				def    lowerCamelCase_  (					self    :		Union[str, Any]      ):
										'''simple docstring'''
										lowercase   :       str								=np.random.randn(3		,				4      )
										self.assertTrue(np.allclose(expand_dims(UpperCAmelCase__		,				axis=1      )		,				np.expand_dims(UpperCAmelCase__		,				axis=1      )      )      )







				@require_torch
				def    lowerCamelCase_  (					self    :		Dict      ):
										'''simple docstring'''
										lowercase   :       List[str]								=np.random.randn(3		,				4      )
										lowercase   :       Dict								=torch.tensor(UpperCAmelCase__      )
										self.assertTrue(np.allclose(expand_dims(UpperCAmelCase__		,				axis=1      )		,				expand_dims(UpperCAmelCase__		,				axis=1      ).numpy()      )      )







				@require_tf
				def    lowerCamelCase_  (					self    :		List[Any]      ):
										'''simple docstring'''
										lowercase   :       Union[str, Any]								=np.random.randn(3		,				4      )
										lowercase   :       List[Any]								=tf.constant(UpperCAmelCase__      )
										self.assertTrue(np.allclose(expand_dims(UpperCAmelCase__		,				axis=1      )		,				expand_dims(UpperCAmelCase__		,				axis=1      ).numpy()      )      )







				@require_flax
				def    lowerCamelCase_  (					self    :		int      ):
										'''simple docstring'''
										lowercase   :       Any								=np.random.randn(3		,				4      )
										lowercase   :       Dict								=jnp.array(UpperCAmelCase__      )
										self.assertTrue(np.allclose(expand_dims(UpperCAmelCase__		,				axis=1      )		,				np.asarray(expand_dims(UpperCAmelCase__		,				axis=1      )      )      )      )








'''simple docstring'''





from collections import defaultdict






def 							_lowerCAmelCase (      __magic_name__	:    str      ,   __magic_name__	:    str	)							->     bool:
						lowercase   :       Optional[int]								=first_str.lower().strip()
						lowercase   :       Union[str, Any]								=second_str.lower().strip()

						# Remove whitespace
						lowercase   :       Optional[int]								=first_str.replace(''' '''      ,   ''''''	)
						lowercase   :       Optional[Any]								=second_str.replace(''' '''      ,   ''''''	)

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

						# Default values for count should be 0
						lowercase   :       defaultdict[str, int]								=defaultdict(__magic_name__	)

						# For each character in input strings,
						# increment count in the corresponding
						for i in range(len(__magic_name__	)	):
												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()
							UpperCamelCase_							=					input("""Enter the first string """).strip()
							UpperCamelCase_							=					input("""Enter the second string """).strip()

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





