





import logging
import os

from .state import PartialState






class 					__A    (    logging.LoggerAdapter ):

			'''simple docstring'''







			@staticmethod
			def 		__lowerCamelCase				(    __lowerCAmelCase							):



				'''simple docstring'''







				lowerCamelCase__								=		PartialState()
				return not main_process_only or (main_process_only and state.is_main_process)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase       ,  __lowerCAmelCase       ,  *__lowerCAmelCase       ,  **__lowerCAmelCase							):



				'''simple docstring'''







				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'''       ,  UpperCamelCase_							)
				lowerCamelCase__								=		kwargs.pop('''in_order'''       ,  UpperCamelCase_							)

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

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





def lowerCAmelCase__(__snake_case       ,__snake_case = None							)				->      Union[str, Any]:







	'''simple docstring'''







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







from __future__ import annotations
def 			_a (      SCREAMING_SNAKE_CASE						,				SCREAMING_SNAKE_CASE     ):


		"""simple docstring"""




		lowercase__            =      0
		lowercase__            =      len(SCREAMING_SNAKE_CASE     ) - 1

		while i < j:
				if nums[i] + nums[j] == target:
						return [i, j]
				elif nums[i] + nums[j] < target:
						lowercase__            =      i + 1
				else:
						lowercase__            =      j - 1

		return []


if __name__ == "__main__":
			import doctest

			doctest.testmod()
			print(f"""{two_pointer([2, 7, 11, 15], 9) = }""")


