import types
from typing import List, Optional, Tuple, Union

import torch
from transformers import CLIPTextModelWithProjection, CLIPTokenizer
from transformers.models.clip.modeling_clip import CLIPTextModelOutput

from diffusers.models import PriorTransformer
from diffusers.pipelines import DiffusionPipeline, StableDiffusionImageVariationPipeline
from diffusers.schedulers import UnCLIPScheduler
from diffusers.utils import logging, randn_tensor


UpperCAmelCase_    		=				logging.get_logger(__name__)  # pylint: disable=invalid-name

def 				UpperCamelCase					(     self							,       lowerCAmelCase_							,       lowerCAmelCase_							,       lowerCAmelCase_							,       lowerCAmelCase_ )		->    List[Any]:




       '''simple docstring'''






       _A=						image.to(device=lowerCAmelCase_ )
       _A=						image  # take image as image_embeddings
       _A=						image_embeddings.unsqueeze(1 )

       # duplicate image embeddings for each generation per prompt, using mps friendly method
       _A,      _A,      _A=						image_embeddings.shape
       _A=						image_embeddings.repeat(1							,       lowerCAmelCase_							,       1 )
       _A=						image_embeddings.view(bs_embed * num_images_per_prompt							,       lowerCAmelCase_							,       -1 )

       if do_classifier_free_guidance:
              _A=						torch.zeros_like(lowerCAmelCase_ )

              # For classifier free guidance, we need to do two forward passes.
              # Here we concatenate the unconditional and text embeddings into a single batch
              # to avoid doing two forward passes
              _A=						torch.cat([uncond_embeddings, image_embeddings] )

       return image_embeddings





