


'''simple docstring'''

import timeit

import numpy as np

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






def __UpperCamelCase   (			__lowerCamelCase		: Optional[Any]				)      ->     str:







     '''simple docstring'''






     def wrapper(*__lowerCamelCase		: Any      ,  **__lowerCamelCase		: Dict				):
          _a						=		timeit.default_timer()
          _a						=		func(*__lowerCamelCase      ,  **__lowerCamelCase				)
          _a						=		timeit.default_timer() - starttime
          return delta

     _a						=		func.__name__

     return wrapper






def __UpperCamelCase   (			__lowerCamelCase		: dict      ,  __lowerCamelCase		: List[str]=100      ,  __lowerCamelCase		: List[str]=None				)      ->     List[Any]:







     '''simple docstring'''






     _a						=		[]
     _a						=		seq_shapes or {}
     for i in range(__lowerCamelCase				):
          _a						=		{}
          for col_id, (k, v) in enumerate(features.items()				):
               if isinstance(__lowerCamelCase      ,  _ArrayXD				):
                    _a						=		np.random.rand(*v.shape				).astype(v.dtype				)
               elif isinstance(__lowerCamelCase      ,  datasets.Value				):
                    if v.dtype == "string":
                         _a						=		"The small grey turtle was surprisingly fast when challenged."
                    else:
                         _a						=		np.random.randint(10      ,  size=1				).astype(v.dtype				).item()
               elif isinstance(__lowerCamelCase      ,  datasets.Sequence				):
                    while isinstance(__lowerCamelCase      ,  datasets.Sequence				):
                         _a						=		v.feature
                    _a						=		seq_shapes[k]
                    _a						=		np.random.rand(*__lowerCamelCase				).astype(v.dtype				)
               _a						=		data

          dummy_data.append((i, example)				)

     return dummy_data






def __UpperCamelCase   (			__lowerCamelCase		: int      ,  __lowerCamelCase		: List[Any]      ,  __lowerCamelCase		: Any=100      ,  __lowerCamelCase		: Optional[int]=None				)      ->     List[str]:







     '''simple docstring'''






     _a						=		generate_examples(__lowerCamelCase      ,  num_examples=__lowerCamelCase      ,  seq_shapes=__lowerCamelCase				)

     with ArrowWriter(features=__lowerCamelCase      ,  path=__lowerCamelCase				) as writer:
          for key, record in dummy_data:
               _a						=		features.encode_example(__lowerCamelCase				)
               writer.write(__lowerCamelCase				)

          _a			,			_a						=		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						=		datasets.Dataset.from_file(filename=__lowerCamelCase      ,  info=datasets.DatasetInfo(features=__lowerCamelCase				)				)

     return dataset









'''simple docstring'''

lowercase__				     =		65_521






def __UpperCamelCase   (			__lowerCamelCase		: str				)      ->     int:







     '''simple docstring'''






     _a						=		1
     _a						=		0
     for plain_chr in plain_text:
          _a						=		(a + ord(__lowerCamelCase				)) % MOD_ADLER
          _a						=		(b + a) % MOD_ADLER
     return (b << 16) | a

