



'''simple docstring'''
import math






def A__   (					):
						_UpperCamelCase :		Optional[int]			    =       input('Enter message: '							)
						_UpperCamelCase :		Any			    =       int(input(f'Enter key [2-{len(UpperCAmelCase_							) - 1}]: '							)							)
						_UpperCamelCase :		Optional[Any]			    =       input('Encryption/Decryption [e/d]: '							)

						if mode.lower().startswith('e'							):
												_UpperCamelCase :		int			    =       encrypt_message(UpperCAmelCase_  ,  UpperCAmelCase_							)
						elif mode.lower().startswith('d'							):
												_UpperCamelCase :		List[str]			    =       decrypt_message(UpperCAmelCase_  ,  UpperCAmelCase_							)

						# Append pipe symbol (vertical bar) to identify spaces at the end.
						print(f'Output:\n{text + "|"}'							)






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase :		List[Any]			    =       [''] * key
						for col in range(UpperCAmelCase_							):
												_UpperCamelCase :		str			    =       col
												while pointer < len(UpperCAmelCase_							):
																		cipher_text[col] += message[pointer]
																		pointer += key
						return "".join(UpperCAmelCase_							)






def A__   (					UpperCAmelCase_  ,  UpperCAmelCase_							):
						_UpperCamelCase :		Tuple			    =       math.ceil(len(UpperCAmelCase_							) / key							)
						_UpperCamelCase :		Optional[Any]			    =       key
						_UpperCamelCase :		Tuple			    =       (num_cols * num_rows) - len(UpperCAmelCase_							)
						_UpperCamelCase :		List[str]			    =       [''] * num_cols
						_UpperCamelCase :		Tuple			    =       0
						_UpperCamelCase :		List[Any]			    =       0

						for symbol in message:
												plain_text[col] += symbol
												col += 1

												if (
												    (col == num_cols)
												    or (col == num_cols - 1)
												    and (row >= num_rows - num_shaded_boxes)
												):
																		_UpperCamelCase :		List[Any]			    =       0
																		row += 1

						return "".join(UpperCAmelCase_							)


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					main()







'''simple docstring'''
from torch import nn






def A__   (					UpperCAmelCase_							):
						if act_fn in ["swish", "silu"]:
												return nn.SiLU()
						elif act_fn == "mish":
												return nn.Mish()
						elif act_fn == "gelu":
												return nn.GELU()
						else:
												raise ValueError(f'Unsupported activation function: {act_fn}'							)


