



import os
import sys
from contextlib import contextmanager


# Windows only
if os.name == "nt":
     import ctypes
     import msvcrt  # noqa



     class 		_lowercase		(       ctypes.Structure	):
        # _fields is a specific attr expected by ctypes
        _UpperCAmelCase     	=			[('''size''', ctypes.c_int), ('''visible''', ctypes.c_byte)]


def 	UpperCAmelCase__      (      ):






 '''simple docstring'''

 if os.name == "nt":
  a						=		CursorInfo()
  a						=		ctypes.windll.kernelaa.GetStdHandle(-11					)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCAmelCase__ ,					ctypes.byref(UpperCAmelCase__					)					)
  a						=		False
  ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCAmelCase__ ,					ctypes.byref(UpperCAmelCase__					)					)
 elif os.name == "posix":
  sys.stdout.write("\033[?25l"					)
  sys.stdout.flush()


def 	UpperCAmelCase__      (      ):






 '''simple docstring'''

 if os.name == "nt":
  a						=		CursorInfo()
  a						=		ctypes.windll.kernelaa.GetStdHandle(-11					)
  ctypes.windll.kernelaa.GetConsoleCursorInfo(UpperCAmelCase__ ,					ctypes.byref(UpperCAmelCase__					)					)
  a						=		True
  ctypes.windll.kernelaa.SetConsoleCursorInfo(UpperCAmelCase__ ,					ctypes.byref(UpperCAmelCase__					)					)
 elif os.name == "posix":
  sys.stdout.write("\033[?25h"					)
  sys.stdout.flush()




@contextmanager
def 	UpperCAmelCase__      (      ):






 '''simple docstring'''

 try:
  hide_cursor()
  yield
 finally:
  show_cursor()






from ...utils import (
    OptionalDependencyNotAvailable,
    is_torch_available,
    is_transformers_available,
    is_transformers_version,
)


try:
     if not (is_transformers_available() and is_torch_available() and is_transformers_version('''>=''', '''4.25.0''')):
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     from ...utils.dummy_torch_and_transformers_objects import UnCLIPImageVariationPipeline, UnCLIPPipeline
else:
     from .pipeline_unclip import UnCLIPPipeline
     from .pipeline_unclip_image_variation import UnCLIPImageVariationPipeline
     from .text_proj import UnCLIPTextProjModel

