

'''simple docstring'''

A_       						=							[4, 1, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A_       						=							[3, 7, 7, 4, 2, 6, 4, 1, 5, 3, 7, 5]
A_       						=							{
    0: "Sunday",
    1: "Monday",
    2: "Tuesday",
    3: "Wednesday",
    4: "Thursday",
    5: "Friday",
    6: "Saturday",
}





def    A_  ( snake_case      ,       snake_case      ,       snake_case ):
  assert len(str(snake_case ) ) > 2, "year should be in YYYY format"
  assert 1 <= month <= 12, "month should be between 1 to 12"
  assert 1 <= day <= 31, "day should be between 1 to 31"

  # Doomsday algorithm:
  SCREAMING_SNAKE_CASE:Any						      =					year // 100
  SCREAMING_SNAKE_CASE:Optional[Any]						      =					(5 * (century % 4) + 2) % 7
  SCREAMING_SNAKE_CASE:Any						      =					year % 100
  SCREAMING_SNAKE_CASE:Union[str, Any]						      =					centurian % 12
  SCREAMING_SNAKE_CASE:Union[str, Any]						      =					(
      (centurian // 12) + centurian_m + (centurian_m // 4) + century_anchor
  ) % 7
  SCREAMING_SNAKE_CASE:Optional[Any]						      =					(
      DOOMSDAY_NOT_LEAP[month - 1]
      if (year % 4 != 0) or (centurian == 0 and (year % 400) == 0)
      else DOOMSDAY_LEAP[month - 1]
  )
  SCREAMING_SNAKE_CASE:List[str]						      =					(dooms_day + day - day_anchor) % 7
  return WEEK_DAY_NAMES[week_day]


if __name__ == "__main__":
    import doctest

    doctest.testmod()









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





def    A_  ( snake_case ):
  SCREAMING_SNAKE_CASE:Any						      =					(images / 2 + 0.5).clamp(0      ,       1 )
  SCREAMING_SNAKE_CASE:Optional[Any]						      =					images.cpu().permute(0      ,       2      ,       3      ,       1 ).float().numpy()
  SCREAMING_SNAKE_CASE:str						      =					numpy_to_pil(snake_case )
  return images





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

  return pil_images






