




import itertools
from dataclasses import dataclass
from typing import Optional

import pyarrow as pa

import datasets
from datasets.table import table_cast


__UpperCamelCase      : int					      =   datasets.utils.logging.get_logger(__name__)

@dataclass
class 	__lowerCAmelCase			(			datasets.BuilderConfig				):

							'''simple docstring'''





							UpperCamelCase__        =						None







class 	__lowerCAmelCase			(			datasets.ArrowBasedBuilder				):

							'''simple docstring'''





							UpperCamelCase__        =						ArrowConfig
							def    lowerCamelCase__							(		self		:List[Any]       ):







								'''simple docstring'''







								return datasets.DatasetInfo(features=self.config.features       )
							def    lowerCamelCase__							(		self		:Optional[Any]	,   __magic_name__		:Union[str, Any]       ):







								'''simple docstring'''







								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		       =							dl_manager.download_and_extract(self.config.data_files       )
								if isinstance(__a	,   (str, list, tuple)       ):
									a		       =							data_files
									if isinstance(__a	,   __a       ):
										a		       =							[files]
									# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
									a		       =							[dl_manager.iter_files(__a       ) for file in files]
									return [datasets.SplitGenerator(name=datasets.Split.TRAIN	,   gen_kwargs={"""files""": files}       )]
								a		       =							[]
								for split_name, files in data_files.items():
									if isinstance(__a	,   __a       ):
										a		       =							[files]
									# Use `dl_manager.iter_files` to skip hidden files in an extracted archive
									a		       =							[dl_manager.iter_files(__a       ) for file in files]
									# Infer features is they are stoed in the arrow schema
									if self.info.features is None:
										for file in itertools.chain.from_iterable(__a       ):
											with open(__a	,   """rb"""       ) as f:
												a		       =							datasets.Features.from_arrow_schema(pa.ipc.open_stream(__a       ).schema       )
											break
									splits.append(datasets.SplitGenerator(name=__a	,   gen_kwargs={"""files""": files}       )       )
								return splits
							def    lowerCamelCase__							(		self		:Optional[int]	,   __magic_name__		:List[str]       ):







								'''simple docstring'''







								if self.info.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		       =							table_cast(__a	,   self.info.features.arrow_schema       )
								return pa_table





							def    lowerCamelCase__							(		self		:int	,   __magic_name__		:Dict       ):







								'''simple docstring'''







								for file_idx, file in enumerate(itertools.chain.from_iterable(__a       )       ):
									with open(__a	,   """rb"""       ) as f:
										try:
											for batch_idx, record_batch in enumerate(pa.ipc.open_stream(__a       )       ):
												a		       =							pa.Table.from_batches([record_batch]       )
												# Uncomment for debugging (will print the Arrow table size and elements)
												# logger.warning(f"pa_table: {pa_table} num rows: {pa_table.num_rows}")
												# logger.warning('\n'.join(str(pa_table.slice(i, 1).to_pydict()) for i in range(pa_table.num_rows)))
												yield F'{file_idx}_{batch_idx}', self._cast_table(__a       )
										except ValueError as e:
											logger.error(F'Failed to read file \'{file}\' with error {type(__a       )}: {e}'       )
											raise







import math





def 	__A	(			__lowerCamelCase					)   -> bool:

	if 1 < number < 4:
		# 2 and 3 are primes
		return True
	elif number < 2 or number % 2 == 0 or number % 3 == 0:
		# Negatives, 0, 1, all even numbers, all multiples of 3 are not primes
		return False

	# All primes number are in format of 6k +/- 1
	for i in range(5							,    int(math.sqrt(__lowerCamelCase					) + 1					)							,    6					):
		if number % i == 0 or number % (i + 2) == 0:
			return False
	return True





def 	__A	(			__lowerCamelCase = 6008_5147_5143					)   -> int:

	try:
		a		       =							int(__lowerCamelCase					)
	except (TypeError, ValueError):
		raise TypeError("""Parameter n must be int or castable to int."""					)
	if n <= 0:
		raise ValueError("""Parameter n must be greater than or equal to one."""					)
	a		       =							0
	if is_prime(__lowerCamelCase					):
		return n
	while n % 2 == 0:
		n //= 2
	if is_prime(__lowerCamelCase					):
		return n
	for i in range(3							,    int(math.sqrt(__lowerCamelCase					)					) + 1							,    2					):
		if n % i == 0:
			if is_prime(n // i					):
				a		       =							n // i
				break
			elif is_prime(__lowerCamelCase					):
				a		       =							i
	return max_number


if __name__ == "__main__":
		print(F'{solution() = }')

