





from .imports import is_tqdm_available


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

from ..state import PartialState




def 		lowerCAmelCase_    (  __UpperCAmelCase:			bool = True		,   *__UpperCAmelCase:			Union[str, Any]		,   **__UpperCAmelCase:			Tuple      )      ->	Tuple:
    if not is_tqdm_available():
        raise ImportError('''Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'''      )
    UpperCamelCase__							:				Optional[int]          =      False
    if main_process_only:
        UpperCamelCase__							:				Union[str, Any]          =      PartialState().local_process_index == 0
    return _tqdm(*__UpperCAmelCase		,   **__UpperCAmelCase		,   disable=__UpperCAmelCase      )








from __future__ import annotations




def 		lowerCAmelCase_    (  __UpperCAmelCase:			int		,   __UpperCAmelCase:			int      )      ->	list[list[int]]:
    UpperCamelCase__							:				list[list[int]]          =      []
    create_all_state(1		,   __UpperCAmelCase		,   __UpperCAmelCase		,   []		,   __UpperCAmelCase      )
    return result




def 		lowerCAmelCase_    (  __UpperCAmelCase:			int		,   __UpperCAmelCase:			int		,   __UpperCAmelCase:			int		,   __UpperCAmelCase:			list[int]		,   __UpperCAmelCase:			list[list[int]]		,   )      ->	None:
    if level == 0:
        total_list.append(current_list[:]      )
        return

    for i in range(__UpperCAmelCase		,   total_number - level + 2      ):
        current_list.append(__UpperCAmelCase      )
        create_all_state(i + 1		,   __UpperCAmelCase		,   level - 1		,   __UpperCAmelCase		,   __UpperCAmelCase      )
        current_list.pop()




def 		lowerCAmelCase_    (  __UpperCAmelCase:			list[list[int]]      )      ->	None:
    for i in total_list:
        print(*__UpperCAmelCase      )


if __name__ == "__main__":
  UpperCAmelCase_     							= 4
  UpperCAmelCase_     							= 2
  UpperCAmelCase_     							= generate_all_combinations(n, k)
  print_all_state(total_list)

