





'''simple docstring'''







from .imports import is_tqdm_available


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

from ..state import PartialState

def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			bool = True,			*SCREAMING_SNAKE_CASE__      :			Optional[int],			**SCREAMING_SNAKE_CASE__      :			str   ) ->	Optional[int]:







						if not is_tqdm_available():
												raise ImportError('''Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'''   )
						UpperCAmelCase_			:      List[str]     						=  False
						if main_process_only:
												UpperCAmelCase_			:      Any     						=  PartialState().local_process_index == 0
						return _tqdm(*SCREAMING_SNAKE_CASE__,			**SCREAMING_SNAKE_CASE__,			disable=SCREAMING_SNAKE_CASE__   )












'''simple docstring'''







def        lowerCamelCase_      (  SCREAMING_SNAKE_CASE__      :			int   ) ->	str:
						if number > 0:
												raise ValueError('''input must be a negative integer'''   )
						UpperCAmelCase_			:      Union[str, Any]     						=  len(bin(SCREAMING_SNAKE_CASE__   )[3:]   )
						UpperCAmelCase_			:      Union[str, Any]     						=  bin(abs(SCREAMING_SNAKE_CASE__   ) - (1 << binary_number_length)   )[3:]
						UpperCAmelCase_			:      Optional[Any]     						=  (
						    (
						        '''1'''
						        + '''0''' * (binary_number_length - len(SCREAMING_SNAKE_CASE__   ))
						        + twos_complement_number
						    )
						    if number < 0
						    else '''0'''
						)
						return "0b" + twos_complement_number


if __name__ == "__main__":
					import doctest

					doctest.testmod()





