






"""simple docstring"""



import json
import os
from dataclasses import dataclass

import numpy as np
import pyarrow as pa

import datasets
from utils import get_duration


_UpperCamelCase						:    int		=						1_0_0_0_0_0_0_0_0_0_0_0
_UpperCamelCase						:    Union[str, Any]		=						1_0_0_0_0

_UpperCamelCase,						_UpperCamelCase						:    Tuple		=						os.path.split(__file__)
_UpperCamelCase						:    List[Any]		=						os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    int						,   __snake_case     :    int       ):





  '''simple docstring'''





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

@dataclass
class 			a	:
    UpperCAmelCase_					:	int
    UpperCAmelCase_					:	int
    UpperCAmelCase_					:	int
    UpperCAmelCase_					:	int







    def      UpperCamelCase_ (     self			):
      lowercase				       =			np.random.default_rng(self.seed			)
      lowercase				       =			rng.integers(low=self.low				,						high=self.high				,						size=self.size			).tolist()







    def __iter__(     self			):
      return iter(self._sampled_values			)







    def __len__(     self			):
      return self.size


@get_duration
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    datasets.Dataset       ):





  '''simple docstring'''





  lowercase				       =			dataset[0]
@get_duration
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    datasets.Dataset       ):





  '''simple docstring'''





  lowercase				       =			dataset[-1]
@get_duration
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    datasets.Dataset       ):





  '''simple docstring'''





  lowercase				       =			dataset[range(len(__snake_case       ) // 2						,   len(__snake_case       ) // 2 + 10_24       )]
@get_duration
def 		_SCREAMING_SNAKE_CASE					(       __snake_case     :    datasets.Dataset       ):





  '''simple docstring'''





  lowercase				       =			dataset[RandIter(0						,   len(__snake_case       )						,   10_24						,   seed=42       )]
def 		_SCREAMING_SNAKE_CASE					(       ):





  '''simple docstring'''





  lowercase				       =			{'num examples': SPEED_TEST_N_EXAMPLES}
  lowercase				       =			(get_first_row, get_last_row, get_batch_of_aaaa_rows, get_batch_of_aaaa_random_rows)
  print('generating dataset'       )
  lowercase				       =			generate_100B_dataset(num_examples=__snake_case						,   chunk_size=__snake_case       )
  print('Functions'       )
  for func in functions:
    print(func.__name__       )
    lowercase				       =			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()










'''simple docstring'''





def  lowerCamelCase_  (     lowercase__					,  lowercase__):
 lowerCamelCase__	=  len(lowercase__)
 lowerCamelCase__	=  len(lowercase__)
 lowerCamelCase__	=  (
     first_input_list_length
     if first_input_list_length > second_input_list_length
     else second_input_list_length
 )
 lowerCamelCase__	=  []
 for char_count in range(lowercase__):
  if char_count < first_input_list_length:
   output_result_list.append(first_input_list[char_count])
  if char_count < second_input_list_length:
   output_result_list.append(second_input_list[char_count])

 return output_result_list


if __name__ == "__main__":
 print(alternative_list_arrange(["""A""", """B""", """C"""], [1, 2, 3, 4, 5]), end=""" """)

