

from .imports import is_tqdm_available


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

from ..state import PartialState

def 			lowerCamelCase__			(       _a = True				,      *_a				,      **_a):
	if not is_tqdm_available():
		raise ImportError("Accelerate's `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.")
	SCREAMING_SNAKE_CASE :   List[Any]					  =							False
	if main_process_only:
		SCREAMING_SNAKE_CASE :   Optional[int]					  =							PartialState().local_process_index == 0
	return _tqdm(*_a				,      **_a				,      disable=_a)





def    UpperCAmelCase_				( __UpperCAmelCase		:      int				)   ->					int:
      assert isinstance(__UpperCAmelCase     ,     __UpperCAmelCase				), f"The input value of [n={number}] is not an integer"

      if number == 1:
            return 2
      elif number < 1:
            SCREAMING_SNAKE_CASE_      		=     f"The input value of [n={number}] has to be > 0"
            raise ValueError(__UpperCAmelCase				)
      else:
            SCREAMING_SNAKE_CASE_      		=     sylvester(number - 1				)
            SCREAMING_SNAKE_CASE_      		=     num - 1
            SCREAMING_SNAKE_CASE_      		=     num
            return lower * upper + 1


if __name__ == "__main__":
   print(f'''The 8th number in Sylvester\'s sequence: {sylvester(8)}''')