






import json
import os
from dataclasses import dataclass

import numpy as np
import pyarrow as pa

import datasets
from utils import get_duration


UpperCamelCase__						:      Dict								=					100_000_000_000
UpperCamelCase__						:      Union[str, Any]								=					10_000

UpperCamelCase__						:      List[str]								=					os.path.split(__file__)
UpperCamelCase__						:      str								=					os.path.join(RESULTS_BASEPATH, """results""", RESULTS_FILENAME.replace(""".py""", """.json"""))





def   SCREAMING_SNAKE_CASE__						(   snake_case_,  snake_case_  )   ->  datasets.Dataset:


	"""simple docstring"""



	a		=			pa.Table.from_pydict({'''col''': [0] * chunk_size}  )
	a		=			pa.concat_tables([table] * (num_examples // chunk_size)  )
	return datasets.Dataset(snake_case_,  fingerprint='''table_100B'''  )







@dataclass
class 				lowerCamelCase_     :
							SCREAMING_SNAKE_CASE_						     =			42
							SCREAMING_SNAKE_CASE_						     =			42
							SCREAMING_SNAKE_CASE_						     =			42
							SCREAMING_SNAKE_CASE_						     =			42
							def  SCREAMING_SNAKE_CASE_ (						self		:					str					):





								'''simple docstring'''



								a		=			np.random.default_rng(self.seed					)
								a		=			rng.integers(low=self.low							,high=self.high							,size=self.size					).tolist()
							def __iter__(						self		:					str					):





								'''simple docstring'''



								return iter(self._sampled_values					)




							def __len__(						self		:					Tuple					):





								'''simple docstring'''



								return self.size





@get_duration
def   SCREAMING_SNAKE_CASE__						(   snake_case_  )   ->  Union[str, Any]:


	"""simple docstring"""



	a		=			dataset[0]





@get_duration
def   SCREAMING_SNAKE_CASE__						(   snake_case_  )   ->  List[Any]:


	"""simple docstring"""



	a		=			dataset[-1]





@get_duration
def   SCREAMING_SNAKE_CASE__						(   snake_case_  )   ->  List[Any]:


	"""simple docstring"""



	a		=			dataset[range(len(snake_case_  ) // 2,  len(snake_case_  ) // 2 + 1_0_2_4  )]





@get_duration
def   SCREAMING_SNAKE_CASE__						(   snake_case_  )   ->  List[str]:


	"""simple docstring"""



	a		=			dataset[RandIter(0,  len(snake_case_  ),  1_0_2_4,  seed=4_2  )]





def   SCREAMING_SNAKE_CASE__						(   )   ->  Union[str, Any]:


	"""simple docstring"""



	a		=			{'''num examples''': SPEED_TEST_N_EXAMPLES}
	a		=			(get_first_row, get_last_row, get_batch_of_aaaa_rows, get_batch_of_aaaa_random_rows)
	print('''generating dataset'''  )
	a		=			generate_100B_dataset(num_examples=snake_case_,  chunk_size=snake_case_  )
	print('''Functions'''  )
	for func in functions:
		print(func.__name__  )
		a		=			func(snake_case_  )

	with open(snake_case_,  '''wb'''  ) as f:
		f.write(json.dumps(snake_case_  ).encode('''utf-8'''  )  )


if __name__ == "__main__":  # useful to run the profiler
				benchmark_table_100B()













UpperCamelCase__						:      Dict								=					10**8





def   SCREAMING_SNAKE_CASE__						(   snake_case_  )   ->  bool:


	"""simple docstring"""



	if n % 1_0 == 0:
		return False
	a		=			str(snake_case_  )
	return s == s[::-1]





def   SCREAMING_SNAKE_CASE__						(   )   ->  int:


	"""simple docstring"""



	a		=			set()
	a		=			1
	a		=			5
	while sum_squares < LIMIT:
		a		=			first_square + 1
		while sum_squares < LIMIT:
			if is_palindrome(snake_case_  ):
				answer.add(snake_case_  )
			last_square += 1
			sum_squares += last_square**2
		first_square += 1
		a		=			first_square**2 + (first_square + 1) ** 2

	return sum(snake_case_  )


if __name__ == "__main__":
				print(solution())





