'''simple docstring'''




from __future__ import annotations






def __lowerCAmelCase (							UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				)	->    list:
    __lowerCamelCase		=  []
    __lowerCamelCase	,  __lowerCamelCase		=  input_list[low:mid], input_list[mid : high + 1]
    while left and right:
        result.append((left if left[0] <= right[0] else right).pop(0				)				)
    __lowerCamelCase		=  result + left + right
    return input_list






def __lowerCAmelCase (							UpperCamelCase__				)	->    list:
    if len(UpperCamelCase__				) <= 1:
        return input_list
    __lowerCamelCase		=  list(UpperCamelCase__				)

    # iteration for two-way merging
    __lowerCamelCase		=  2
    while p <= len(UpperCamelCase__				):
        # getting low, high and middle value for merge-sort of single list
        for i in range(0				,  len(UpperCamelCase__				)				,  UpperCamelCase__				):
            __lowerCamelCase		=  i
            __lowerCamelCase		=  i + p - 1
            __lowerCamelCase		=  (low + high + 1) // 2
            __lowerCamelCase		=  merge(UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				,  UpperCamelCase__				)
        # final merge of last two parts
        if p * 2 >= len(UpperCamelCase__				):
            __lowerCamelCase		=  i
            __lowerCamelCase		=  merge(UpperCamelCase__				,  0				,  UpperCamelCase__				,  len(UpperCamelCase__				) - 1				)
            break
        p *= 2

    return input_list


if __name__ == "__main__":
  __UpperCAmelCase     							=input("Enter numbers separated by a comma:\n").strip()
  if user_input == "":
    __UpperCAmelCase     							=[]
  else:
    __UpperCAmelCase     							=[int(item.strip()) for item in user_input.split(",")]
  print(iter_merge_sort(unsorted))



from .imports import is_tqdm_available


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

from ..state import PartialState
def      a      (			A__	:   bool = True      ,   *A__	:   int      ,   **A__	:   Union[str, Any]     )    ->      List[str]:





      """simple docstring"""



      if not is_tqdm_available():
            raise ImportError('Accelerate\'s `tqdm` module requires `tqdm` to be installed. Please run `pip install tqdm`.'     )
      _lowercase	       =False
      if main_process_only:
            _lowercase	       =PartialState().local_process_index == 0
      return _tqdm(*A__      ,   **A__      ,   disable=A__     )


