



"""simple docstring"""






import math
def      A      (			_A							):




					"""simple docstring"""
					if n <= 0:
										raise ValueError("Only positive integers have prime factors"							)
					snake_case_						:List[str]								=						[]
					while n % 2 == 0:
										pf.append(2							)
										snake_case_						:Optional[int]								=						int(n / 2							)
					for i in range(3,     int(math.sqrt(_A							)							) + 1,     2							):
										while n % i == 0:
															pf.append(_A							)
															snake_case_						:List[Any]								=						int(n / i							)
					if n > 2:
										pf.append(_A							)
					return pf
def      A      (			_A							):




					"""simple docstring"""
					if n <= 0:
										raise ValueError("Only positive numbers are accepted"							)
					snake_case_						:Optional[Any]								=						1
					snake_case_						:str								=						1
					while n % 2 == 0:
										temp += 1
										snake_case_						:Any								=						int(n / 2							)
					div *= temp
					for i in range(3,     int(math.sqrt(_A							)							) + 1,     2							):
										snake_case_						:Dict								=						1
										while n % i == 0:
															temp += 1
															snake_case_						:Tuple								=						int(n / i							)
										div *= temp
					if n > 1:
										div *= 2
					return div
def      A      (			_A							):




					"""simple docstring"""
					if n <= 0:
										raise ValueError("Only positive numbers are accepted"							)
					snake_case_						:str								=						1
					snake_case_						:Dict								=						1
					while n % 2 == 0:
										temp += 1
										snake_case_						:List[Any]								=						int(n / 2							)
					if temp > 1:
										s *= (2**temp - 1) / (2 - 1)
					for i in range(3,     int(math.sqrt(_A							)							) + 1,     2							):
										snake_case_						:List[Any]								=						1
										while n % i == 0:
															temp += 1
															snake_case_						:Optional[Any]								=						int(n / i							)
										if temp > 1:
															s *= (i**temp - 1) / (i - 1)
					return int(_A							)
def      A      (			_A							):




					"""simple docstring"""
					snake_case_						:Tuple								=						n
					for x in set(prime_factors(_A							)							):
										s *= (x - 1) / x
					return int(_A							)


if __name__ == "__main__":
				import doctest

				doctest.testmod()






"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_tf_available,
    is_torch_available,
    is_vision_available,
)


__UpperCAmelCase      :      Optional[int]   					=					{
    'configuration_segformer': ['SEGFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'SegformerConfig', 'SegformerOnnxConfig']
}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      int   					=					['SegformerFeatureExtractor']
				__UpperCAmelCase      :      Dict   					=					['SegformerImageProcessor']

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      Optional[Any]   					=					[
				    'SEGFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
				    'SegformerDecodeHead',
				    'SegformerForImageClassification',
				    'SegformerForSemanticSegmentation',
				    'SegformerLayer',
				    'SegformerModel',
				    'SegformerPreTrainedModel',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__UpperCAmelCase      :      Dict   					=					[
				    '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

				__UpperCAmelCase      :      Optional[Any]   					=					_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)

