HF RL Explorer

Implement a function called unique that takes an iterable src and an optional key parameter (defaulting to…

Implement a function called unique that takes an iterable src and an optional key parameter (defaulting to…: a task in repo2rlenv-r2e (Harbor dataset). Uniqueness is determined by key : - If key is None , elements are compared directly by equality. - If key is a callable, it is applied to each…

The task

Uniqueness is determined by `key`: - If `key` is `None`, elements are compared directly by equality. - If `key` is a callable, it is applied to each element and the result is used for comparison. - If `key` is a string, it is used as an attribute name: `getattr(element, key)` is attempted, and if the attribute does…

Part of FineEnvs/repo2rlenv-r2e.