


'''simple docstring'''





from collections import Counter
from timeit import timeit






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: Tuple = "",):






			"""simple docstring"""




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






def 						UpperCAmelCase__(				_SCREAMING_SNAKE_CASE					: List[str] = "" ):






			"""simple docstring"""




			if len(__UpperCAmelCase ) == 0:
						return True
			__A=	input_str.replace(' ','' ).lower()
			# character_freq_dict: Stores the frequency of every character in the input string
			__A=	{}

			for character in lower_case_input_str:
						__A=	character_freq_dict.get(__UpperCAmelCase,0 ) + 1
			__A=	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__(				_SCREAMING_SNAKE_CASE					: Optional[Any] = "" ):






			"""simple docstring"""




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


if __name__ == "__main__":
					UpperCAmelCase__  			=				input(
					    '''Enter string to determine if it can be rearranged as a palindrome or not: '''
					).strip()
					benchmark(check_str)
					UpperCAmelCase__  			=				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 math

import tensorflow as tf
from packaging import version







def a_     (    __UpperCAmelCase					)				->					Optional[Any]:





			"""simple docstring"""







			snake_case:    str      							=tf.convert_to_tensor(__UpperCAmelCase					)
			snake_case:    int      							=0.5 * (1.0 + tf.math.erf(x / tf.cast(tf.sqrt(2.0					)				,							x.dtype					)					))

			return x * cdf







def a_     (    __UpperCAmelCase					)				->					Dict:





			"""simple docstring"""







			snake_case:    Optional[int]      							=tf.convert_to_tensor(__UpperCAmelCase					)
			snake_case:    Tuple      							=tf.cast(math.pi				,							x.dtype					)
			snake_case:    Dict      							=tf.cast(0.04_4715				,							x.dtype					)
			snake_case:    List[str]      							=0.5 * (1.0 + tf.tanh(tf.sqrt(2.0 / pi					) * (x + coeff * tf.pow(__UpperCAmelCase				,							3					))					))

			return x * cdf







def a_     (    __UpperCAmelCase					)				->					Tuple:





			"""simple docstring"""







			snake_case:    Optional[int]      							=tf.convert_to_tensor(__UpperCAmelCase					)

			return x * tf.tanh(tf.math.softplus(__UpperCAmelCase					)					)







def a_     (    __UpperCAmelCase					)				->					Dict:





			"""simple docstring"""







			snake_case:    List[str]      							=tf.convert_to_tensor(__UpperCAmelCase					)
			snake_case:    Dict      							=tf.cast(0.04_4715				,							x.dtype					)
			snake_case:    List[str]      							=tf.cast(0.79_7884_5608				,							x.dtype					)

			return 0.5 * x * (1.0 + tf.tanh(x * coeffa * (1.0 + coeffa * x * x)					))







def a_     (    __UpperCAmelCase					)				->					Optional[Any]:





			"""simple docstring"""







			snake_case:    Union[str, Any]      							=tf.convert_to_tensor(__UpperCAmelCase					)
			snake_case:    Tuple      							=tf.cast(1.702				,							x.dtype					)
			return x * tf.math.sigmoid(coeff * x					)







def a_     (    __UpperCAmelCase					)				->					int:





			"""simple docstring"""







			return tf.clip_by_value(_gelu(__UpperCAmelCase					)				,							-10				,							10					)







def a_     (    __UpperCAmelCase				,							__UpperCAmelCase=-1					)				->					List[str]:





			"""simple docstring"""







			snake_case							,  snake_case:    int      							=tf.split(__UpperCAmelCase				,							2				,							axis=__UpperCAmelCase					)
			return a * tf.math.sigmoid(__UpperCAmelCase					)


if version.parse(tf.version.VERSION) >= version.parse('2.4'):







	def a_     (    __UpperCAmelCase					)				->					int:





				"""simple docstring"""







				return tf.keras.activations.gelu(__UpperCAmelCase				,							approximate=__UpperCAmelCase					)

	a							   =				tf.keras.activations.gelu







	a							   =				approximate_gelu_wrap
else:
	a							   =				_gelu
	a							   =				_gelu_new


a							   =				{
    'gelu': gelu,
    'gelu_10': gelu_aa,
    'gelu_fast': gelu_fast,
    'gelu_new': gelu_new,
    'glu': glu,
    'mish': mish,
    'quick_gelu': quick_gelu,
    'relu': tf.keras.activations.relu,
    'sigmoid': tf.keras.activations.sigmoid,
    'silu': tf.keras.activations.swish,
    'swish': tf.keras.activations.swish,
    'tanh': tf.keras.activations.tanh,
}







def a_     (    __UpperCAmelCase					)				->					Dict:





			"""simple docstring"""







			if activation_string in ACTaFN:
						return ACTaFN[activation_string]
			else:
						raise KeyError(f'''function {activation_string} not found in ACT2FN mapping {list(ACTaFN.keys()					)}'''					)




