


from packaging import version

from .import_utils import is_accelerate_available


if is_accelerate_available():
   import accelerate
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__						):







 if not is_accelerate_available():
  return method
 __lowerCamelCase		:							Optional[int]		 =						version.parse(accelerate.__version__						).base_version
 if version.parse(UpperCamelCase__						) < version.parse('0.17.0'						):
  return method

 def wrapper(self      ,	*SCREAMING_SNAKE_CASE__      ,	**SCREAMING_SNAKE_CASE__						):
  if hasattr(self      ,	'_hf_hook'						) and hasattr(self._hf_hook      ,	'pre_forward'						):
   self._hf_hook.pre_forward(self						)
  return method(self      ,	*UpperCamelCase__      ,	**UpperCamelCase__						)

 return wrapper





from __future__ import annotations
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__						):
 __lowerCamelCase		:							List[Any]		 =						str(SCREAMING_SNAKE_CASE__						)
 return len(SCREAMING_SNAKE_CASE__						) == 9 and set(SCREAMING_SNAKE_CASE__						) == set('123456789'						)
def 				UpperCamelCase__					(  ):
 for base_num in range(9_999      ,	4_999      ,	-1						):
  __lowerCamelCase		:							Tuple		 =						100_002 * base_num
  if is_9_pandigital(SCREAMING_SNAKE_CASE__						):
   return candidate

 for base_num in range(333      ,	99      ,	-1						):
  __lowerCamelCase		:							Union[str, Any]		 =						1_002_003 * base_num
  if is_9_pandigital(SCREAMING_SNAKE_CASE__						):
   return candidate

 return None


if __name__ == "__main__":
       print(F"""{solution() = }""")

