DOC/CLN: cookbook addition, minor cleaning in internals.py