code: 
  
  
  
  
  
  
  '''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
  
  
  SCREAMING_SNAKE_CASE__		:       Union[str, Any]   							=							10_00_00_00_00_00
  SCREAMING_SNAKE_CASE__		:       Optional[Any]   							=							1_00_00
  
  SCREAMING_SNAKE_CASE__		:       Tuple   							=							os.path.split(__file__)
  SCREAMING_SNAKE_CASE__		:       List[Any]   							=							os.path.join(RESULTS_BASEPATH, """results""", RESULTS_FILENAME.replace(""".py""", """.json"""))
  
  
  
  
  
  def    _lowerCamelCase	(	__lowerCamelCase   ,       __lowerCamelCase					)   -> datasets.Dataset:
  
       '''simple docstring'''
       UpperCAmelCase__			:     Optional[int]										= pa.Table.from_pydict({"""col""": [0] * chunk_size}					)
       UpperCAmelCase__			:     Tuple										= pa.concat_tables([table] * (num_examples // chunk_size)					)
       return datasets.Dataset(__lowerCamelCase   ,       fingerprint="""table_100B"""					)
  
  
  
  
  
  
  
  @dataclass
  class 							UpperCAmelCase_     :
       __lowerCamelCase										=     42
       __lowerCamelCase										=     42
       __lowerCamelCase										=     42
       __lowerCamelCase										=     42
  
  
  
  
       def      __UpperCAmelCase     (							self		):
            UpperCAmelCase__			:     Dict										= np.random.default_rng(self.seed		)
            UpperCAmelCase__			:     Any										= 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    _lowerCamelCase	(	__lowerCamelCase					)   -> Dict:
  
       '''simple docstring'''
       UpperCAmelCase__			:     str										= dataset[0]
  
  
  
  
  
  @get_duration
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> Dict:
  
       '''simple docstring'''
       UpperCAmelCase__			:     Union[str, Any]										= dataset[-1]
  
  
  
  
  
  @get_duration
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> List[Any]:
  
       '''simple docstring'''
       UpperCAmelCase__			:     List[Any]										= dataset[range(len(__lowerCamelCase					) // 2   ,       len(__lowerCamelCase					) // 2 + 1024					)]
  
  
  
  
  
  @get_duration
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> Optional[Any]:
  
       '''simple docstring'''
       UpperCAmelCase__			:     List[str]										= dataset[RandIter(0   ,       len(__lowerCamelCase					)   ,       1024   ,       seed=42					)]
  
  
  
  
  
  def    _lowerCamelCase	(	)   -> Tuple:
  
       '''simple docstring'''
       UpperCAmelCase__			:     Any										= {"""num examples""": SPEED_TEST_N_EXAMPLES}
       UpperCAmelCase__			:     int										= (get_first_row, get_last_row, get_batch_of_aaaa_rows, get_batch_of_aaaa_random_rows)
       print("""generating dataset"""					)
       UpperCAmelCase__			:     Tuple										= generate_100B_dataset(num_examples=__lowerCamelCase   ,       chunk_size=__lowerCamelCase					)
       print("""Functions"""					)
       for func in functions:
            print(func.__name__					)
            UpperCAmelCase__			:     Tuple										= func(__lowerCamelCase					)
  
       with open(__lowerCamelCase   ,       """wb"""					) as f:
            f.write(json.dumps(__lowerCamelCase					).encode("""utf-8"""					)					)
  
  
  if __name__ == "__main__":  # useful to run the profiler
        benchmark_table_100B()
  
  
  
  
  
  
  
style_context: 
  
  
  
  
  
  
  import random
  
  
  
  
  
  
  
  class 							UpperCAmelCase_     :
  
  
  
  
       def __init__(							self  ,	_lowerCAmelCase  ,	_lowerCAmelCase		):
            UpperCAmelCase__			:     Union[str, Any]										= x
            UpperCAmelCase__			:     Union[str, Any]										= y
  
  
  
  
       def      __UpperCAmelCase     (							self		):
            return (self.x**2 + self.y**2) <= 1
  
  
  
  
       @classmethod
       def      __UpperCAmelCase     (							cls		):
            return cls(x=random.random()  ,	y=random.random()		)
  
  
  
  
  
  def    _lowerCamelCase	(	__lowerCamelCase					)   -> float:
  
       '''simple docstring'''
       if number_of_simulations < 1:
            raise ValueError("""At least one simulation is necessary to estimate PI."""					)
  
       UpperCAmelCase__			:     Dict										= 0
       for _ in range(__lowerCamelCase					):
            UpperCAmelCase__			:     Union[str, Any]										= Point.random_unit_square()
  
            if random_point.is_in_unit_circle():
                 number_in_unit_circle += 1
  
       return 4 * number_in_unit_circle / number_of_simulations
  
  
  if __name__ == "__main__":
        # import doctest
  
        # doctest.testmod()
        from math import pi
  
        SCREAMING_SNAKE_CASE__		:       List[str]   							=							"""Please enter the desired number of Monte Carlo simulations: """
        SCREAMING_SNAKE_CASE__		:       int   							=							estimate_pi(int(input(prompt).strip()))
        print(f'''An estimate of PI is {my_pi} with an error of {abs(my_pi - pi)}''')
  
  
  
  
  
  
  