


'''simple docstring'''


import json
import os
import tempfile

import datasets
from utils import generate_example_dataset, get_duration


_UpperCamelCase          =     50_0000

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


@get_duration
def 		_lowercase   (SCREAMING_SNAKE_CASE       ):




     '''simple docstring'''





     __A  :					int						     =       dataset.select(range(0					,				len(SCREAMING_SNAKE_CASE       )					,				2       )       )


@get_duration
def 		_lowercase   (SCREAMING_SNAKE_CASE       ):




     '''simple docstring'''





     __A  :					Optional[int]						     =       dataset.sort("numbers"       )


@get_duration
def 		_lowercase   (SCREAMING_SNAKE_CASE       ):




     '''simple docstring'''





     __A  :					List[Any]						     =       dataset.shuffle()


@get_duration
def 		_lowercase   (SCREAMING_SNAKE_CASE       ):




     '''simple docstring'''





     __A  :					Tuple						     =       dataset.train_test_split(0.1       )


@get_duration
def 		_lowercase   (SCREAMING_SNAKE_CASE					,				SCREAMING_SNAKE_CASE=10       ):




     '''simple docstring'''





     for shard_id in range(SCREAMING_SNAKE_CASE       ):
          __A  :					Any						     =       dataset.shard(SCREAMING_SNAKE_CASE					,				SCREAMING_SNAKE_CASE       )


def 		_lowercase   ():




     '''simple docstring'''





     __A  :					Optional[int]						     =       {'''num examples''': SPEED_TEST_N_EXAMPLES}
     __A  :					Tuple						     =       (select, sort, shuffle, train_test_split, shard)
     with tempfile.TemporaryDirectory() as tmp_dir:
          print("generating dataset"       )
          __A  :					List[Any]						     =       datasets.Features({"text": datasets.Value("string"       ), "numbers": datasets.Value("float32"       )}       )
          __A  :					str						     =       generate_example_dataset(
              os.path.join(SCREAMING_SNAKE_CASE					,				"dataset.arrow"       )					,				SCREAMING_SNAKE_CASE					,				num_examples=SCREAMING_SNAKE_CASE       )
          print("Functions"       )
          for func in functions:
               print(func.__name__       )
               __A  :					List[Any]						     =       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_indices_mapping()





'''simple docstring'''


from collections import defaultdict


def 		_lowercase   (SCREAMING_SNAKE_CASE = 5       ):




     '''simple docstring'''





     __A  :					int						     =       defaultdict(SCREAMING_SNAKE_CASE       )
     __A  :					Optional[Any]						     =       0

     while True:
          __A  :					List[str]						     =       get_digits(SCREAMING_SNAKE_CASE       )
          freqs[digits].append(SCREAMING_SNAKE_CASE       )

          if len(freqs[digits]       ) == max_base:
               __A  :					Optional[int]						     =       freqs[digits][0] ** 3
               return base

          num += 1


def 		_lowercase   (SCREAMING_SNAKE_CASE       ):




     '''simple docstring'''





     return "".join(sorted(str(num**3       )       )       )


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

