from collections import Counter
from timeit import timeit



def lowerCamelCase						(     SCREAMING_SNAKE_CASE = ""						,    ):
    '''simple docstring'''







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



def lowerCamelCase						(     SCREAMING_SNAKE_CASE = ""			):
    '''simple docstring'''







    if len(SCREAMING_SNAKE_CASE			) == 0:
        return True
    __UpperCamelCase  :Union[str, Any]    						=	input_str.replace(''' '''						,    ''''''			).lower()
    # character_freq_dict: Stores the frequency of every character in the input string
    __UpperCamelCase  :dict[str, int]    						=	{}

    for character in lower_case_input_str:
        __UpperCamelCase  :Optional[Any]    						=	character_freq_dict.get(SCREAMING_SNAKE_CASE						,    0			) + 1
    __UpperCamelCase  :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 lowerCamelCase						(     SCREAMING_SNAKE_CASE = ""			):
    '''simple docstring'''







    print('''\nFor string = '''						,    SCREAMING_SNAKE_CASE						,    ''':'''			)
    print(
        '''> can_string_be_rearranged_as_palindrome_counter()'''						,    '''\tans ='''						,    can_string_be_rearranged_as_palindrome_counter(SCREAMING_SNAKE_CASE			)						,    '''\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(SCREAMING_SNAKE_CASE			)						,    '''\ttime ='''						,    timeit(
            '''z.can_string_be_rearranged_as_palindrome(z.check_str)'''						,    setup='''import __main__ as z'''						,    )						,    '''seconds'''						,    )


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






import os
import unittest

from transformers.models.cpmant.tokenization_cpmant import VOCAB_FILES_NAMES, CpmAntTokenizer
from transformers.testing_utils import require_jieba, tooslow

from ...test_tokenization_common import TokenizerTesterMixin


@require_jieba
class 			lowerCamelCase_  (     UpperCAmelCase_		,			unittest.TestCase				):






    '''simple docstring'''






    a__			:		Any      			=   CpmAntTokenizer
    a__			:		Optional[Any]      			=   False







    def     UpperCamelCase__     (			self) ->			Any:
        super().setUp()

        __UpperCamelCase  :Optional[int]    						=	[
            '''<d>''',
            '''</d>''',
            '''<s>''',
            '''</s>''',
            '''</_>''',
            '''<unk>''',
            '''<pad>''',
            '''</n>''',
            '''我''',
            '''是''',
            '''C''',
            '''P''',
            '''M''',
            '''A''',
            '''n''',
            '''t''',
        ]
        __UpperCamelCase  :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]))







    @tooslow
    def     UpperCamelCase__     (			self) ->			Dict:
        __UpperCamelCase  :Tuple    						=	CpmAntTokenizer.from_pretrained('''openbmb/cpm-ant-10b''')
        __UpperCamelCase  :Dict    						=	'''今天天气真好！'''
        __UpperCamelCase  :Tuple    						=	['''今天''', '''天气''', '''真''', '''好''', '''！''']
        __UpperCamelCase  :Optional[Any]    						=	tokenizer.tokenize(__lowercase)
        self.assertListEqual(__lowercase				,				__lowercase)
        __UpperCamelCase  :int    						=	'''今天天气真好！'''
        __UpperCamelCase  :List[str]    						=	[tokenizer.bos_token] + tokens

        __UpperCamelCase  :List[str]    						=	[6, 9_802, 14_962, 2_082, 831, 244]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(__lowercase)				,				__lowercase)

        __UpperCamelCase  :Dict    						=	tokenizer.decode(__lowercase)
        self.assertEqual(__lowercase				,				__lowercase)





