Binary search, a stable sort with key= and recursion over nested data, in plain Python and proven by pytest-style tests.