






"""simple docstring"""
from typing import TYPE_CHECKING

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


lowerCAmelCase__							= {
    'configuration_xlm_prophetnet': ['XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP', 'XLMProphetNetConfig'],
}

try:
			if not is_sentencepiece_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowerCAmelCase__							= ['XLMProphetNetTokenizer']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			lowerCAmelCase__							= [
			    'XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST',
			    'XLMProphetNetDecoder',
			    'XLMProphetNetEncoder',
			    'XLMProphetNetForCausalLM',
			    'XLMProphetNetForConditionalGeneration',
			    'XLMProphetNetModel',
			    'XLMProphetNetPreTrainedModel',
			]


if TYPE_CHECKING:
			from .configuration_xlm_prophetnet import XLM_PROPHETNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLMProphetNetConfig

			try:
						if not is_sentencepiece_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .tokenization_xlm_prophetnet import XLMProphetNetTokenizer

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_xlm_prophetnet import (
						    XLM_PROPHETNET_PRETRAINED_MODEL_ARCHIVE_LIST,
						    XLMProphetNetDecoder,
						    XLMProphetNetEncoder,
						    XLMProphetNetForCausalLM,
						    XLMProphetNetForConditionalGeneration,
						    XLMProphetNetModel,
						    XLMProphetNetPreTrainedModel,
						)

else:
			import sys

			lowerCAmelCase__							= _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)









"""simple docstring"""
def 							lowercase__		(				lowerCamelCase					):
				return -num if num < 0 else num





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_min() arg is an empty sequence'					)
				_SCREAMING_SNAKE_CASE      :		List[Any]							=						x[0]
				for i in x:
								if abs_val(lowerCamelCase					) < abs_val(lowerCamelCase					):
												_SCREAMING_SNAKE_CASE      :		List[Any]							=						i
				return j





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_max() arg is an empty sequence'					)
				_SCREAMING_SNAKE_CASE      :		Tuple							=						x[0]
				for i in x:
								if abs(lowerCamelCase					) > abs(lowerCamelCase					):
												_SCREAMING_SNAKE_CASE      :		Optional[Any]							=						i
				return j





def 							lowercase__		(				lowerCamelCase					):
				if len(lowerCamelCase					) == 0:
								raise ValueError('abs_max_sort() arg is an empty sequence'					)
				return sorted(lowerCamelCase,	key=lowerCamelCase					)[-1]





def 							lowercase__		(				):
				assert abs_val(0					) == 0
				assert abs_val(34					) == 34
				assert abs_val(-100_000_000_000					) == 100_000_000_000

				_SCREAMING_SNAKE_CASE      :		Tuple							=						[-3, -1, 2, -11]
				assert abs_max(lowerCamelCase					) == -11
				assert abs_max_sort(lowerCamelCase					) == -11
				assert abs_min(lowerCamelCase					) == -1


if __name__ == "__main__":
			import doctest

			doctest.testmod()

			test_abs_val()
			print(abs_val(-34))  # --> 34

