Write a Python function called pairwise(src, end= UNSET) that takes an iterable src and an optional end…
Write a Python function called pairwise(src, end= UNSET) that takes an iterable src and an optional end…: a task in repo2rlenv-r2e (Harbor dataset). Observable behavior: - Without end : returns a list of (src i , src i+1 ) pairs for all valid consecutive positions. An empty iterable returns . A…
The task
Observable behavior: - Without `end`: returns a list of `(src[i], src[i+1])` pairs for all valid consecutive positions. An empty iterable returns `[]`. A single-element iterable returns `[]`. An iterable of length N returns N-1 pairs. - With `end` provided (including `None` or any other value): returns N pairs for an…
Part of FineEnvs/repo2rlenv-r2e.