




'''simple docstring'''






from typing import TYPE_CHECKING

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


lowercase						:   Any      						=							{
    '''configuration_swin2sr''': ['''SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''Swin2SRConfig'''],
}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase						:   int      						=							[
          '''SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''Swin2SRForImageSuperResolution''',
          '''Swin2SRModel''',
          '''Swin2SRPreTrainedModel''',
      ]


try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase						:   int      						=							['''Swin2SRImageProcessor''']


if TYPE_CHECKING:
      from .configuration_swinasr import SWIN2SR_PRETRAINED_CONFIG_ARCHIVE_MAP, SwinaSRConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_swinasr import (
                SWIN2SR_PRETRAINED_MODEL_ARCHIVE_LIST,
                SwinaSRForImageSuperResolution,
                SwinaSRModel,
                SwinaSRPreTrainedModel,
            )

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .image_processing_swinasr import SwinaSRImageProcessor


else:
      import sys

      lowercase						:   List[str]      						=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)










'''simple docstring'''






from __future__ import annotations

from enum import Enum, unique
from typing import TypeVar

# Create a generic variable that can be 'Enum', or any subclass.
lowercase						:   Any      						=							TypeVar('''T''', bound='''Enum''')

@unique
class 	SCREAMING_SNAKE_CASE_		(							lowerCamelCase_					):
 __snake_case						:  Union[str, Any]       =   8_0
 __snake_case						:  Optional[Any]       =   7_0
 __snake_case						:  List[str]       =   6_0
 __snake_case						:  str       =   5_0
 __snake_case						:  Tuple       =   4_0
 __snake_case						:  Union[str, Any]       =   3_0
 __snake_case						:  Dict       =   2_0
 __snake_case						:  str       =   1_0






@unique
class 	SCREAMING_SNAKE_CASE_		(							lowerCamelCase_					):
 __snake_case						:  Optional[Any]       =   2_4
 __snake_case						:  List[str]       =   2_1
 __snake_case						:  Any       =   1_8
 __snake_case						:  Union[str, Any]       =   1_5
 __snake_case						:  Dict       =   1_2
 __snake_case						:  Union[str, Any]       =   9
 __snake_case						:  List[str]       =   6
 __snake_case						:  Optional[int]       =   3
 __snake_case						:  Tuple       =   2
 __snake_case						:  Any       =   1
 __snake_case						:  Optional[int]       =   -1
 __snake_case						:  Optional[int]       =   -2
 __snake_case						:  str       =   -3
 __snake_case						:  Optional[Any]       =   -6
 __snake_case						:  Optional[int]       =   -9
 __snake_case						:  List[Any]       =   -1_2
 __snake_case						:  str       =   -1_5
 __snake_case						:  str       =   -1_8
 __snake_case						:  Dict       =   -2_1
 __snake_case						:  int       =   -2_4



 @classmethod
 def  SCREAMING_SNAKE_CASE(	cls			):






        '''simple docstring'''




        return {unit.name: unit.value for unit in cls if unit.value > 0}





 @classmethod
 def  SCREAMING_SNAKE_CASE(	cls			):






        '''simple docstring'''




        return {unit.name: unit.value for unit in cls if unit.value < 0}






def 		a_(			lowerCamelCase   )					->str:






       '''simple docstring'''




       lowercase	:		Tuple    =   SIUnit.get_positive() if value > 0 else SIUnit.get_negative()
       for name_prefix, value_prefix in prefixes.items():
              lowercase	:		Dict    =   value / (10**value_prefix)
              if numerical_part > 1:
                     return f"""{numerical_part!s} {name_prefix}"""
       return str(lowerCamelCase   )




def 		a_(			lowerCamelCase   )					->str:






       '''simple docstring'''




       for prefix in BinaryUnit:
              lowercase	:		Dict    =   value / (2**prefix.value)
              if numerical_part > 1:
                     return f"""{numerical_part!s} {prefix.name}"""
       return str(lowerCamelCase   )


if __name__ == "__main__":
      import doctest

      doctest.testmod()