class   lowerCAmelCase    (       _a      ):



     def __init__(       self					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__ = None					,   ):
            super().__init__()

            _A=						{'image_encoder': None} if decoder_pipe_kwargs is None else decoder_pipe_kwargs

            _A=						decoder_pipe_kwargs.get('torch_dtype'					,   lowerCAmelCase__							) or prior.dtype

            _A=						StableDiffusionImageVariationPipeline.from_pretrained(
                'lambdalabs/sd-image-variations-diffusers'					,   **lowerCAmelCase__							)

            # replace `_encode_image` method
            _A=						types.MethodType(_encode_image					,   self.decoder_pipe							)

            self.register_modules(
                prior=lowerCAmelCase__					,   tokenizer=lowerCAmelCase__					,   text_encoder=lowerCAmelCase__					,   prior_scheduler=lowerCAmelCase__					,   )



     def       a__	(       self					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   ):
            if text_model_output is None:
                   _A=						len(lowerCAmelCase__							) if isinstance(lowerCAmelCase__					,   lowerCAmelCase__							) else 1
                   # get prompt text embeddings
                   _A=						self.tokenizer(
                       lowerCAmelCase__					,   padding='max_length'					,   max_length=self.tokenizer.model_max_length					,   return_tensors='pt'					,   )
                   _A=						text_inputs.input_ids
                   _A=						text_inputs.attention_mask.bool().to(lowerCAmelCase__							)

                   if text_input_ids.shape[-1] > self.tokenizer.model_max_length:
                          _A=						self.tokenizer.batch_decode(text_input_ids[:, self.tokenizer.model_max_length :]							)
                          logger.warning(
                              'The following part of your input was truncated because CLIP can only handle sequences up to'
                              f" {self.tokenizer.model_max_length} tokens: {removed_text}"							)
                          _A=						text_input_ids[:, : self.tokenizer.model_max_length]

                   _A=						self.text_encoder(text_input_ids.to(lowerCAmelCase__							)							)

                   _A=						text_encoder_output.text_embeds
                   _A=						text_encoder_output.last_hidden_state

            else:
                   _A=						text_model_output[0].shape[0]
                   _A,      _A=						text_model_output[0], text_model_output[1]
                   _A=						text_attention_mask

            _A=						text_embeddings.repeat_interleave(lowerCAmelCase__					,   dim=0							)
            _A=						text_encoder_hidden_states.repeat_interleave(lowerCAmelCase__					,   dim=0							)
            _A=						text_mask.repeat_interleave(lowerCAmelCase__					,   dim=0							)

            if do_classifier_free_guidance:
                   _A=						[''] * batch_size

                   _A=						self.tokenizer(
                       lowerCAmelCase__					,   padding='max_length'					,   max_length=self.tokenizer.model_max_length					,   truncation=lowerCAmelCase__					,   return_tensors='pt'					,   )
                   _A=						uncond_input.attention_mask.bool().to(lowerCAmelCase__							)
                   _A=						self.text_encoder(uncond_input.input_ids.to(lowerCAmelCase__							)							)

                   _A=						uncond_embeddings_text_encoder_output.text_embeds
                   _A=						uncond_embeddings_text_encoder_output.last_hidden_state

                   # duplicate unconditional embeddings for each generation per prompt, using mps friendly method

                   _A=						uncond_embeddings.shape[1]
                   _A=						uncond_embeddings.repeat(1					,   lowerCAmelCase__							)
                   _A=						uncond_embeddings.view(batch_size * num_images_per_prompt					,   lowerCAmelCase__							)

                   _A=						uncond_text_encoder_hidden_states.shape[1]
                   _A=						uncond_text_encoder_hidden_states.repeat(1					,   lowerCAmelCase__					,   1							)
                   _A=						uncond_text_encoder_hidden_states.view(
                       batch_size * num_images_per_prompt					,   lowerCAmelCase__					,   -1							)
                   _A=						uncond_text_mask.repeat_interleave(lowerCAmelCase__					,   dim=0							)

                   # done duplicates

                   # For classifier free guidance, we need to do two forward passes.
                   # Here we concatenate the unconditional and text embeddings into a single batch
                   # to avoid doing two forward passes
                   _A=						torch.cat([uncond_embeddings, text_embeddings]							)
                   _A=						torch.cat([uncond_text_encoder_hidden_states, text_encoder_hidden_states]							)

                   _A=						torch.cat([uncond_text_mask, text_mask]							)

            return text_embeddings, text_encoder_hidden_states, text_mask



     @property
     def       a__	(       self							):
            if self.device != torch.device('meta'							) or not hasattr(self.prior					,   '_hf_hook'							):
                   return self.device
            for module in self.prior.modules():
                   if (
                       hasattr(lowerCAmelCase__					,   '_hf_hook'							)
                       and hasattr(module._hf_hook					,   'execution_device'							)
                       and module._hf_hook.execution_device is not None
                   ):
                          return torch.device(module._hf_hook.execution_device							)
            return self.device



     def       a__	(       self					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__							):
            if latents is None:
                   _A=						randn_tensor(lowerCAmelCase__					,   generator=lowerCAmelCase__					,   device=lowerCAmelCase__					,   dtype=lowerCAmelCase__							)
            else:
                   if latents.shape != shape:
                          raise ValueError(f"Unexpected latents shape, got {latents.shape}, expected {shape}"							)
                   _A=						latents.to(lowerCAmelCase__							)

            _A=						latents * scheduler.init_noise_sigma
            return latents



     def       a__	(       self					,   lowerCAmelCase__ = None							):
            self.decoder_pipe.to(lowerCAmelCase__							)
            super().to(lowerCAmelCase__							)





     @torch.no_grad()
     def __call__(       self					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = 1					,   lowerCAmelCase__ = 25					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = None					,   lowerCAmelCase__ = 4.0					,   lowerCAmelCase__ = 8.0					,   lowerCAmelCase__ = 50					,   lowerCAmelCase__ = 1					,   lowerCAmelCase__ = 0.0					,   lowerCAmelCase__ = "pil"					,   lowerCAmelCase__ = True					,   ):
            if prompt is not None:
                   if isinstance(lowerCAmelCase__					,   lowerCAmelCase__							):
                          _A=						1
                   elif isinstance(lowerCAmelCase__					,   lowerCAmelCase__							):
                          _A=						len(lowerCAmelCase__							)
                   else:
                          raise ValueError(f"`prompt` has to be of type `str` or `list` but is {type(lowerCAmelCase__							)}"							)
            else:
                   _A=						text_model_output[0].shape[0]

            _A=						self._execution_device

            _A=						batch_size * num_images_per_prompt

            _A=						prior_guidance_scale > 1.0 or decoder_guidance_scale > 1.0

            _A,      _A,      _A=						self._encode_prompt(
                lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__							)

            # prior

            self.prior_scheduler.set_timesteps(lowerCAmelCase__					,   device=lowerCAmelCase__							)
            _A=						self.prior_scheduler.timesteps

            _A=						self.prior.config.embedding_dim

            _A=						self.prepare_latents(
                (batch_size, embedding_dim)					,   text_embeddings.dtype					,   lowerCAmelCase__					,   lowerCAmelCase__					,   lowerCAmelCase__					,   self.prior_scheduler					,   )

            for i, t in enumerate(self.progress_bar(lowerCAmelCase__							)							):
                   # expand the latents if we are doing classifier free guidance
                   _A=						torch.cat([prior_latents] * 2							) if do_classifier_free_guidance else prior_latents

                   _A=						self.prior(
                       lowerCAmelCase__					,   timestep=lowerCAmelCase__					,   proj_embedding=lowerCAmelCase__					,   encoder_hidden_states=lowerCAmelCase__					,   attention_mask=lowerCAmelCase__					,   ).predicted_image_embedding

                   if do_classifier_free_guidance:
                          _A,      _A=						predicted_image_embedding.chunk(2							)
                          _A=						predicted_image_embedding_uncond + prior_guidance_scale * (
                              predicted_image_embedding_text - predicted_image_embedding_uncond
                          )

                   if i + 1 == prior_timesteps_tensor.shape[0]:
                          _A=						None
                   else:
                          _A=						prior_timesteps_tensor[i + 1]

                   _A=						self.prior_scheduler.step(
                       lowerCAmelCase__					,   timestep=lowerCAmelCase__					,   sample=lowerCAmelCase__					,   generator=lowerCAmelCase__					,   prev_timestep=lowerCAmelCase__					,   ).prev_sample

            _A=						self.prior.post_process_latents(lowerCAmelCase__							)

            _A=						prior_latents

            _A=						self.decoder_pipe(
                image=lowerCAmelCase__					,   height=lowerCAmelCase__					,   width=lowerCAmelCase__					,   num_inference_steps=lowerCAmelCase__					,   guidance_scale=lowerCAmelCase__					,   generator=lowerCAmelCase__					,   output_type=lowerCAmelCase__					,   return_dict=lowerCAmelCase__					,   num_images_per_prompt=lowerCAmelCase__					,   eta=lowerCAmelCase__					,   )
            return output
from ..utils import DummyObject, requires_backends





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Any		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  int		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Dict		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  List[str]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  str		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Union[str, Any]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)





class   lowerCAmelCase    (       metaclass=_a      ):
     _SCREAMING_SNAKE_CASE  :  Optional[int]		=["""vision"""]



     def __init__(       self					,   *lowerCAmelCase__					,   **lowerCAmelCase__							):
            requires_backends(self					,   ['vision']							)