



import logging
import os

from .state import PartialState






class 						__a (     logging.LoggerAdapter				):



	@staticmethod
	def 		UpperCamelCase							(						snake_case_							:    int)->							Optional[Any]:
						__lowerCAmelCase	   =PartialState()
						return not main_process_only or (main_process_only and state.is_main_process)



	def 		UpperCamelCase							(						self							:    Optional[Any]				,	snake_case_							:    Dict				,	snake_case_							:    Union[str, Any]				,	*snake_case_							:    List[str]				,	**snake_case_							:    Dict)->							Tuple:






						if PartialState._shared_state == {}:
											raise RuntimeError(
											    """You must initialize the accelerate state by calling either `PartialState()` or `Accelerator()` before using the logging utility.""")
						__lowerCAmelCase	   =kwargs.pop("""main_process_only"""				,	lowerCamelCase__)
						__lowerCAmelCase	   =kwargs.pop("""in_order"""				,	lowerCamelCase__)

						if self.isEnabledFor(lowerCamelCase__):
											if self._should_log(lowerCamelCase__):
																__lowerCAmelCase	   =self.process(lowerCamelCase__				,	lowerCamelCase__)
																self.logger.log(lowerCamelCase__				,	lowerCamelCase__				,	*lowerCamelCase__				,	**lowerCamelCase__)

											elif in_order:
																__lowerCAmelCase	   =PartialState()
																for i in range(state.num_processes):
																					if i == state.process_index:
																										__lowerCAmelCase	   =self.process(lowerCamelCase__				,	lowerCamelCase__)
																										self.logger.log(lowerCamelCase__				,	lowerCamelCase__				,	*lowerCamelCase__				,	**lowerCamelCase__)
																					state.wait_for_everyone()






def 					__lowerCAmelCase		(  __lowerCamelCase	:    str				,   __lowerCamelCase	:    str = None	)  ->						int:



					if log_level is None:
										__lowerCAmelCase	   =os.environ.get("""ACCELERATE_LOG_LEVEL"""				,   __lowerCamelCase	)
					__lowerCAmelCase	   =logging.getLogger(__lowerCamelCase	)
					if log_level is not None:
										logger.setLevel(log_level.upper()	)
										logger.root.setLevel(log_level.upper()	)
					return MultiProcessAdapter(__lowerCamelCase				,   {}	)









def 					__lowerCAmelCase		(  __lowerCamelCase	:    list	)  ->						list:
					__lowerCAmelCase	   =False
					while is_sorted is False:  # Until all the indices are traversed keep looping
										__lowerCAmelCase	   =True
										for i in range(0				,   len(__lowerCamelCase	) - 1				,   2	):  # iterating over all even indices
															if input_list[i] > input_list[i + 1]:
																				__lowerCAmelCase   ,	__lowerCAmelCase	   =input_list[i + 1], input_list[i]
																				# swapping if elements not in order
																				__lowerCAmelCase	   =False

										for i in range(1				,   len(__lowerCamelCase	) - 1				,   2	):  # iterating over all odd indices
															if input_list[i] > input_list[i + 1]:
																				__lowerCAmelCase   ,	__lowerCAmelCase	   =input_list[i + 1], input_list[i]
																				# swapping if elements not in order
																				__lowerCAmelCase	   =False
					return input_list


if __name__ == "__main__":
				print('''Enter list to be sorted''')
				lowercase_	       =			[int(x) for x in input().split()]
				# inputing elements of the list in one line
				lowercase_	       =			odd_even_sort(input_list)
				print('''The sorted list is''')
				print(sorted_list)




