





"""simple docstring"""
from typing import Dict, Optional, Tuple

import torch






def    A__							(     UpperCamelCase			):
							A						=    boundaries[1] - boundaries[0]
							A						=    boundaries + step / 2
							A						=    torch.cat([bin_centers, (bin_centers[-1] + step).unsqueeze(-1			)]   ,    dim=0			)
							return bin_centers






def    A__							(     UpperCamelCase   ,    UpperCamelCase   ,    ):
							A						=    _calculate_bin_centers(UpperCamelCase			)
							return (
							    torch.sum(aligned_distance_error_probs * bin_centers   ,    dim=-1			),
							    bin_centers[-1],
							)






def    A__							(     UpperCamelCase   ,    UpperCamelCase = 31   ,    UpperCamelCase = 64   ,    **UpperCamelCase   ,    ):
							A						=    torch.linspace(0   ,    UpperCamelCase   ,    steps=(no_bins - 1)   ,    device=logits.device			)

							A						=    torch.nn.functional.softmax(UpperCamelCase   ,    dim=-1			)
							A						=    _calculate_expected_aligned_error(
							    alignment_confidence_breaks=UpperCamelCase   ,    aligned_distance_error_probs=UpperCamelCase   ,    )

							return {
							    "aligned_confidence_probs": aligned_confidence_probs,
							    "predicted_aligned_error": predicted_aligned_error,
							    "max_predicted_aligned_error": max_predicted_aligned_error,
							}






def    A__							(     UpperCamelCase   ,    UpperCamelCase = None   ,    UpperCamelCase = 31   ,    UpperCamelCase = 64   ,    UpperCamelCase = 1E-8   ,    **UpperCamelCase   ,    ):
							if residue_weights is None:
														A						=    logits.new_ones(logits.shape[-2]			)

							A						=    torch.linspace(0   ,    UpperCamelCase   ,    steps=(no_bins - 1)   ,    device=logits.device			)

							A						=    _calculate_bin_centers(UpperCamelCase			)
							torch.sum(UpperCamelCase			)
							A						=    logits.shape[-2]
							A						=    max(UpperCamelCase   ,    19			)

							A						=    1.24 * (clipped_n - 15) ** (1.0 / 3) - 1.8

							A						=    torch.nn.functional.softmax(UpperCamelCase   ,    dim=-1			)

							A						=    1.0 / (1 + (bin_centers**2) / (da**2))
							A						=    torch.sum(probs * tm_per_bin   ,    dim=-1			)

							A						=    residue_weights / (eps + residue_weights.sum())
							A						=    torch.sum(predicted_tm_term * normed_residue_mask   ,    dim=-1			)

							A						=    per_alignment * residue_weights

							A						=    (weighted == torch.max(UpperCamelCase			)).nonzero()[0]
							return per_alignment[tuple(UpperCamelCase			)]










'''simple docstring'''







def 					SCREAMING_SNAKE_CASE_			(UpperCamelCase							,     UpperCamelCase = 13 ) ->			str:
							lowerCamelCase__   :      Dict			    =			""""""
							for c in s:
														if "A" <= c <= "Z":
																					out += chr(ord("""A""" ) + (ord(UpperCamelCase ) - ord("""A""" ) + n) % 26 )
														elif "a" <= c <= "z":
																					out += chr(ord("""a""" ) + (ord(UpperCamelCase ) - ord("""a""" ) + n) % 26 )
														else:
																					out += c
							return out





def 					SCREAMING_SNAKE_CASE_			() ->			None:
							lowerCamelCase__   :      Dict			    =			input("""Enter message: """ )

							lowerCamelCase__   :      str			    =			dencrypt(UpperCamelCase							,     13 )
							print("""Encryption:"""							,     UpperCamelCase )

							lowerCamelCase__   :      List[str]			    =			dencrypt(UpperCamelCase							,     13 )
							print("""Decryption: """							,     UpperCamelCase )


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			main()

