
"""simple docstring"""




import logging
import os

from .state import PartialState





class  snake_case     (							logging.LoggerAdapter   ):

							@staticmethod
							def _lowercase					(SCREAMING_SNAKE_CASE_    ):

									"""simple docstring"""







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







							def _lowercase					(self       ,       SCREAMING_SNAKE_CASE_       ,       SCREAMING_SNAKE_CASE_       ,       *SCREAMING_SNAKE_CASE_       ,       **SCREAMING_SNAKE_CASE_    ):

									"""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.'''    )
									SCREAMING_SNAKE_CASE_						 = kwargs.pop('''main_process_only'''       ,       SCREAMING_SNAKE_CASE_    )
									SCREAMING_SNAKE_CASE_						 = kwargs.pop('''in_order'''       ,       SCREAMING_SNAKE_CASE_    )

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

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







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

"""simple docstring"""




from __future__ import annotations

import typing
from collections import Counter



def        _lowerCamelCase ( __a    ):
		SCREAMING_SNAKE_CASE_						 = Counter()
		for base in range(1,							max_perimeter + 1    ):
				for perpendicular in range(__a,							max_perimeter + 1    ):
						SCREAMING_SNAKE_CASE_						 = (base * base + perpendicular * perpendicular) ** 0.5
						if hypotenuse == int(__a    ):
								SCREAMING_SNAKE_CASE_						 = int(base + perpendicular + hypotenuse    )
								if perimeter > max_perimeter:
										continue
								triplets[perimeter] += 1
		return triplets



def        _lowerCamelCase ( __a = 1_000    ):
		SCREAMING_SNAKE_CASE_						 = pythagorean_triple(__a    )
		return triplets.most_common(1    )[0][0]


if __name__ == "__main__":
						print(f'''Perimeter {solution()} has maximum solutions''')