code: 
  
  
  import warnings
  from contextlib import contextmanager
  
  from ...processing_utils import ProcessorMixin
  
  
  
  class 			a      (      UpperCamelCase_   ):
  		__lowercase													=		["""image_processor""", """tokenizer"""]
  		__lowercase													=		"""AutoImageProcessor"""
  		__lowercase													=		"""AutoTokenizer"""
  
  
  
  
  
  
  		def __init__(  self	,     __UpperCamelCase=None	,     __UpperCamelCase=None	,     **__UpperCamelCase							)->			Optional[Any]:
  						'''simple docstring'''
  
  
  						A__     :							Any   				=None
  						if "feature_extractor" in kwargs:
  										warnings.warn(
  										    '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
  										    ''' instead.'''	,     __UpperCamelCase	,     )
  										A__     :							Union[str, Any]   				=kwargs.pop('''feature_extractor'''							)
  
  						A__     :							int   				=image_processor if image_processor is not None else feature_extractor
  						if image_processor is None:
  										raise ValueError('''You need to specify an `image_processor`.'''							)
  						if tokenizer is None:
  										raise ValueError('''You need to specify a `tokenizer`.'''							)
  
  						super().__init__(__UpperCamelCase	,     __UpperCamelCase							)
  						A__     :							Union[str, Any]   				=self.image_processor
  						A__     :							str   				=False
  
  
  
  
  
  
  		def __call__(  self	,     *__UpperCamelCase	,     **__UpperCamelCase							)->			Union[str, Any]:
  						'''simple docstring'''
  
  
  						if self._in_target_context_manager:
  										return self.current_processor(*__UpperCamelCase	,     **__UpperCamelCase							)
  
  						A__     :							Optional[Any]   				=kwargs.pop('''images'''	,     __UpperCamelCase							)
  						A__     :							Optional[Any]   				=kwargs.pop('''text'''	,     __UpperCamelCase							)
  						if len(__UpperCamelCase							) > 0:
  										A__     :							List[Any]   				=args[0]
  										A__     :							List[str]   				=args[1:]
  
  						if images is None and text is None:
  										raise ValueError('''You need to specify either an `images` or `text` input to process.'''							)
  
  						if images is not None:
  										A__     :							Union[str, Any]   				=self.image_processor(__UpperCamelCase	,     *__UpperCamelCase	,     **__UpperCamelCase							)
  						if text is not None:
  										A__     :							Dict   				=self.tokenizer(__UpperCamelCase	,     **__UpperCamelCase							)
  
  						if text is None:
  										return inputs
  						elif images is None:
  										return encodings
  						else:
  										A__     :							str   				=encodings['''input_ids''']
  										return inputs
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     *__UpperCamelCase	,     **__UpperCamelCase							)->			List[str]:
  						'''simple docstring'''
  
  
  						return self.tokenizer.batch_decode(*__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		def       lowerCAmelCase_  (  self	,     *__UpperCamelCase	,     **__UpperCamelCase							)->			List[Any]:
  						'''simple docstring'''
  
  
  						return self.tokenizer.decode(*__UpperCamelCase	,     **__UpperCamelCase							)
  
  
  
  
  
  
  		@contextmanager
  		def       lowerCAmelCase_  (  self							)->			Tuple:
  						'''simple docstring'''
  
  
  						warnings.warn(
  						    '''`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '''
  						    '''labels by using the argument `text` of the regular `__call__` method (either in the same call as '''
  						    '''your images inputs, or in a separate call.'''							)
  						A__     :							Dict   				=True
  						A__     :							List[Any]   				=self.tokenizer
  						yield
  						A__     :							List[Any]   				=self.image_processor
  						A__     :							List[str]   				=False
  
  
  
  
  
  
  		@property
  		def       lowerCAmelCase_  (  self							)->			List[str]:
  						'''simple docstring'''
  
  
  						warnings.warn(
  						    '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.'''	,     __UpperCamelCase	,     )
  						return self.image_processor_class
  
  
  
  
  
  
  		@property
  		def       lowerCAmelCase_  (  self							)->			Tuple:
  						'''simple docstring'''
  
  
  						warnings.warn(
  						    '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.'''	,     __UpperCamelCase	,     )
  						return self.image_processor
  
  
  
  
style_context: 
  
  
  from dataclasses import dataclass
  from enum import Enum
  from typing import List, Optional, Union
  
  import numpy as np
  import PIL
  from PIL import Image
  
  from ...utils import BaseOutput, is_torch_available, is_transformers_available
  
  
  
  @dataclass
  class 			a      (      UpperCamelCase_   ):
  		__lowercase													=		{
  		    """sld_warmup_steps""": 15,
  		    """sld_guidance_scale""": 20,
  		    """sld_threshold""": 0.0,
  		    """sld_momentum_scale""": 0.0,
  		    """sld_mom_beta""": 0.0,
  		}
  		__lowercase													=		{
  		    """sld_warmup_steps""": 10,
  		    """sld_guidance_scale""": 1_000,
  		    """sld_threshold""": 0.01,
  		    """sld_momentum_scale""": 0.3,
  		    """sld_mom_beta""": 0.4,
  		}
  		__lowercase													=		{
  		    """sld_warmup_steps""": 7,
  		    """sld_guidance_scale""": 2_000,
  		    """sld_threshold""": 0.0_25,
  		    """sld_momentum_scale""": 0.5,
  		    """sld_mom_beta""": 0.7,
  		}
  		__lowercase													=		{
  		    """sld_warmup_steps""": 0,
  		    """sld_guidance_scale""": 5_000,
  		    """sld_threshold""": 1.0,
  		    """sld_momentum_scale""": 0.5,
  		    """sld_mom_beta""": 0.7,
  		}
  
  
  
  
  
  
  
  @dataclass
  class 			a      (      UpperCamelCase_   ):
  		__lowercase													=		42
  		__lowercase													=		42
  		__lowercase													=		42
  		__lowercase													=		42
  
  
  if is_transformers_available() and is_torch_available():
  						from .pipeline_stable_diffusion_safe import StableDiffusionPipelineSafe
  						from .safety_checker import SafeStableDiffusionSafetyChecker
  
  
  
  