


'''simple docstring'''






import PIL.Image
import PIL.ImageOps
from packaging import version
from PIL import Image


if version.parse(version.parse(PIL.__version__).base_version) >= version.parse("9.1.0"):
  __A					:  Union[str, Any]											=      {
      "linear": PIL.Image.Resampling.BILINEAR,
      "bilinear": PIL.Image.Resampling.BILINEAR,
      "bicubic": PIL.Image.Resampling.BICUBIC,
      "lanczos": PIL.Image.Resampling.LANCZOS,
      "nearest": PIL.Image.Resampling.NEAREST,
  }
else:
  __A					:  Any											=      {
      "linear": PIL.Image.LINEAR,
      "bilinear": PIL.Image.BILINEAR,
      "bicubic": PIL.Image.BICUBIC,
      "lanczos": PIL.Image.LANCZOS,
      "nearest": PIL.Image.NEAREST,
  }







def 				UpperCamelCase_			(    A__					:   str					):
  '''simple docstring'''





  lowerCAmelCase_			:      List[Any]			=   (images / 2 + 0.5).clamp(0							,    1					)
  lowerCAmelCase_			:      List[Any]			=   images.cpu().permute(0							,    2							,    3							,    1					).float().numpy()
  lowerCAmelCase_			:      Any			=   numpy_to_pil(A__					)
  return images







def 				UpperCamelCase_			(    A__					:   int					):
  '''simple docstring'''





  if images.ndim == 3:
    lowerCAmelCase_			:      Union[str, Any]			=   images[None, ...]
  lowerCAmelCase_			:      Tuple			=   (images * 2_55).round().astype("""uint8"""					)
  if images.shape[-1] == 1:
    # special case for grayscale (single channel) images
    lowerCAmelCase_			:      List[str]			=   [Image.fromarray(image.squeeze()							,    mode="""L"""					) for image in images]
  else:
    lowerCAmelCase_			:      Union[str, Any]			=   [Image.fromarray(A__					) for image in images]

  return pil_images







'''simple docstring'''






def 				UpperCamelCase_			(    A__					:   int = 10_00					):
  '''simple docstring'''





  lowerCAmelCase_			:      Optional[Any]			=   3
  lowerCAmelCase_			:      Dict			=   0
  while a < n:
    if a % 3 == 0 or a % 5 == 0:
      result += a
    elif a % 15 == 0:
      result -= a
    a += 1
  return result


if __name__ == "__main__":
  print(F'''{solution() = }''')



