





"""simple docstring"""






import itertools
from dataclasses import dataclass
from typing import Optional

import pandas as pd
import pyarrow as pa

import datasets
from datasets.table import table_cast




@dataclass
class 				__lowercase			(			datasets.BuilderConfig							):







					'''simple docstring'''




					__lowerCAmelCase  =  None






class 				__lowercase			(			datasets.ArrowBasedBuilder							):







					'''simple docstring'''




					__lowerCAmelCase  =  PandasConfig







					def  _lowerCamelCase     (						self     ):
									return datasets.DatasetInfo(features=self.config.features     )







					def  _lowerCamelCase     (						self	,			_UpperCAmelCase     ):
									if not self.config.data_files:
													raise ValueError(f"""At least one data file must be specified, but got data_files={self.config.data_files}"""     )
									__a :						int			       =  dl_manager.download_and_extract(self.config.data_files     )
									if isinstance(_UpperCAmelCase	,			(str, list, tuple)     ):
													__a :						Union[str, Any]			       =  data_files
													if isinstance(_UpperCAmelCase	,			_UpperCAmelCase     ):
																	__a :						Dict			       =  [files]
													# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
													__a :						int			       =  [dl_manager.iter_files(_UpperCAmelCase     ) for file in files]
													return [datasets.SplitGenerator(name=datasets.Split.TRAIN	,			gen_kwargs={'''files''': files}     )]
									__a :						List[str]			       =  []
									for split_name, files in data_files.items():
													if isinstance(_UpperCAmelCase	,			_UpperCAmelCase     ):
																	__a :						Optional[Any]			       =  [files]
													# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
													__a :						int			       =  [dl_manager.iter_files(_UpperCAmelCase     ) for file in files]
													splits.append(datasets.SplitGenerator(name=_UpperCAmelCase	,			gen_kwargs={'''files''': files}     )     )
									return splits







					def  _lowerCamelCase     (						self	,			_UpperCAmelCase     ):
									if self.config.features is not None:
													# more expensive cast to support nested features with keys in a different order
													# allows str <-> int/float or str to Audio for example
													__a :						str			       =  table_cast(_UpperCAmelCase	,			self.config.features.arrow_schema     )
									return pa_table







					def  _lowerCamelCase     (						self	,			_UpperCAmelCase     ):
									for i, file in enumerate(itertools.chain.from_iterable(_UpperCAmelCase     )     ):
													with open(_UpperCAmelCase	,			'''rb'''     ) as f:
																	__a :						List[Any]			       =  pa.Table.from_pandas(pd.read_pickle(_UpperCAmelCase     )     )
																	yield i, self._cast_table(_UpperCAmelCase     )






"""simple docstring"""






from __future__ import annotations

import typing
from collections import Counter

def     __A      (			a_						:int)		->		typing.Counter[int]:
				__a :						typing.Counter[int]			       =  Counter()
				for base in range(1   ,       max_perimeter + 1):
								for perpendicular in range(a_   ,       max_perimeter + 1):
												__a :						Any			       =  (base * base + perpendicular * perpendicular) ** 0.5
												if hypotenuse == int(a_):
																__a :						List[Any]			       =  int(base + perpendicular + hypotenuse)
																if perimeter > max_perimeter:
																				continue
																triplets[perimeter] += 1
				return triplets

def     __A      (			a_						:int = 10_00)		->		int:
				__a :						Dict			       =  pythagorean_triple(a_)
				return triplets.most_common(1)[0][0]


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