
"""simple docstring"""





import operator
def 							A_     (__a				,   __a = False				,   __a = None				):

					'''simple docstring'''





					A_				 =						operator.lt if reverse else operator.gt
					A_				 =						solution or []

					if not arr:
										return solution

					A_				 =						[arr.pop(0				)]
					for i, item in enumerate(UpperCAmelCase__				):
										if _operator(UpperCAmelCase__				,   sublist[-1]				):
															sublist.append(UpperCAmelCase__				)
															arr.pop(UpperCAmelCase__				)

    #  merging sublist into solution list
					if not solution:
										solution.extend(UpperCAmelCase__				)
					else:
										while sublist:
															A_				 =						sublist.pop(0				)
															for i, xx in enumerate(UpperCAmelCase__				):
																				if not _operator(UpperCAmelCase__				,   UpperCAmelCase__				):
																									solution.insert(UpperCAmelCase__				,   UpperCAmelCase__				)
																									break
															else:
																				solution.append(UpperCAmelCase__				)

					strand_sort(UpperCAmelCase__				,   UpperCAmelCase__				,   UpperCAmelCase__				)
					return solution


if __name__ == "__main__":
		assert strand_sort([4, 3, 5, 1, 2]) == [1, 2, 3, 4, 5]
		assert strand_sort([4, 3, 5, 1, 2], reverse=True) == [5, 4, 3, 2, 1]






"""simple docstring"""





import torch
def 							A_     ():

					'''simple docstring'''





					if torch.cuda.is_available():
										A_				 =						torch.cuda.device_count()
					else:
										A_				 =						0
					print(f'Successfully ran on {num_gpus} GPUs'				)


if __name__ == "__main__":
		main()




