
'''simple docstring'''
import numpy as np
import PIL
import torch
import torchvision.transforms as T
import torchvision.transforms.functional as TF
from PIL import Image

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE=2_5_6							):
    """simple docstring"""






    snake_case_			:     Optional[Any]        =    min(img.size							)

    if s < target_image_size:
        raise ValueError(f'min dim for image {s} < {target_image_size}'							)

    snake_case_			:     Dict        =    target_image_size / s
    snake_case_			:     Dict        =    (round(r * img.size[1]							), round(r * img.size[0]							))
    snake_case_			:     int        =    TF.resize(__A,		__A,		interpolation=PIL.Image.LANCZOS							)
    snake_case_			:     Union[str, Any]        =    TF.center_crop(__A,		output_size=2 * [target_image_size]							)
    snake_case_			:     Optional[Any]        =    torch.unsqueeze(T.ToTensor()(__A							),		0							)
    return img

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    snake_case_			:     Tuple        =    2.0 * x - 1.0
    return x

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE,		__SCREAMING_SNAKE_CASE=True,		__SCREAMING_SNAKE_CASE="RGB"							):
    """simple docstring"""






    snake_case_			:     Any        =    x.detach().cpu()
    if process:
        snake_case_			:     List[str]        =    post_process_tensor(__A							)
    snake_case_			:     Any        =    x.numpy()
    if process:
        snake_case_			:     Optional[Any]        =    (2_5_5 * x).astype(np.uinta							)
    snake_case_			:     List[str]        =    Image.fromarray(__A							)
    if not x.mode == mode:
        snake_case_			:     Any        =    x.convert(__A							)
    return x

def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    snake_case_			:     List[str]        =    torch.clamp(__A,		-1.0,		1.0							)
    snake_case_			:     List[Any]        =    (x + 1.0) / 2.0
    snake_case_			:     Any        =    x.permute(1,		2,		0							)
    return x


def     UpperCamelCase_  (						__SCREAMING_SNAKE_CASE							):
    """simple docstring"""






    snake_case_			:     Tuple        =    post_process_tensor(x.squeeze()							)
    return x.permute(2,		0,		1							).unsqueeze(0							)







A__										=      10**8





def 				__a							(       __A						):
    if n % 10 == 0:
        return False
    SCREAMING_SNAKE_CASE__         =    str(__A						)
    return s == s[::-1]





def 				__a							(       ):
    SCREAMING_SNAKE_CASE__         =    set()
    SCREAMING_SNAKE_CASE__         =    1
    SCREAMING_SNAKE_CASE__         =    5
    while sum_squares < LIMIT:
        SCREAMING_SNAKE_CASE__         =    first_square + 1
        while sum_squares < LIMIT:
            if is_palindrome(__A						):
                answer.add(__A						)
            last_square += 1
            sum_squares += last_square**2
        first_square += 1
        SCREAMING_SNAKE_CASE__         =    first_square**2 + (first_square + 1) ** 2

    return sum(__A						)


if __name__ == "__main__":
  print(solution())


