





import string






def 					SCREAMING_SNAKE_CASE__				(							UpperCamelCase__:				str     ):
		SCREAMING_SNAKE_CASE__								=   """"""
		for i in sequence:
				SCREAMING_SNAKE_CASE__								=   ord(UpperCamelCase__     )
				if 65 <= extract <= 90:
						output += chr(155 - extract     )
				elif 97 <= extract <= 122:
						output += chr(219 - extract     )
				else:
						output += i
		return output






def 					SCREAMING_SNAKE_CASE__				(							UpperCamelCase__:				str     ):
		SCREAMING_SNAKE_CASE__								=   string.ascii_letters
		SCREAMING_SNAKE_CASE__								=   string.ascii_lowercase[::-1] + string.ascii_uppercase[::-1]
		return "".join(
		    letters_reversed[letters.index(UpperCamelCase__     )] if c in letters else c for c in sequence     )






def 					SCREAMING_SNAKE_CASE__				(							):
		from timeit import timeit

		print("""Running performance benchmarks..."""     )
		SCREAMING_SNAKE_CASE__								=   """from string import printable ; from __main__ import atbash, atbash_slow"""
		print(f'''> atbash_slow(): {timeit('atbash_slow(printable)'       , setup=UpperCamelCase__     )} seconds'''     )
		print(f'''>      atbash(): {timeit('atbash(printable)'       , setup=UpperCamelCase__     )} seconds'''     )


if __name__ == "__main__":
	for example in ("ABCDEFGH", "123GGjj", "testStringtest", "with space"):
		print(F'''{example} encrypted in atbash: {atbash(example)}''')
	benchmark()







'''simple docstring'''







import re

from flax.core.frozen_dict import freeze
from flax.traverse_util import flatten_dict, unflatten_dict
from jax.experimental import PartitionSpec as P


# Sentinels
__lowerCAmelCase									=   object()

# For specifying empty leaf dict `{}`
__lowerCAmelCase									=   object()





def 		_UpperCAmelCase (				__A				: List[str]    ,		__A				: Tuple   ):
				a_		:	List[Any]									=   tuple((re.compile(x + '''$'''   ) for x in qs)   )
				for i in range(len(__A   ) - len(__A   ) + 1   ):
								a_		:	Union[str, Any]									=   [x.match(__A   ) for x, y in zip(__A    ,		ks[i:]   )]
								if matches and all(__A   ):
												return True
				return False





def 		_UpperCAmelCase (				__A				: List[str]   ):
				def replace(__A				: int    ,		__A				: Union[str, Any]   ):
								for rule, replacement in rules:
												if _match(__A    ,		__A   ):
																return replacement
								return val

				return replace





def 		_UpperCAmelCase (				):
				return [
				    # embeddings
				    (("transformer", "wpe", "embedding"), P('''mp'''    ,		__A   )),
				    (("transformer", "wte", "embedding"), P('''mp'''    ,		__A   )),
				    # atention
				    (("attention", "(q_proj|k_proj|v_proj)", "kernel"), P(__A    ,		'''mp'''   )),
				    (("attention", "out_proj", "kernel"), P('''mp'''    ,		__A   )),
				    (("attention", "out_proj", "bias"), None),
				    # mlp
				    (("mlp", "c_fc", "kernel"), P(__A    ,		'''mp'''   )),
				    (("mlp", "c_fc", "bias"), P('''mp'''   )),
				    (("mlp", "c_proj", "kernel"), P('''mp'''    ,		__A   )),
				    (("mlp", "c_proj", "bias"), None),
				    # layer norms
				    ((r"ln_\d+", "bias"), None),
				    ((r"\d+", r"ln_\d+", "scale"), None),
				    (("ln_f", "bias"), None),
				    (("ln_f", "scale"), None),
				]





def 		_UpperCAmelCase (				__A				: Union[str, Any]   ):
				a_		:	Tuple									=   _get_partition_rules()
				a_		:	Tuple									=   _replacement_rules(__A   )
				a_		:	Optional[Any]									=   {k: _unmatched for k in flatten_dict(__A   )}
				a_		:	Optional[Any]									=   {k: replace(__A    ,		__A   ) for k, v in initd.items()}
				assert _unmatched not in result.values(), "Incomplete partition spec."
				return freeze(unflatten_dict(__A   )   )




