Backport PR #5669: allows threadsafe sys.stdout.flush from background threads

allows threadsafe flush from background threads
Backport PR #5804: remove an inappropriate `!`

The logic was backward, causing input prompt not to be set when many executions were submitted simultaneously.

closes #5800
Backport PR #5486: disambiguate to location when no IPs can be determined

previously, fallback was to localhost, which could often be wrong.

closes #5477
Backport PR #5592: add missing `browser` to notebook_aliases list

closes #5589
Backport PR #5620: fixed a typo in IPython.core.formatters
Backport PR #5647: Mention git hooks in install documentation

This addition is done to avoid problems similar to #5355
Backport PR #5657: use 'localhost' as default for the notebook server

instead of loopback IP

seems to workaround weird issues with Sophos on Windows, and should behave the same everywhere else.
Backport PR #5670: nbconvert: Fix CWD imports

In master, setting an nbconvert class name to one that's located in the CWD doesn't work (i.e. `c.NbConvertApp.writer_class = 'notebook_copy_writer.NotebookCopyWriter'` ).

The CWD needs to be appended to the Python path before the traitlets are initialized.  This PR also includes a test.
Backport PR #5671: Fix blank slides issue in Reveal slideshow pdf export

Applied the bugfix made on the original index.html from
reveal.js project into the template :

- https://github.com/hakimel/reveal.js/commit/08fb6cb2f96a6d97aaa21c35a925ebb59b0b0070
Backport PR #5677: Fix %bookmark -l for Python 3

Closes gh-5676

Also add a simple test for %bookmark
Backport PR #5692: Update notebook.rst fixing broken reference to notebook examples readme

Since the notebook directory doesn't contain a readme anymore, updating to point to the index notebook rendered via nbviewer
Backport PR #5693: Update parallel_intro.rst to fix a broken link to examples

fixing broken link to examples directory and updating the github link to point to the nbviewer index page
Backport PR #5699: don't use common names in require decorators

causes kwarg collisions if the depended-upon function has the same name.

closes #5698