What is a decorator in Python and how to use it?