



from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


lowerCAmelCase__       = {
    "configuration_mask2former": [
        "MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "Mask2FormerConfig",
    ],
}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowerCAmelCase__       = ["Mask2FormerImageProcessor"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowerCAmelCase__       = [
          "MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
          "Mask2FormerForUniversalSegmentation",
          "Mask2FormerModel",
          "Mask2FormerPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_maskaformer import MASK2FORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, MaskaFormerConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .image_processing_maskaformer import MaskaFormerImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_maskaformer import (
                MASK2FORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                MaskaFormerForUniversalSegmentation,
                MaskaFormerModel,
                MaskaFormerPreTrainedModel,
            )


else:
      import sys

      lowerCAmelCase__       = _LazyModule(__name__, globals()["__file__"], _import_structure)






def      _lowerCAmelCase(	__A   ,       __A   ,       __A			):
  if n == 0:
    return 1

  elif n % 2 == 1:
    return (binary_exponentiation(__A   ,       n - 1   ,       __A			) * a) % mod

  else:
    UpperCAmelCase					      =  binary_exponentiation(__A   ,       n / 2   ,       __A			)
    return (b * b) % mod


# a prime number
lowerCAmelCase__       = 701

lowerCAmelCase__       = 1000000000
lowerCAmelCase__       = 10

# using binary exponentiation function, O(log(p)):
print((a / b) % p == (a * binary_exponentiation(b, p - 2, p)) % p)





print((a / b) % p == (a * b ** (p - 2)) % p)



