



from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL

from ...utils import BaseOutput, is_invisible_watermark_available, is_torch_available, is_transformers_available



@dataclass
class 				__snake_case  (     __UpperCAmelCase						):


    '''simple docstring'''







    lowerCamelCase__						:		Union[List[PIL.Image.Image], np.ndarray]


if is_transformers_available() and is_torch_available() and is_invisible_watermark_available():
  from .pipeline_stable_diffusion_xl import StableDiffusionXLPipeline
  from .pipeline_stable_diffusion_xl_imgaimg import StableDiffusionXLImgaImgPipeline







from __future__ import annotations

from collections.abc import Generator


def        __snake_case       (						lowerCAmelCase_  )							->	Generator[int, None, None]:
    if not isinstance(lowerCAmelCase_   ,       lowerCAmelCase_  ) or n < 1:
        raise Exception('''Sequence only defined for positive integers'''  )

    yield n
    while n != 1:
        if n % 2 == 0:
            n //= 2
        else:
            SCREAMING_SNAKE_CASE__       							= 3 * n + 1
        yield n


def        __snake_case       (						)							->	str:
    SCREAMING_SNAKE_CASE__       							= 4_3
    SCREAMING_SNAKE_CASE__       							= tuple(collatz_sequence(lowerCAmelCase_  )  )
    print(lowerCAmelCase_  )
    print(f'''Collatz sequence from {n} took {len(lowerCAmelCase_  )} steps.'''  )


if __name__ == "__main__":
  main()
