


from ..utils import deprecate
from .attention_processor import (  # noqa: F401
    Attention,
    AttentionProcessor,
    AttnAddedKVProcessor,
    AttnProcessor2_0,
    LoRAAttnProcessor,
    LoRALinearLayer,
    LoRAXFormersAttnProcessor,
    SlicedAttnAddedKVProcessor,
    SlicedAttnProcessor,
    XFormersAttnProcessor,
)
from .attention_processor import AttnProcessor as AttnProcessorRename  # noqa: F401


deprecate(
    '''cross_attention''',
    '''0.20.0''',
    '''Importing from cross_attention is deprecated. Please import from diffusers.models.attention_processor instead.''',
    standard_warn=False,
)


_snake_case					=					AttentionProcessor
class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Dict   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: List[str]   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: int   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Optional[int]   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Any   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Dict   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Optional[int]   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)



class      UpperCAmelCase_ ( UpperCamelCase   ):

   '''simple docstring'''




   def __init__(		self						,    *__A						,    **__A			):






     """simple docstring"""





     lowerCamelCase			: Dict   =    F"""{self.__class__.__name__} is deprecated and will be removed in `0.20.0`. Please use `from diffusers.models.attention_processor import {''.join(self.__class__.__name__.split('Cross'			)			)} instead."""
     deprecate("cross_attention"						,    "0.20.0"						,    __A						,    standard_warn=__A			)
     super().__init__(*__A						,    **__A			)







def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if number != int(SCREAMING_SNAKE_CASE_     ):
    raise ValueError("factorial() only accepts integral values"     )
  if number < 0:
    raise ValueError("factorial() not defined for negative values"     )
  lowerCamelCase			: Optional[Any]   =    1
  for i in range(1				,						number + 1     ):
    value *= i
  return value






def 		lowercase_(  SCREAMING_SNAKE_CASE_     ):


  '''simple docstring'''

  if not isinstance(SCREAMING_SNAKE_CASE_				,						SCREAMING_SNAKE_CASE_     ):
    raise ValueError("factorial() only accepts integral values"     )
  if n < 0:
    raise ValueError("factorial() not defined for negative values"     )
  return 1 if n == 0 or n == 1 else n * factorial(n - 1     )


if __name__ == "__main__":
   import doctest

   doctest.testmod()

   _snake_case					=					int(input('''Enter a positive integer: ''').strip() or 0)
   print(f'''factorial{n} is {factorial(n)}''')



