




import json
import os
import tempfile

import datasets
from utils import generate_example_dataset, get_duration


a_ 		=  50_0000

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




@get_duration
def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						List[str]:

    """simple docstring"""


    __UpperCamelCase			=    dataset.select(range(0       ,  len(lowercase_   )       ,  2   )   )




@get_duration
def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						Optional[Any]:

    """simple docstring"""


    __UpperCamelCase			=    dataset.sort('''numbers'''   )




@get_duration
def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						Optional[Any]:

    """simple docstring"""


    __UpperCamelCase			=    dataset.shuffle()




@get_duration
def        __SCREAMING_SNAKE_CASE (	lowercase_   )							->						str:

    """simple docstring"""


    __UpperCamelCase			=    dataset.train_test_split(0.1   )




@get_duration
def        __SCREAMING_SNAKE_CASE (	lowercase_       ,  lowercase_=10   )							->						Any:

    """simple docstring"""


    for shard_id in range(lowercase_   ):
        __UpperCamelCase			=    dataset.shard(lowercase_       ,  lowercase_   )




def        __SCREAMING_SNAKE_CASE (	)							->						Union[str, Any]:

    """simple docstring"""


    __UpperCamelCase			=    {'''num examples''': SPEED_TEST_N_EXAMPLES}
    __UpperCamelCase			=    (select, sort, shuffle, train_test_split, shard)
    with tempfile.TemporaryDirectory() as tmp_dir:
        print('''generating dataset'''   )
        __UpperCamelCase			=    datasets.Features({'''text''': datasets.Value('''string'''   ), '''numbers''': datasets.Value('''float32'''   )}   )
        __UpperCamelCase			=    generate_example_dataset(
            os.path.join(lowercase_       ,  '''dataset.arrow'''   )       ,  lowercase_       ,  num_examples=lowercase_   )
        print('''Functions'''   )
        for func in functions:
            print(func.__name__   )
            __UpperCamelCase			=    func(lowercase_   )

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


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







def 	__lowerCamelCase							(				)      ->       Dict:
	_lowercase   =1

	while True:
		if (
		    sorted(str(__a		)		)
		    == sorted(str(2 * i		)		)
		    == sorted(str(3 * i		)		)
		    == sorted(str(4 * i		)		)
		    == sorted(str(5 * i		)		)
		    == sorted(str(6 * i		)		)
		):
			return i

		i += 1


if __name__ == "__main__":
						print(solution())




