





import timeit

import numpy as np

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features.features import _ArrayXD

def   __snake_case    (       _lowerCAmelCase			:			Dict						)			->    Any:
   def wrapper(*_lowerCAmelCase			:			Any					,					**_lowerCAmelCase			:			Optional[int]						):
      A_       :					List[str]        =      timeit.default_timer()
      A_       :					List[str]        =      func(*_lowerCAmelCase					,					**_lowerCAmelCase						)
      A_       :					List[Any]        =      timeit.default_timer() - starttime
      return delta

   A_       :					Optional[Any]        =      func.__name__

   return wrapper

def   __snake_case    (       _lowerCAmelCase			:			dict					,					_lowerCAmelCase			:			Any=100					,					_lowerCAmelCase			:			List[str]=None						)			->    Dict:
   A_       :					Optional[int]        =      []
   A_       :					List[Any]        =      seq_shapes or {}
   for i in range(_lowerCAmelCase						):
      A_       :					Tuple        =      {}
      for col_id, (k, v) in enumerate(features.items()						):
         if isinstance(_lowerCAmelCase					,					_ArrayXD						):
            A_       :					str        =      np.random.rand(*v.shape						).astype(v.dtype						)
         elif isinstance(_lowerCAmelCase					,					datasets.Value						):
            if v.dtype == "string":
               A_       :					Optional[Any]        =      "The small grey turtle was surprisingly fast when challenged."
            else:
               A_       :					Dict        =      np.random.randint(10					,					size=1						).astype(v.dtype						).item()
         elif isinstance(_lowerCAmelCase					,					datasets.Sequence						):
            while isinstance(_lowerCAmelCase					,					datasets.Sequence						):
               A_       :					Any        =      v.feature
            A_       :					Dict        =      seq_shapes[k]
            A_       :					Optional[int]        =      np.random.rand(*_lowerCAmelCase						).astype(v.dtype						)
         A_       :					Dict        =      data

      dummy_data.append((i, example)						)

   return dummy_data





def   __snake_case    (       _lowerCAmelCase			:			List[Any]					,					_lowerCAmelCase			:			Optional[Any]					,					_lowerCAmelCase			:			Union[str, Any]=100					,					_lowerCAmelCase			:			List[str]=None						)			->    Any:
   A_       :					Optional[Any]        =      generate_examples(_lowerCAmelCase					,					num_examples=_lowerCAmelCase					,					seq_shapes=_lowerCAmelCase						)

   with ArrowWriter(features=_lowerCAmelCase					,					path=_lowerCAmelCase						) as writer:
      for key, record in dummy_data:
         A_       :					List[str]        =      features.encode_example(_lowerCAmelCase						)
         writer.write(_lowerCAmelCase						)

      A_   ,    A_       :					Dict        =      writer.finalize()

   if not num_final_examples == num_examples:
      raise ValueError(
          f"Error writing the dataset, wrote {num_final_examples} examples but should have written {num_examples}."						)

   A_       :					Dict        =      datasets.Dataset.from_file(filename=_lowerCAmelCase					,					info=datasets.DatasetInfo(features=_lowerCAmelCase						)						)

   return dataset







from math import sqrt

def   __snake_case    (       _lowerCAmelCase			:			int						)			->    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(sqrt(_lowerCAmelCase						) + 1						)					,					6						):
      if number % i == 0 or number % (i + 2) == 0:
         return False
   return True

def   __snake_case    (       _lowerCAmelCase			:			int = 10001						)			->    int:
   A_       :					Any        =      0
   A_       :					Tuple        =      1
   while count != nth and number < 3:
      number += 1
      if is_prime(_lowerCAmelCase						):
         count += 1
   while count != nth:
      number += 2
      if is_prime(_lowerCAmelCase						):
         count += 1
   return number


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