DOC: fix DataFrame.nlargest and DataFrame.nsmallest doctests
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

Based on #22459. Fix the docstring for `DataFrame.nlargest` and `DataFrame.nsmallest` (since they are quite similar). I also updated `ci/code_check.sh` I extended the existing doctest of `Series.nlargest` and `Series.nsmallest`.