Implement a Python function called empty that accepts a single argument coll (a collection or iterator) and…
Implement a Python function called empty that accepts a single argument coll (a collection or iterator) and…: a task in repo2rlenv-r2e (Harbor dataset). Observable contract: - If coll is any collections.abc.Iterator (including generators), return an empty iterator (i.e., iter( ) ). - If coll is a…
The task
Observable contract: - If `coll` is any `collections.abc.Iterator` (including generators), return an empty iterator (i.e., `iter([])`). - If `coll` is a `defaultdict`, return a new empty `defaultdict` that preserves the same `default_factory`. - If `coll` is a `dict_keys`, `dict_values`, or `dict_items` view, return…
Part of FineEnvs/repo2rlenv-r2e.