





from collections import defaultdict







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

  # Remove whitespace
  __snake_case      : int						=				first_str.replace(" "      ,   "" )
  __snake_case      : int						=				second_str.replace(" "      ,   "" )

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

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

  # For each character in input strings,
  # increment count in the corresponding
  for i in range(len(__a ) ):
    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.''')








import os
import unittest

from transformers.models.bartpho.tokenization_bartpho import VOCAB_FILES_NAMES, BartphoTokenizer
from transformers.testing_utils import get_tests_dir

from ...test_tokenization_common import TokenizerTesterMixin


__A									=				get_tests_dir("fixtures/test_sentencepiece_bpe.model")



class    _SCREAMING_SNAKE_CASE						(	__SCREAMING_SNAKE_CASE    ,							unittest.TestCase    ):







 '''simple docstring'''
 lowercase_		=			BartphoTokenizer
 lowercase_		=			False
 lowercase_		=			True

 def 							SCREAMING_SNAKE_CASE_					(self				:   List[Any])       ->Tuple:



   '''simple docstring'''



   super().setUp()

   lowerCamelCase__:      int			  =["▁This", "▁is", "▁a", "▁t", "est"]
   lowerCamelCase__:      Tuple			  =dict(zip(UpperCAmelCase_       , range(len(UpperCAmelCase_))))
   lowerCamelCase__:      List[Any]			  ={"unk_token": "<unk>"}

   lowerCamelCase__:      Dict			  =os.path.join(self.tmpdirname       , VOCAB_FILES_NAMES["monolingual_vocab_file"])
   with open(self.monolingual_vocab_file       , "w"       , encoding="utf-8") as fp:
     for token in vocab_tokens:
       fp.write(F"""{token} {vocab_tokens[token]}\n""")

   lowerCamelCase__:      Dict			  =BartphoTokenizer(UpperCAmelCase_       , self.monolingual_vocab_file       , **self.special_tokens_map)
   tokenizer.save_pretrained(self.tmpdirname)

 def 							SCREAMING_SNAKE_CASE_					(self				:   Optional[int]       , **UpperCAmelCase_				:   Optional[Any])       ->str:



   '''simple docstring'''



   kwargs.update(self.special_tokens_map)
   return BartphoTokenizer.from_pretrained(self.tmpdirname       , **UpperCAmelCase_)

 def 							SCREAMING_SNAKE_CASE_					(self				:   Union[str, Any]       , UpperCAmelCase_				:   Optional[Any])       ->List[Any]:



   '''simple docstring'''



   lowerCamelCase__:      Optional[int]			  ="This is a là test"
   lowerCamelCase__:      Optional[Any]			  ="This is a<unk><unk> test"
   return input_text, output_text







 def 							SCREAMING_SNAKE_CASE_					(self				:   List[Any])       ->Optional[Any]:



   '''simple docstring'''



   lowerCamelCase__:      str			  =BartphoTokenizer(UpperCAmelCase_       , self.monolingual_vocab_file       , **self.special_tokens_map)
   lowerCamelCase__:      List[Any]			  ="This is a là test"
   lowerCamelCase__:      Optional[int]			  ="▁This ▁is ▁a ▁l à ▁t est".split()
   lowerCamelCase__:      Optional[int]			  =tokenizer.tokenize(UpperCAmelCase_)
   self.assertListEqual(UpperCAmelCase_       , UpperCAmelCase_)

   lowerCamelCase__:      Tuple			  =tokens + [tokenizer.unk_token]
   lowerCamelCase__:      List[Any]			  =[4, 5, 6, 3, 3, 7, 8, 3]
   self.assertListEqual(tokenizer.convert_tokens_to_ids(UpperCAmelCase_)       , UpperCAmelCase_)

