


'''simple docstring'''






from collections import Counter
from timeit import timeit





def      UpperCAmelCase      (		lowerCamelCase_  :str = ""				,      ):







		'''simple docstring'''
		return sum(c % 2 for c in Counter(input_str.replace(""" """				,      """""" ).lower() ).values() ) < 2





def      UpperCAmelCase      (		lowerCamelCase_  :str = "" ):







		'''simple docstring'''
		if len(lowerCamelCase_ ) == 0:
				return True
		snake_case_		:							List[Any]			       =						input_str.replace(""" """				,      """""" ).lower()
		# character_freq_dict: Stores the frequency of every character in the input string
		snake_case_		:							dict[str, int]			       =						{}

		for character in lower_case_input_str:
				snake_case_		:							Tuple			       =						character_freq_dict.get(lowerCamelCase_				,      0 ) + 1
		snake_case_		:							Optional[int]			       =						0

		for character_count in character_freq_dict.values():
				if character_count % 2:
						odd_char += 1
		if odd_char > 1:
				return False
		return True





def      UpperCAmelCase      (		lowerCamelCase_  :str = "" ):







		'''simple docstring'''
		print("""\nFor string = """				,      lowerCamelCase_				,      """:""" )
		print(
		    """> can_string_be_rearranged_as_palindrome_counter()"""				,      """\tans ="""				,      can_string_be_rearranged_as_palindrome_counter(lowerCamelCase_ )				,      """\ttime ="""				,      timeit(
		        """z.can_string_be_rearranged_as_palindrome_counter(z.check_str)"""				,      setup="""import __main__ as z"""				,      )				,      """seconds"""				,      )
		print(
		    """> can_string_be_rearranged_as_palindrome()"""				,      """\tans ="""				,      can_string_be_rearranged_as_palindrome(lowerCamelCase_ )				,      """\ttime ="""				,      timeit(
		        """z.can_string_be_rearranged_as_palindrome(z.check_str)"""				,      setup="""import __main__ as z"""				,      )				,      """seconds"""				,      )


if __name__ == "__main__":
							__A	:	List[str]     =     input(
							    'Enter string to determine if it can be rearranged as a palindrome or not: '
							).strip()
							benchmark(check_str)
							__A	:	int     =     can_string_be_rearranged_as_palindrome_counter(check_str)
							print(F'{check_str} can {"" if status else "not "}be rearranged as a palindrome')



'''simple docstring'''






import os
import unittest

from transformers.models.transfo_xl.tokenization_transfo_xl import VOCAB_FILES_NAMES, TransfoXLTokenizer

from ...test_tokenization_common import TokenizerTesterMixin
class 						__UpperCamelCase	(						lowercase__						,  unittest.TestCase							):
							lowercase			:		Dict   		=  TransfoXLTokenizer
							lowercase			:		Optional[Any]   		=  False
							lowercase			:		Dict   		=  False





							def 		a__   (  self		:Union[str, Any]			):
									super().setUp()

									snake_case_		:							Optional[int]			       =						[
									    """<unk>""",
									    """[CLS]""",
									    """[SEP]""",
									    """want""",
									    """unwanted""",
									    """wa""",
									    """un""",
									    """running""",
									    """,""",
									    """low""",
									    """l""",
									]
									snake_case_		:							Optional[int]			       =						os.path.join(self.tmpdirname  ,VOCAB_FILES_NAMES["""vocab_file"""]			)
									with open(self.vocab_file  ,"""w"""  ,encoding="""utf-8"""			) as vocab_writer:
											vocab_writer.write("""""".join([x + """\n""" for x in vocab_tokens]			)			)





							def 		a__   (  self		:List[Any]  ,**_UpperCamelCase		:Optional[Any]			):
									snake_case_		:							Tuple			       =						True
									return TransfoXLTokenizer.from_pretrained(self.tmpdirname  ,**_UpperCamelCase			)





							def 		a__   (  self		:Tuple  ,_UpperCamelCase		:Union[str, Any]			):
									snake_case_		:							Any			       =						"""<unk> UNwanted , running"""
									snake_case_		:							Optional[int]			       =						"""<unk> unwanted, running"""
									return input_text, output_text





							def 		a__   (  self		:Dict			):
									snake_case_		:							Dict			       =						TransfoXLTokenizer(vocab_file=self.vocab_file  ,lower_case=_UpperCamelCase			)

									snake_case_		:							Dict			       =						tokenizer.tokenize("""<unk> UNwanted , running"""			)
									self.assertListEqual(_UpperCamelCase  ,["""<unk>""", """unwanted""", """,""", """running"""]			)

									self.assertListEqual(tokenizer.convert_tokens_to_ids(_UpperCamelCase			)  ,[0, 4, 8, 7]			)





							def 		a__   (  self		:Optional[Any]			):
									snake_case_		:							Dict			       =						TransfoXLTokenizer(lower_case=_UpperCamelCase			)

									self.assertListEqual(
									    tokenizer.tokenize(""" \tHeLLo ! how  \n Are yoU ?  """			)  ,["""hello""", """!""", """how""", """are""", """you""", """?"""]			)





							def 		a__   (  self		:Any			):
									snake_case_		:							List[Any]			       =						TransfoXLTokenizer(lower_case=_UpperCamelCase			)

									self.assertListEqual(
									    tokenizer.tokenize(""" \tHeLLo ! how  \n Are yoU ?  """			)  ,["""HeLLo""", """!""", """how""", """Are""", """yoU""", """?"""]			)





							def 		a__   (  self		:List[str]			):
									snake_case_		:							str			       =						TransfoXLTokenizer(lower_case=_UpperCamelCase			)
									snake_case_		:							List[str]			       =						"""Hello (bracket) and side-scrolled [and] Henry's $5,000 with 3.34 m. What's up!?"""
									snake_case_		:							Optional[int]			       =						[
									    """Hello""",
									    """(""",
									    """bracket""",
									    """)""",
									    """and""",
									    """side""",
									    """@-@""",
									    """scrolled""",
									    """[""",
									    """and""",
									    """]""",
									    """Henry""",
									    """'s""",
									    """$""",
									    """5""",
									    """@,@""",
									    """000""",
									    """with""",
									    """3""",
									    """@.@""",
									    """34""",
									    """m""",
									    """.""",
									    """What""",
									    """'s""",
									    """up""",
									    """!""",
									    """?""",
									]

									self.assertListEqual(tokenizer.tokenize(_UpperCamelCase			)  ,_UpperCamelCase			)

									self.assertEqual(tokenizer.convert_tokens_to_string(_UpperCamelCase			)  ,_UpperCamelCase			)





							def 		a__   (  self		:Dict			):
									snake_case_		:							Union[str, Any]			       =						self.get_tokenizer()
									snake_case_		:							Dict			       =						len(_UpperCamelCase			)

									tokenizer.add_tokens(["""new1""", """new2"""]			)
									tokenizer.move_added_token("""new1"""  ,1			)

									# Check that moved token is not copied (duplicate)
									self.assertEqual(len(_UpperCamelCase			)  ,original_len + 2			)
									# Check that token is moved to specified id
									self.assertEqual(tokenizer.encode("""new1"""			)  ,[1]			)
									self.assertEqual(tokenizer.decode([1]			)  ,"""new1"""			)