

def 		UpperCamelCase      (lowercase_:				list      )  ->   list:

	if len(_A      ) <= 1:
		return [tuple(_A      )]

	A__							:					Union[str, Any]       =	[]

	def generate(lowercase_:				int					,   lowercase_:				list      ):
		A__							:					Optional[Any]       =	[0] * n
		res.append(tuple(_A      )      )

		A__							:					int       =	0
		while i < n:
			if c[i] < i:
				if i % 2 == 0:
					A__     ,     A__							:					Union[str, Any]       =	arr[i], arr[0]
				else:
					A__     ,     A__							:					int       =	arr[i], arr[c[i]]
				res.append(tuple(_A      )      )
				c[i] += 1
				A__							:					List[str]       =	0
			else:
				A__							:					Dict       =	0
				i += 1

	generate(len(_A      )					,   _A      )
	return res


if __name__ == "__main__":
	A_						 =    input('Enter numbers separated by a comma:\n').strip()
	A_						 =    [int(item) for item in user_input.split(',')]
	print(heaps(arr))






import os
import tempfile
import unittest
from pathlib import Path

from transformers import AutoConfig, is_torch_available
from transformers.testing_utils import require_torch, torch_device


if is_torch_available():
	from transformers import PyTorchBenchmark, PyTorchBenchmarkArguments



