

from collections import defaultdict







def _a			(	SCREAMING_SNAKE_CASE		:      str		)   ->   dict:

 """simple docstring"""






 __lowerCAmelCase:       defaultdict[str, int]            =				defaultdict(SCREAMING_SNAKE_CASE		)
 # Creating a dictionary containing count of each word
 for word in sentence.split():
  occurrence[word] += 1
 return occurrence


if __name__ == "__main__":
  for word, count in word_occurrence('''INPUT STRING''').items():
    print(f"{word}: {count}")








import json
import os
from dataclasses import dataclass

import numpy as np
import pyarrow as pa

import datasets
from utils import get_duration


_a			=       1_0_0_0_0_0_0_0_0_0_0_0
_a			=       1_0_0_0_0

_a	,     _a			=       os.path.split(__file__)
_a			=       os.path.join(RESULTS_BASEPATH, '''results''', RESULTS_FILENAME.replace('''.py''', '''.json'''))







def _a			(	SCREAMING_SNAKE_CASE		:      int   , SCREAMING_SNAKE_CASE		:      int		)   ->   datasets.Dataset:

 """simple docstring"""






 __lowerCAmelCase:       List[Any]            =				pa.Table.from_pydict({'col': [0] * chunk_size}		)
 __lowerCAmelCase:       Dict            =				pa.concat_tables([table] * (num_examples // chunk_size)		)
 return datasets.Dataset(SCREAMING_SNAKE_CASE   , fingerprint='table_100B'		)






@dataclass
class 							A_			:
     _lowercase      :					int
     _lowercase      :					int
     _lowercase      :					int
     _lowercase      :					int


     def   UpperCAmelCase  (							self      :		Optional[Any] )							->     Dict:
      __lowerCAmelCase:       Dict            =				np.random.default_rng(self.seed )
      __lowerCAmelCase:       List[Any]            =				rng.integers(low=self.low      ,  high=self.high      ,  size=self.size ).tolist()


     def __iter__(							self      :		Any )							->     Optional[int]:
      return iter(self._sampled_values )


     def __len__(							self      :		Union[str, Any] )							->     Dict:
      return self.size







@get_duration
def _a			(	SCREAMING_SNAKE_CASE		:      datasets.Dataset		)   ->   List[str]:

 """simple docstring"""






 __lowerCAmelCase:       List[Any]            =				dataset[0]







@get_duration
def _a			(	SCREAMING_SNAKE_CASE		:      datasets.Dataset		)   ->   Dict:

 """simple docstring"""






 __lowerCAmelCase:       Dict            =				dataset[-1]







@get_duration
def _a			(	SCREAMING_SNAKE_CASE		:      datasets.Dataset		)   ->   Any:

 """simple docstring"""






 __lowerCAmelCase:       Union[str, Any]            =				dataset[range(len(SCREAMING_SNAKE_CASE		) // 2   , len(SCREAMING_SNAKE_CASE		) // 2 + 10_24		)]







@get_duration
def _a			(	SCREAMING_SNAKE_CASE		:      datasets.Dataset		)   ->   Optional[Any]:

 """simple docstring"""






 __lowerCAmelCase:       int            =				dataset[RandIter(0   , len(SCREAMING_SNAKE_CASE		)   , 10_24   , seed=42		)]







def _a			(	)   ->   Tuple:

 """simple docstring"""






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

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


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





