"""simple docstring"""




def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       int			,_lowerCamelCase						:       int	)       ->      int:






  while a != 0:
    _lowerCAmelCase			,	_lowerCAmelCase						:       Dict  			=     b % a, a
  return b






def 							SCREAMING_SNAKE_CASE     (			_lowerCamelCase						:       int			,_lowerCamelCase						:       int	)       ->      int:






  if gcd(__lowercase			,__lowercase	) != 1:
    _lowerCAmelCase						:       str  			=     f"mod inverse of {a!r} and {m!r} does not exist"
    raise ValueError(__lowercase	)
  _lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase						:       List[Any]  			=     1, 0, a
  _lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase						:       List[str]  			=     0, 1, m
  while va != 0:
    _lowerCAmelCase						:       str  			=     ua // va
    _lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase			,	_lowerCAmelCase						:       int  			=     (ua - q * va), (ua - q * va), (ua - q * va), va, va, va
  return ua % m











'''simple docstring'''
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 (
        VersatileDiffusionDualGuidedPipeline,
        VersatileDiffusionImageVariationPipeline,
        VersatileDiffusionPipeline,
        VersatileDiffusionTextToImagePipeline,
    )
else:
    from .modeling_text_unet import UNetFlatConditionModel
    from .pipeline_versatile_diffusion import VersatileDiffusionPipeline
    from .pipeline_versatile_diffusion_dual_guided import VersatileDiffusionDualGuidedPipeline
    from .pipeline_versatile_diffusion_image_variation import VersatileDiffusionImageVariationPipeline
    from .pipeline_versatile_diffusion_text_to_image import VersatileDiffusionTextToImagePipeline
