





_UpperCAmelCase				       = (1, 1_5_3, 3_7_0, 3_7_1, 1_6_3_4, 2_4_6_7_8_0_5_1, 1_1_5_1_3_2_2_1_9_0_1_8_7_6_3_9_9_2_5_6_5_0_9_5_5_9_7_9_7_3_9_7_1_5_2_2_4_0_1)
_UpperCAmelCase				       = (-1_5_3, -1, 0, 1.2, 2_0_0, 'A', [], {}, None)




def        lowerCAmelCase_       (							UpperCamelCase_     )   ->						bool:


       if not isinstance(UpperCamelCase_    ,						UpperCamelCase_     ) or n < 1:
              return False

       # Initialization of sum and number of digits.
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     n
       # Calculation of digits of the number
       while temp > 0:
              number_of_digits += 1
              temp //= 10
       # Dividing number into separate digits and find Armstrong number
       UpperCamelCase_      				=     n
       while temp > 0:
              UpperCamelCase_      				=     temp % 10
              total += rem**number_of_digits
              temp //= 10
       return n == total




def        lowerCAmelCase_       (							UpperCamelCase_     )   ->						bool:


       if not isinstance(UpperCamelCase_    ,						UpperCamelCase_     ) or n < 1:
              return False

       # Init a "histogram" of the digits
       UpperCamelCase_      				=     [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     0
       UpperCamelCase_      				=     n
       while temp > 0:
              UpperCamelCase_      				=     divmod(UpperCamelCase_    ,						10     )
              digit_histogram[rem] += 1
              digit_total += 1

       for cnt, i in zip(UpperCamelCase_    ,						range(len(UpperCamelCase_     )     )     ):
              total += cnt * i**digit_total

       return n == total




def        lowerCAmelCase_       (							UpperCamelCase_     )   ->						bool:


       if not isinstance(UpperCamelCase_    ,						UpperCamelCase_     ) or n < 1:
              return False
       UpperCamelCase_      				=     len(str(UpperCamelCase_     )     )  # the power that all digits will be raised to
       # check if sum of each digit multiplied expo times is equal to number
       return n == sum(int(UpperCamelCase_     ) ** expo for i in str(UpperCamelCase_     )     )




def        lowerCAmelCase_       (							)   ->						str:
       UpperCamelCase_      				=     int(input("Enter an integer to see if it is an Armstrong number: "     ).strip()     )
       print(F'''{num} is {"" if armstrong_number(UpperCamelCase_     ) else "not "}an Armstrong number.'''     )
       print(F'''{num} is {"" if narcissistic_number(UpperCamelCase_     ) else "not "}an Armstrong number.'''     )
       print(F'''{num} is {"" if pluperfect_number(UpperCamelCase_     ) else "not "}an Armstrong number.'''     )


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     main()







from typing import Optional

from ..utils.logging import get_logger
from .audio_classificiation import AudioClassification
from .automatic_speech_recognition import AutomaticSpeechRecognition
from .base import TaskTemplate
from .image_classification import ImageClassification
from .language_modeling import LanguageModeling
from .question_answering import QuestionAnsweringExtractive
from .summarization import Summarization
from .text_classification import TextClassification


UpperCamelCase__              =						[
    'AutomaticSpeechRecognition',
    'AudioClassification',
    'ImageClassification',
    'LanguageModeling',
    'QuestionAnsweringExtractive',
    'Summarization',
    'TaskTemplate',
    'TextClassification',
]

UpperCamelCase__              =						get_logger(__name__)


UpperCamelCase__              =						{
    AutomaticSpeechRecognition.task: AutomaticSpeechRecognition,
    AudioClassification.task: AudioClassification,
    ImageClassification.task: ImageClassification,
    LanguageModeling.task: LanguageModeling,
    QuestionAnsweringExtractive.task: QuestionAnsweringExtractive,
    Summarization.task: Summarization,
    TextClassification.task: TextClassification,
}






def 					snake_case					(							A			)							->							Optional[TaskTemplate]:




	'''simple docstring'''


	lowerCamelCase_							:		Any							   =							task_template_dict.get('task'			)
	if task_name is None:
		logger.warning(f"Couldn't find template for task '{task_name}'. Available templates: {list(A			)}"			)
		return None
	lowerCamelCase_							:		Any							   =							NAMEaTEMPLATE.get(A			)
	return template.from_dict(A			)
