





import math






def       _A  (      lowerCamelCase   ):
   a__	:						Any      		=  0
   a__	:						Union[str, Any]      		=  0
   while num > 0:
      a__	:						Optional[int]      		=  num % 8
      a__	:						List[str]      		=  octal + (remainder * math.floor(math.pow(10							, lowerCamelCase   )   ))
      counter += 1
      a__	:						Any      		=  math.floor(num / 8   )  # basically /= 8 without remainder if any
      # This formatting removes trailing '.0' from `octal`.
   return F"""0o{int(lowerCamelCase   )}"""






def       _A  (      ):
   print("\n2 in octal is:"   )
   print(decimal_to_octal(2   )   )  # = 2
   print("\n8 in octal is:"   )
   print(decimal_to_octal(8   )   )  # = 10
   print("\n65 in octal is:"   )
   print(decimal_to_octal(65   )   )  # = 101
   print("\n216 in octal is:"   )
   print(decimal_to_octal(216   )   )  # = 330
   print("\n512 in octal is:"   )
   print(decimal_to_octal(512   )   )  # = 1000
   print("\n"   )


if __name__ == "__main__":
  main()








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"""):
  SCREAMING_SNAKE_CASE__       :			int			      =						{
      """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:
  SCREAMING_SNAKE_CASE__       :			Dict			      =						{
      """linear""": PIL.Image.LINEAR,
      """bilinear""": PIL.Image.BILINEAR,
      """bicubic""": PIL.Image.BICUBIC,
      """lanczos""": PIL.Image.LANCZOS,
      """nearest""": PIL.Image.NEAREST,
  }






def       _A  (      lowerCamelCase   ):
   a__	:						Optional[int]      		=  (images / 2 + 0.5).clamp(0							, 1   )
   a__	:						List[Any]      		=  images.cpu().permute(0							, 2							, 3							, 1   ).float().numpy()
   a__	:						int      		=  numpy_to_pil(lowerCamelCase   )
   return images






def       _A  (      lowerCamelCase   ):
   if images.ndim == 3:
      a__	:						Tuple      		=  images[None, ...]
   a__	:						Dict      		=  (images * 255).round().astype("uint8"   )
   if images.shape[-1] == 1:
      # special case for grayscale (single channel) images
      a__	:						str      		=  [Image.fromarray(image.squeeze()							, mode="L"   ) for image in images]
   else:
      a__	:						List[Any]      		=  [Image.fromarray(lowerCamelCase   ) for image in images]

   return pil_images

