HF RL Explorer

Write a Python function called random permutation(iterable, r=None) that returns a randomly ordered tuple of…

Write a Python function called random permutation(iterable, r=None) that returns a randomly ordered tuple of…: a task in repo2rlenv-r2e (Harbor dataset). Behavior requirements: - Accept any iterable as input (list, tuple, range, str, generator, etc.). - Convert the iterable to an internal pool…

The task

Behavior requirements: - Accept any iterable as input (list, tuple, range, str, generator, etc.). - Convert the iterable to an internal pool (tuple) before sampling. - If `r` is `None` or not provided, use the full length of the pool as `r`, producing a complete random permutation of all elements. - If `r` is 0 or…

Part of FineEnvs/repo2rlenv-r2e.