@require_torch
class 					_a		(unittest.TestCase       ):


					'''simple docstring'''






					def 						__A    (				self					, A__    ):
						for model_result in results.values():
							for batch_size, sequence_length in zip(model_result["""bs"""]					, model_result["""ss"""]    ):
								A__							:					str       =	model_result["""result"""][batch_size][sequence_length]
								self.assertIsNotNone(A__    )






					def 						__A    (				self    ):
						A__							:					Dict       =	"""sshleifer/tiny-gpt2"""
						A__							:					Tuple       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					int       =	PyTorchBenchmark(A__    )
						A__							:					List[Any]       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					Dict       =	"""sgugger/tiny-distilbert-classification"""
						A__							:					Dict       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, only_pretrain_model=A__					, )
						A__							:					str       =	PyTorchBenchmark(A__    )
						A__							:					List[str]       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					Any       =	"""sshleifer/tiny-gpt2"""
						A__							:					List[Any]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, torchscript=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					Tuple       =	PyTorchBenchmark(A__    )
						A__							:					str       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					@unittest.skipIf(torch_device == """cpu"""					, """Cant do half precision"""    )
					def 						__A    (				self    ):
						A__							:					Optional[Any]       =	"""sshleifer/tiny-gpt2"""
						A__							:					Optional[Any]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, fpaa=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					str       =	PyTorchBenchmark(A__    )
						A__							:					Any       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					Optional[Any]       =	"""sshleifer/tiny-gpt2"""
						A__							:					Tuple       =	AutoConfig.from_pretrained(A__    )
						# set architectures equal to `None`
						A__							:					List[Any]       =	None
						A__							:					str       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					List[str]       =	PyTorchBenchmark(A__					, configs=[config]    )
						A__							:					Any       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					Optional[int]       =	"""sshleifer/tiny-gpt2"""
						A__							:					Optional[int]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					Any       =	PyTorchBenchmark(A__    )
						A__							:					Dict       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_train_result    )
						self.check_results_dict_not_empty(results.memory_train_result    )






					@unittest.skipIf(torch_device == """cpu"""					, """Can't do half precision"""    )
					def 						__A    (				self    ):
						A__							:					Optional[int]       =	"""sshleifer/tiny-gpt2"""
						A__							:					List[str]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, fpaa=A__					, multi_process=A__					, )
						A__							:					Dict       =	PyTorchBenchmark(A__    )
						A__							:					Optional[int]       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_train_result    )
						self.check_results_dict_not_empty(results.memory_train_result    )






					def 						__A    (				self    ):
						A__							:					int       =	"""sshleifer/tiny-gpt2"""
						A__							:					Optional[int]       =	AutoConfig.from_pretrained(A__    )
						A__							:					str       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					int       =	PyTorchBenchmark(A__					, configs=[config]    )
						A__							:					Tuple       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					List[str]       =	"""sshleifer/tinier_bart"""
						A__							:					List[str]       =	AutoConfig.from_pretrained(A__    )
						A__							:					List[str]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					Union[str, Any]       =	PyTorchBenchmark(A__					, configs=[config]    )
						A__							:					str       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_inference_result    )
						self.check_results_dict_not_empty(results.memory_inference_result    )






					def 						__A    (				self    ):
						A__							:					Optional[int]       =	"""sshleifer/tiny-gpt2"""
						A__							:					Union[str, Any]       =	AutoConfig.from_pretrained(A__    )
						A__							:					Tuple       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					int       =	PyTorchBenchmark(A__					, configs=[config]    )
						A__							:					Tuple       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_train_result    )
						self.check_results_dict_not_empty(results.memory_train_result    )






					def 						__A    (				self    ):
						A__							:					Dict       =	"""sshleifer/tinier_bart"""
						A__							:					int       =	AutoConfig.from_pretrained(A__    )
						A__							:					Union[str, Any]       =	PyTorchBenchmarkArguments(
						    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, multi_process=A__					, )
						A__							:					List[Any]       =	PyTorchBenchmark(A__					, configs=[config]    )
						A__							:					Optional[Any]       =	benchmark.run()
						self.check_results_dict_not_empty(results.time_train_result    )
						self.check_results_dict_not_empty(results.memory_train_result    )






					def 						__A    (				self    ):
						A__							:					int       =	"""sshleifer/tiny-gpt2"""
						with tempfile.TemporaryDirectory() as tmp_dir:
							A__							:					Dict       =	PyTorchBenchmarkArguments(
							    models=[MODEL_ID]					, training=A__					, inference=A__					, save_to_csv=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, inference_time_csv_file=os.path.join(A__					, """inf_time.csv"""    )					, train_memory_csv_file=os.path.join(A__					, """train_mem.csv"""    )					, inference_memory_csv_file=os.path.join(A__					, """inf_mem.csv"""    )					, train_time_csv_file=os.path.join(A__					, """train_time.csv"""    )					, env_info_csv_file=os.path.join(A__					, """env.csv"""    )					, multi_process=A__					, )
							A__							:					Optional[Any]       =	PyTorchBenchmark(A__    )
							benchmark.run()
							self.assertTrue(Path(os.path.join(A__					, """inf_time.csv"""    )    ).exists()    )
							self.assertTrue(Path(os.path.join(A__					, """train_time.csv"""    )    ).exists()    )
							self.assertTrue(Path(os.path.join(A__					, """inf_mem.csv"""    )    ).exists()    )
							self.assertTrue(Path(os.path.join(A__					, """train_mem.csv"""    )    ).exists()    )
							self.assertTrue(Path(os.path.join(A__					, """env.csv"""    )    ).exists()    )






					def 						__A    (				self    ):
						A__							:					Optional[int]       =	"""sshleifer/tiny-gpt2"""

						def _check_summary_is_not_empty(A__    ):
							self.assertTrue(hasattr(A__					, """sequential"""    )    )
							self.assertTrue(hasattr(A__					, """cumulative"""    )    )
							self.assertTrue(hasattr(A__					, """current"""    )    )
							self.assertTrue(hasattr(A__					, """total"""    )    )

						with tempfile.TemporaryDirectory() as tmp_dir:
							A__							:					Dict       =	PyTorchBenchmarkArguments(
							    models=[MODEL_ID]					, training=A__					, inference=A__					, sequence_lengths=[8]					, batch_sizes=[1]					, log_filename=os.path.join(A__					, """log.txt"""    )					, log_print=A__					, trace_memory_line_by_line=A__					, multi_process=A__					, )
							A__							:					Dict       =	PyTorchBenchmark(A__    )
							A__							:					str       =	benchmark.run()
							_check_summary_is_not_empty(result.inference_summary    )
							_check_summary_is_not_empty(result.train_summary    )
							self.assertTrue(Path(os.path.join(A__					, """log.txt"""    )    ).exists()    )



