
from typing import TYPE_CHECKING

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


__UpperCAmelCase   						=     {
    "configuration_donut_swin": ["DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP", "DonutSwinConfig"],
    "processing_donut": ["DonutProcessor"],
}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __UpperCAmelCase   						=     [
       "DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST",
       "DonutSwinModel",
       "DonutSwinPreTrainedModel",
   ]

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __UpperCAmelCase   						=     ["DonutFeatureExtractor"]
   __UpperCAmelCase   						=     ["DonutImageProcessor"]


if TYPE_CHECKING:
   from .configuration_donut_swin import DONUT_SWIN_PRETRAINED_CONFIG_ARCHIVE_MAP, DonutSwinConfig
   from .processing_donut import DonutProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_donut_swin import (
          DONUT_SWIN_PRETRAINED_MODEL_ARCHIVE_LIST,
          DonutSwinModel,
          DonutSwinPreTrainedModel,
      )

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_donut import DonutFeatureExtractor
      from .image_processing_donut import DonutImageProcessor

else:
   import sys

   __UpperCAmelCase   						=     _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




from math import sqrt


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      [1]
   for i in range(2,  int(sqrt(__lowerCamelCase						)						) + 1,  1						):
      if number % i == 0:
         values.append(__lowerCamelCase						)
         if int(number // i						) != i:
            values.append(int(number // i						)						)
   return sorted(__lowerCamelCase						)


def  A__ (       __lowerCamelCase						):
   return sum(factors(__lowerCamelCase						)						) > n


def  A__ (       __lowerCamelCase						):
   SCREAMING_SNAKE_CASE_	=      factors(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      len(__lowerCamelCase						)
   SCREAMING_SNAKE_CASE_	=      [[0 for i in range(number + 1						)] for j in range(r + 1						)]
   for i in range(r + 1						):
      SCREAMING_SNAKE_CASE_	=      True

   for i in range(1,  number + 1						):
      SCREAMING_SNAKE_CASE_	=      False

   for i in range(1,  r + 1						):
      for j in range(1,  number + 1						):
         if j < values[i - 1]:
            SCREAMING_SNAKE_CASE_	=      subset[i - 1][j]
         else:
            SCREAMING_SNAKE_CASE_	=      subset[i - 1][j] or subset[i - 1][j - values[i - 1]]

   return subset[r][number] != 0


def  A__ (       __lowerCamelCase						):
   return abundant(__lowerCamelCase						) and not semi_perfect(__lowerCamelCase						)


if __name__ == "__main__":
   import doctest

   doctest.testmod(verbose=True)
   for number in (69, 70, 71):
      print(F"""{number} is {'' if weird(number) else 'not '}weird.""")


