Write a Python function called soft sorted(iterable, first=None, last=None, key=None, reverse=False) that…
Write a Python function called soft sorted(iterable, first=None, last=None, key=None, reverse=False) that…: a task in repo2rlenv-r2e (Harbor dataset). Examples of expected behavior: - soft sorted( 'two', 'b', 'one', 'a' , first= 'one', 'two' ) → 'one', 'two', 'a', 'b' - soft sorted(range(7)…
The task
Examples of expected behavior: - `soft_sorted(['two', 'b', 'one', 'a'], first=['one', 'two'])` → `['one', 'two', 'a', 'b']` - `soft_sorted(range(7), first=[6, 15], last=[2, 4], reverse=True)` → `[6, 5, 3, 1, 0, 2, 4]` - `soft_sorted(['a', 'b', 'c', 'd', 'e'], last=['e', 'c', 'a'])` → `['b', 'd', 'e', 'c', 'a']` -…
Part of FineEnvs/repo2rlenv-r2e.