


'''simple docstring'''






import timeit

import numpy as np

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


def  _snake_case       (					A	)						->   List[Any]:
							def wrapper(*A			,   **A	):
														lowerCAmelCase__	       =     timeit.default_timer()
														lowerCAmelCase__	       =     func(*A			,   **A	)
														lowerCAmelCase__	       =     timeit.default_timer() - starttime
														return delta

							lowerCAmelCase__	       =     func.__name__

							return wrapper


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

														dummy_data.append((i, example)	)

							return dummy_data






def  _snake_case       (					A			,   A			,   A=100			,   A=None	)						->   Tuple:
							lowerCAmelCase__	       =     generate_examples(A			,   num_examples=A			,   seq_shapes=A	)

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

														lowerCAmelCase__       , lowerCAmelCase__	       =     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}."""	)

							lowerCAmelCase__	       =     datasets.Dataset.from_file(filename=A			,   info=datasets.DatasetInfo(features=A	)	)

							return dataset



'''simple docstring'''






def  _snake_case       (					A = 10			,   A = 22	)						->   int:
							lowerCAmelCase__	       =     range(1			,   A	)
							lowerCAmelCase__	       =     range(1			,   A	)
							return sum(
							    1 for power in powers for base in bases if len(str(base**power	)	) == power	)


if __name__ == "__main__":
		print(f"""{solution(10, 22) = }""")