
'''simple docstring'''


def lowercase_						( _lowercase					)  ->				Union[str, Any]:
					'''simple docstring'''

					if not isinstance(_lowercase      ,							_lowercase					):
										lowerCamelCase_       :   Any  =		F"""Input value of [number={number}] must be an integer"""
										raise TypeError(_lowercase					)
					if number < 0:
										return False
					lowerCamelCase_       :   Dict  =		number * number
					while number > 0:
										if number % 10 != number_square % 10:
															return False
										number //= 10
										number_square //= 10
					return True


if __name__ == "__main__":
					import doctest

					doctest.testmod()









"""simple docstring"""





from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
							import accelerate



def 					lowerCAmelCase_      (   SCREAMING_SNAKE_CASE							:				str ):


							'''simple docstring'''







							if not is_accelerate_available():
														return method
							__lowerCamelCase   :   Dict       =version.parse(accelerate.__version__ ).base_version
							if version.parse(SCREAMING_SNAKE_CASE ) < version.parse('''0.17.0''' ):
														return method

							def wrapper(self							:				List[Any]     ,    *SCREAMING_SNAKE_CASE							:				Any     ,    **SCREAMING_SNAKE_CASE							:				List[str] ):
														if hasattr(self     ,    '''_hf_hook''' ) and hasattr(self._hf_hook     ,    '''pre_forward''' ):
																					self._hf_hook.pre_forward(self )
														return method(self     ,    *SCREAMING_SNAKE_CASE     ,    **SCREAMING_SNAKE_CASE )

							return wrapper




