code: 
  
  
  from __future__ import annotations
  def 							_UpperCAmelCase       (UpperCamelCase__  :						List[str]       ,							UpperCamelCase__  :						Any       ,							UpperCamelCase__  :						List[Any]		):
         assert n > 1 and a > 0 and greatest_common_divisor(UpperCamelCase__       ,							UpperCamelCase__		) == 1
         (_A)   : List[str]       					=				extended_gcd(UpperCamelCase__       ,							UpperCamelCase__		)  # Implemented below
         _A   : Union[str, Any]       					=				(b * s) % n
         return x
  def 							_UpperCAmelCase       (UpperCamelCase__  :						List[Any]       ,							UpperCamelCase__  :						List[str]		):
         (_A)   : List[str]       					=				extended_euclid(UpperCamelCase__       ,							UpperCamelCase__		)  # Implemented below
         if b < 0:
                _A   : List[str]       					=				(b % n + n) % n
         return b
  def 							_UpperCAmelCase       (UpperCamelCase__  :						Union[str, Any]       ,							UpperCamelCase__  :						Tuple       ,							UpperCamelCase__  :						List[Any]		):
         _A   : Tuple       					=				invert_modulo(UpperCamelCase__       ,							UpperCamelCase__		)
         _A   : Any       					=				(b * s) % n
         return x
  def 							_UpperCAmelCase       (UpperCamelCase__  :						List[Any]       ,							UpperCamelCase__  :						Optional[int]		):
         assert a >= 0 and b >= 0
  
         if b == 0:
                _A   : Union[str, Any]       					=				a, 1, 0
         else:
                (_A)   : Tuple       					=				extended_gcd(UpperCamelCase__       ,							a % b		)
                _A   : int       					=				q
                _A   : Any       					=				p - q * (a // b)
  
         assert a % d == 0 and b % d == 0
         assert d == a * x + b * y
  
         return (d, x, y)
  def 							_UpperCAmelCase       (UpperCamelCase__  :						List[str]       ,							UpperCamelCase__  :						List[Any]		):
  
         if b == 0:
                return (1, 0)
         (_A)   : int       					=				extended_euclid(UpperCamelCase__       ,							a % b		)
         _A   : List[Any]       					=				a // b
         return (y, x - k * y)
  def 							_UpperCAmelCase       (UpperCamelCase__  :						Union[str, Any]       ,							UpperCamelCase__  :						str		):
  
         if a < b:
                _A   : Union[str, Any]       					=				b, a
  
         while a % b != 0:
                _A   : Optional[int]       					=				b, a % b
  
         return b
  
  
  if __name__ == "__main__":
      from doctest import testmod
  
      testmod(name='modular_division', verbose=True)
      testmod(name='modular_division2', verbose=True)
      testmod(name='invert_modulo', verbose=True)
      testmod(name='extended_gcd', verbose=True)
      testmod(name='extended_euclid', verbose=True)
      testmod(name='greatest_common_divisor', verbose=True)
  
style_context: 
  
  
  from typing import TYPE_CHECKING
  
  from ...utils import (
      OptionalDependencyNotAvailable,
      _LazyModule,
      is_tf_available,
      is_torch_available,
      is_vision_available,
  )
  
  
  lowerCAmelCase__   	=				{
      'configuration_segformer': ['SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SegformerConfig', 'SegformerOnnxConfig']
  }
  
  try:
      if not is_vision_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      lowerCAmelCase__   	=				['SegformerFeatureExtractor']
      lowerCAmelCase__   	=				['SegformerImageProcessor']
  
  try:
      if not is_torch_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      lowerCAmelCase__   	=				[
          'SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
          'SegformerDecodeHead',
          'SegformerForImageClassification',
          'SegformerForSemanticSegmentation',
          'SegformerLayer',
          'SegformerModel',
          'SegformerPreTrainedModel',
      ]
  
  try:
      if not is_tf_available():
          raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
      pass
  else:
      lowerCAmelCase__   	=				[
          'TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
          'TFSegformerDecodeHead',
          'TFSegformerForImageClassification',
          'TFSegformerForSemanticSegmentation',
          'TFSegformerModel',
          'TFSegformerPreTrainedModel',
      ]
  
  
  if TYPE_CHECKING:
      from .configuration_segformer import SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, SegformerConfig, SegformerOnnxConfig
  
      try:
          if not is_vision_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .feature_extraction_segformer import SegformerFeatureExtractor
          from .image_processing_segformer import SegformerImageProcessor
  
      try:
          if not is_torch_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .modeling_segformer import (
              SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              SegformerDecodeHead,
              SegformerForImageClassification,
              SegformerForSemanticSegmentation,
              SegformerLayer,
              SegformerModel,
              SegformerPreTrainedModel,
          )
      try:
          if not is_tf_available():
              raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
          pass
      else:
          from .modeling_tf_segformer import (
              TF_SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFSegformerDecodeHead,
              TFSegformerForImageClassification,
              TFSegformerForSemanticSegmentation,
              TFSegformerModel,
              TFSegformerPreTrainedModel,
          )
  
  else:
      import sys
  
      lowerCAmelCase__   	=				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)
  