


from .imports import is_tqdm_available


if is_tqdm_available():
   from tqdm.auto import tqdm as _tqdm

from ..state import PartialState
def 				UpperCamelCase__					(  SCREAMING_SNAKE_CASE__ = True      ,	*SCREAMING_SNAKE_CASE__      ,	**SCREAMING_SNAKE_CASE__						):
 if not is_tqdm_available():
  raise ImportError('Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'						)
 __lowerCamelCase		:							Optional[Any]		 =						False
 if main_process_only:
  __lowerCamelCase		:							Dict		 =						PartialState().local_process_index == 0
 return _tqdm(*SCREAMING_SNAKE_CASE__      ,	**SCREAMING_SNAKE_CASE__      ,	disable=SCREAMING_SNAKE_CASE__						)





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() = }""")

