(#20) Vendor a copy of the `pick` function